E02AKF evaluates a polynomial from its Chebyshev series representation, allowing an arbitrary index increment for accessing the array of coefficients.
If supplied with the coefficients
ai, for
i=0,1,…,n, of a polynomial
px- of degree
n, where
E02AKF returns the value of
px- at a user-specified value of the variable
x. Here
Tjx- denotes the Chebyshev polynomial of the first kind of degree
j with argument
x-. It is assumed that the independent variable
x- in the interval
-1,+1 was obtained from your original variable
x in the interval
xmin,xmax by the linear transformation
The coefficients
ai may be supplied in the array
A, with any increment between the indices of array elements which contain successive coefficients. This enables the routine to be used in surface fitting and other applications, in which the array might have two or more dimensions.
The method employed is based on the three-term recurrence relation due to Clenshaw (see
Clenshaw (1955)), with modifications due to Reinsch and Gentleman (see
Gentleman (1969)). For further details of the algorithm and its use see
Cox (1973) and
Cox and Hayes (1973).
Clenshaw C W (1955) A note on the summation of Chebyshev series
Math. Tables Aids Comput. 9 118–120
Cox M G (1973) A data-fitting package for the non-specialist user
NPL Report NAC 40 National Physical Laboratory
Cox M G and Hayes J G (1973) Curve fitting: a guide and suite of algorithms for the non-specialist user
NPL Report NAC26 National Physical Laboratory
Gentleman W M (1969) An error analysis of Goertzel's (Watt's) method for computing Fourier coefficients
Comput. J. 12 160–165
If on entry
IFAIL=0 or
-1, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
The rounding errors are such that the computed value of the polynomial is exact for a slightly perturbed set of coefficients ai+δai. The ratio of the sum of the absolute values of the δai to the sum of the absolute values of the ai is less than a small multiple of n+1×machine precision.
Suppose a polynomial has been computed in Chebyshev series form to fit data over the interval
-0.5,2.5. The following program evaluates the polynomial at
4 equally spaced points over the interval. (For the purposes of this example,
XMIN,
XMAX and the Chebyshev coefficients are supplied
in DATA statements.
Normally a program would first read in or generate data and compute the fitted polynomial.)
None.