NAG Library Routine Document
C06DCF evaluates a polynomial from its Chebyshev series representation at a set of points.
||LX, N, S, IFAIL
||X(LX), XMIN, XMAX, C(N), RES(LX)
C06DCF evaluates, at each point in a given set
, the sum of a Chebyshev series of one of three forms according to the value of the parameter S
lies in the range
is the Chebyshev polynomial of order
, defined by
It is assumed that the independent variable
in the interval
was obtained from your original variable
, a set of real numbers in the interval
, by the linear transformation
The method used is based upon a three-term recurrence relation; for details see Clenshaw (1962)
are normally generated by other routines, for example they may be those returned by the interpolation routine E01AEF
(in vector A
), by a least squares fitting routine in Chapter E02
, or as the solution of a boundary value problem by
Clenshaw C W (1962) Chebyshev Series for Mathematical Functions Mathematical tables HMSO
- 1: X(LX) – REAL (KIND=nag_wp) arrayInput
On entry: , the set of arguments of the series.
, for .
- 2: LX – INTEGERInput
On entry: the number of evaluation points in .
- 3: XMIN – REAL (KIND=nag_wp)Input
- 4: XMAX – REAL (KIND=nag_wp)Input
: the lower and upper end points respectively of the interval
. The Chebyshev series representation is in terms of the normalized variable
- 5: C(N) – REAL (KIND=nag_wp) arrayInput
On entry: must contain the coefficient of the Chebyshev series, for .
- 6: N – INTEGERInput
On entry: , the number of terms in the series.
- 7: S – INTEGERInput
: determines the series (see Section 3
- The series is general.
- The series is even.
- The series is odd.
, or .
- 8: RES(LX) – REAL (KIND=nag_wp) arrayOutput
On exit: the Chebyshev series evaluated at the set of points .
- 9: IFAIL – INTEGERInput/Output
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.
unless the routine detects an error or a warning has been flagged (see Section 6
6 Error Indicators and Warnings
On entry, .
On entry, .
On entry, , or .
On entry, .
On entry, an element of X
is less than XMIN
or greater than XMAX
There may be a loss of significant figures due to cancellation between terms. However, provided that is not too large, C06DCF yields results which differ little from the best attainable for the available machine precision.
The time taken increases with .
C06DCF has been prepared in the present form to complement a number of integral equation solving routines which use Chebyshev series methods, e.g., D05AAF
This example evaluates
at the points
9.1 Program Text
Program Text (c06dcfe.f90)
9.2 Program Data
Program Data (c06dcfe.d)
9.3 Program Results
Program Results (c06dcfe.r)