NAG Library Function Document
nag_sum_cheby_series (c06dcc) evaluates a polynomial from its Chebyshev series representation at a set of points.
||nag_sum_cheby_series (const double x,
const double c,
nag_sum_cheby_series (c06dcc) 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 functions, for example they may be those returned by the interpolation function nag_1d_cheb_interp (e01aec)
(in vector a
), by a least-squares fitting function 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
x[lx] – const doubleInput
On entry: , the set of arguments of the series.
, for .
lx – IntegerInput
On entry: the number of evaluation points in .
xmin – doubleInput
xmax – doubleInput
: the lower and upper end points respectively of the interval
. The Chebyshev series representation is in terms of the normalized variable
c[n] – const doubleInput
must contain the coefficient of the Chebyshev series, for .
n – IntegerInput
On entry: , the number of terms in the series.
s – Nag_SeriesInput
: determines the series (see Section 3
- The series is general.
- The series is even.
- The series is odd.
, or .
res[lx] – doubleOutput
On exit: the Chebyshev series evaluated at the set of points .
fail – NagError *Input/Output
The NAG error argument (see Section 3.6
in the Essential Introduction).
6 Error Indicators and Warnings
On entry, argument had an illegal value.
On entry, .
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
On entry, and .
On entry, element , and .
Constraint: , for all .
There may be a loss of significant figures due to cancellation between terms. However, provided that is not too large, nag_sum_cheby_series (c06dcc) yields results which differ little from the best attainable for the available machine precision.
The time taken increases with .
This example evaluates
at the points
9.1 Program Text
Program Text (c06dcce.c)
9.2 Program Data
Program Data (c06dcce.d)
9.3 Program Results
Program Results (c06dcce.r)