If supplied with the coefficients , for , of a polynomial of degree , where
E02AKF returns the value of at a user-specified value of the variable . Here denotes the Chebyshev polynomial of the first kind of degree with argument . It is assumed that the independent variable in the interval was obtained from your original variable in the interval by the linear transformation
The coefficients 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.
On entry: the Chebyshev coefficients of the polynomial . Specifically, element
must contain the coefficient , for . Only these elements will be accessed.
5: IA1 – INTEGERInput
On entry: the index increment of A. Most frequently, the Chebyshev coefficients are stored in adjacent elements of A, and IA1 must be set to . However, if, for example, they are stored in , then the value of IA1 must be .
6: LA – INTEGERInput
On entry: the dimension of the array A as declared in the (sub)program from which E02AKF is called.
7: X – REAL (KIND=nag_wp)Input
On entry: the argument at which the polynomial is to be evaluated.
8: RESULT – REAL (KIND=nag_wp)Output
On exit: the value of the polynomial .
9: IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to , . If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value is recommended. If the output of error messages is undesirable, then the value is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is . When the value is used it is essential to test the value of IFAIL on exit.
On exit: unless the routine detects an error or a warning has been flagged (see Section 6).
6 Error Indicators and Warnings
If on entry or , 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 . The ratio of the sum of the absolute values of the to the sum of the absolute values of the is less than a small multiple of .
8 Further Comments
The time taken is approximately proportional to .
Suppose a polynomial has been computed in Chebyshev series form to fit data over the interval . The following program evaluates the polynomial at 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.)