3 * Evaluate Chebyshev series
10 * double x, y, coef[N], chebevl();
12 * y = chbevl( x, coef, N );
18 * Evaluates the series
22 * y = > coef[i] T (x/2)
26 * of Chebyshev polynomials Ti at argument x/2.
28 * Coefficients are stored in reverse order, i.e. the zero
29 * order term is last in the array. Note N is the number of
30 * coefficients, not the order.
32 * If coefficients are for the interval a to b, x must
33 * have been transformed to x -> 2(2x - b - a)/(b-a) before
34 * entering the routine. This maps x from (a, b) to (-1, 1),
35 * over which the Chebyshev polynomials are defined.
37 * If the coefficients are for the inverted interval, in
38 * which (a, b) is mapped to (1/b, 1/a), the transformation
39 * required is x -> 2(2ab/x - b - a)/(b-a). If b is infinity,
40 * this becomes x -> 4a/x - 1.
46 * Taking advantage of the recurrence properties of the
47 * Chebyshev polynomials, the routine requires one more
48 * addition per loop than evaluating a nested polynomial of
55 Cephes Math Library Release 2.0: April, 1987
56 Copyright 1985, 1987 by Stephen L. Moshier
57 Direct inquiries to 30 Frost Street, Cambridge, MA 02140
62 double chbevl(double x,void* array,int n )
64 double b0, b1, b2, *p;
76 b0 = x * b1 - b2 + *p++;
80 return( 0.5*(b0-b2) );