Changeset 1011 for trunk/test/math/remez.cpp
- Timestamp:
- Oct 6, 2011, 9:18:17 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/math/remez.cpp
r1010 r1011 27 27 static real myfun(real const &x) 28 28 { 29 static real const a0 = real::R_1; 30 static real const a1 = real(-11184811) >> 26; 31 static real const b1 = real(-1) / real(6); 32 static real const b2 = real(1) / real(120); 29 33 real y = sqrt(x); 30 34 if (!y) 31 return real::R_PI_2;32 return sin(real::R_PI_2 * y) / y;35 return b2; 36 return ((sin(y) / y - a0) / x - a1) / x; 33 37 } 34 38 … … 40 44 int main(int argc, char **argv) 41 45 { 42 RemezSolver<4> solver; 43 solver.Run(0, 1, myfun, myfun, 15); 46 RemezSolver<3> solver; 47 //solver.Run(0, 1, myfun, myfun, 15); 48 solver.Run(0, real::R_PI * real::R_PI >> 2, myfun, myfun, 15); 44 49 //solver.Run(-1, 1, myfun, myfun, 15); 45 50 //solver.Run(0, real::R_PI * real::R_PI >> 4, myfun, myfun, 15);
Note: See TracChangeset
for help on using the changeset viewer.