Ignore:
Timestamp:
Oct 5, 2011, 7:01:33 PM (11 years ago)
Author:
sam
Message:

test: allow to perform Remez solving on an arbitrary range.

File:
1 edited

Legend:

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

    r1009 r1010  
    2727static real myfun(real const &x)
    2828{
    29     return exp(x);
     29    real y = sqrt(x);
     30    if (!y)
     31        return real::R_PI_2;
     32    return sin(real::R_PI_2 * y) / y;
    3033}
    3134
    32 static real myerror(real const &x)
     35static real myerr(real const &x)
    3336{
    34     return myfun(x);
     37    return real::R_1;
    3538}
    3639
     
    3841{
    3942    RemezSolver<4> solver;
    40 
    41     solver.Run(myfun, myerror, 10);
     43    solver.Run(0, 1, myfun, myfun, 15);
     44    //solver.Run(-1, 1, myfun, myfun, 15);
     45    //solver.Run(0, real::R_PI * real::R_PI >> 4, myfun, myfun, 15);
    4246
    4347    return EXIT_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.