The function may be called by the names: e02akc, nag_fit_dim1_cheb_eval2 or nag_1d_cheb_eval2.
If supplied with the coefficients , for , of a polynomial of degree , where
e02akc 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 function to be used in surface fitting and other applications, in which the array might have two or more dimensions.
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
1: – IntegerInput
On entry: , the degree of the given polynomial .
2: – doubleInput
3: – doubleInput
On entry: the lower and upper end points respectively of the interval . The Chebyshev series representation is in terms of the normalized variable , where
4: – const doubleInput
Note: the dimension, dim, of the array a
must be at least
On entry: the Chebyshev coefficients of the polynomial . Specifically, element
must contain the coefficient , for . Only these elements will be accessed.
5: – 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 , the value of ia1 must be .
6: – doubleInput
On entry: the argument at which the polynomial is to be evaluated.
7: – double *Output
On exit: the value of the polynomial .
8: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
6Error Indicators and Warnings
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument had an illegal value.
On entry, .
On entry, >. Constraint: .
On entry, .
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
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 .
8Parallelism and Performance
Background information to multithreading can be found in the Multithreading documentation.
e02akc is not threaded in any implementation.
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
Normally a program would first read in or generate data and compute the fitted polynomial.)