|
NAG[e02aec] NAG[nag_1d_cheb_eval] - Evaluates the coefficients of a Chebyshev series polynomial
|
|
Calling Sequence
e02aec(a, xcap, p, 'nplus1'=nplus1, 'fail'=fail)
nag_1d_cheb_eval(. . .)
Parameters
|
a - Vector(1..nplus1, datatype=float[8]);
|
|
|
|
p - assignable;
|
|
|
Note: On exit the variable p will have a value of type float.
|
|
On exit: the value of the polynomial.
|
|
|
'nplus1'=nplus1 - integer; (optional)
|
|
|
Default value: the first dimension of the array a.
|
|
On entry: the number of terms in the series (i.e., one greater than the degree of the polynomial).
|
|
Constraint: . .
|
|
|
'fail'=fail - table; (optional)
|
|
|
The NAG error argument, see the documentation for NagError.
|
|
|
|
Description
|
|
|
Purpose
|
|
nag_1d_cheb_eval (e02aec) evaluates a polynomial from its Chebyshev series representation.
|
|
Description
|
|
nag_1d_cheb_eval (e02aec) evaluates the polynomial
for any value of satisfying . Here denotes the Chebyshev polynomial of the first kind of degree with argument . The value of is prescribed by the user.
In practice, the variable will usually have been obtained from an original variable , where and
Note that this form of the transformation should be used computationally rather than the mathematical equivalent
since the former guarantees that the computed value of differs from its true value by at most , where is the machine precision, whereas the latter has no such guarantee.
The method employed is based upon the three-term recurrence relation due to Clenshaw (1955), with modifications to give greater numerical stability due to Reinsch and Gentleman (see Gentleman (1969)).
For further details of the algorithm and its use see Cox (1974), Cox and Hayes (1973).
|
|
Error Indicators and Warnings
|
|
"NE_INT_ARG_LT"
On entry, nplus1 must not be less than 1: .
"NE_INVALID_XCAP"
On entry, , where is the machine precision. In this case the value of p is set arbitrarily to zero.
|
|
Further Comments
|
|
The time taken by nag_1d_cheb_eval (e02aec) is approximately proportional to .
It is expected that a common use of nag_1d_cheb_eval (e02aec) will be the evaluation of the polynomial approximations produced by e02adc (nag_1d_cheb_fit) and e02afc (nag_1d_cheb_interp_fit).
|
|
|
Examples
|
|
>
|
nplus1 := 5:
xcap := -1:
a := Vector([2, 0.5, 0.25, 0.125, 0.0625], datatype=float[8]):
NAG:-e02aec(a, xcap, p, 'nplus1' = nplus1):
|
|
|
See Also
|
|
Clenshaw C W (1955) A note on the summation of Chebyshev series Math. Tables Aids Comput. 9 118–120
Cox M G (1974) A data-fitting package for the non-specialist user Software for Numerical Mathematics (ed D J Evans) Academic Press
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
e02 Chapter Introduction.
NAG Toolbox Overview.
NAG Web Site.
|
|
Download Help Document
Was this information helpful?