Ignore:
Timestamp:
Oct 6, 2011, 9:18:17 AM (11 years ago)
Author:
sam
Message:

test: more Remez exchange experimentations.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/math/remez.cpp

    r1010 r1011  
    2727static real myfun(real const &x)
    2828{
     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);
    2933    real y = sqrt(x);
    3034    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;
    3337}
    3438
     
    4044int main(int argc, char **argv)
    4145{
    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);
    4449    //solver.Run(-1, 1, myfun, myfun, 15);
    4550    //solver.Run(0, real::R_PI * real::R_PI >> 4, myfun, myfun, 15);
Note: See TracChangeset for help on using the changeset viewer.