-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
38 lines (33 loc) · 1.33 KB
/
main.cpp
File metadata and controls
38 lines (33 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <iostream>
#include <NTL/RR.h>
#include "RemezParam.h"
#include "RemezGeneralCos.h"
#include "RemezGeneralTanh.h"
#include "RemezGeneralGelu.h"
#include "Polynomial.h"
#include "func.h"
using namespace std;
using namespace NTL;
int main()
{
long deg = 9;
long section_num = 6;
double sections[] = {-.75, -.6875, -.5, -.25, -.125, 0, .125, .25, .5, .625, .75, .875};
// double sections[] = {-4.5, -4.4375, -2.5, -2.25, -.125, 0, .125, .25, 3.5, 3.625, 5.75, 5.875};
// long section_num = 2;
// double sections[] = {-.75, -.625, -.5, -.25};
RemezParam rmparm;
// Polynomial sin_cos_polynomial;
// RemezGeneralCos* poly_generator = new RemezGeneralCos(rmparm, section_num, sections, deg, (1 << 2));
// poly_generator->generate_optimal_poly(sin_cos_polynomial);
// sin_cos_polynomial.showcoeff();
// Polynomial tanh_polynomial;
// RemezGeneralTanh* poly_generator = new RemezGeneralTanh(rmparm, section_num, sections, deg);
// poly_generator->generate_optimal_poly(tanh_polynomial);
// tanh_polynomial.showcoeff();
Polynomial gelu_polynomial;
RemezGeneralGelu* poly_generator = new RemezGeneralGelu(rmparm, section_num, sections, deg);
poly_generator->generate_optimal_poly(gelu_polynomial);
gelu_polynomial.showcoeff();
// // sin_cos_polynomial.generate_poly_heap();
}