Changeset 1069 for trunk/test/math


Ignore:
Timestamp:
Nov 15, 2011, 1:52:42 PM (9 years ago)
Author:
gary
Message:

tutorial: port the Mandelbrot dithering shader to Cg.

File:
1 edited

Legend:

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

    r1050 r1069  
    3131real myfun(real const &y)
    3232{
     33real k1024 = 1024;
     34real klog32 = log((real)32);
     35return (y - k1024) / log2(log(sqrt(y))/klog32);
    3336    real x = sqrt(y);
    3437    return (sin(x) - x) / (x * y);
     
    3740real myerr(real const &y)
    3841{
     42return myfun(y);
     43return real::R_1;
    3944    real x = sqrt(y);
    4045    return sin(x) / (x * y);
     
    4348int main(int argc, char **argv)
    4449{
    45     RemezSolver<6> solver;
    46     solver.Run(real::R_1 >> 400, real::R_PI_2 * real::R_PI_2, myfun, myerr, 40);
     50    RemezSolver<3> solver;
     51    solver.Run((real)(1024.001), (real)(1024 * 1024), myfun, myerr, 40);
    4752
    4853    return EXIT_SUCCESS;
Note: See TracChangeset for help on using the changeset viewer.