Numerical integration/Gauss-Legendre Quadrature: Difference between revisions

x != x1 is definitely a no-no and not well behaved on some systems
(x != x1 is definitely a no-no and not well behaved on some systems)
Line 123:
x1 = x;
x -= lege_eval(N, x) / lege_diff(N, x);
} while (x !=fdim( x, x1) > 1e-8 );
/* fdim( ) was introduced in C99, if it isn't available
/* x != x1 is normally a no-no, but this task happens to be
* wellon behaved.your system, try fabs( ) */
lroots[i - 1] = x;