Clenshaw algorithm explained
In numerical analysis, the Clenshaw algorithm, also called Clenshaw summation, is a recursive method to evaluate a linear combination of Chebyshev polynomials.[1] The method was published by Charles William Clenshaw in 1955. It is a generalization of Horner's method for evaluating a linear combination of monomials.
It generalizes to more than just Chebyshev polynomials; it applies to any class of functions that can be defined by a three-term recurrence relation.
Clenshaw algorithm
In full generality, the Clenshaw algorithm computes the weighted sum of a finite series of functions
:
where
is a sequence of functions that satisfy the linear recurrence relation
where the coefficients
and
are known in advance.
The algorithm is most useful when
are functions that are complicated to compute directly, but
and
are particularly simple. In the most common applications,
does not depend on
, and
is a constant that depends on neither
nor
.
To perform the summation for given series of coefficients
, compute the values
by the "reverse" recurrence formula:
Note that this computation makes no direct reference to the functions
. After computing
and
,the desired sum can be expressed in terms of them and the simplest functions
and
:
See Fox and Parker for more information and stability analyses.
Examples
Horner as a special case of Clenshaw
A particularly simple case occurs when evaluating a polynomial of the formThe functions are simplyand are produced by the recurrence coefficients
and
.
In this case, the recurrence formula to compute the sum isand, in this case, the sum is simplywhich is exactly the usual Horner's method.
Special case for Chebyshev series
Consider a truncated Chebyshev series
The coefficients in the recursion relation for the Chebyshev polynomials arewith the initial conditions
Thus, the recurrence isand the final sum is
One way to evaluate this is to continue the recurrence one more step, and compute(note the doubled a0 coefficient) followed by
Meridian arc length on the ellipsoid
Clenshaw summation is extensively used in geodetic applications. A simple application is summing the trigonometric series to compute the meridian arc distance on the surface of an ellipsoid. These have the form
Leaving off the initial
term, the remainder is a summation of the appropriate form. There is no leading term because
\phi0(\theta)=\sin0\theta=\sin0=0
.
The recurrence relation for
is
making the coefficients in the recursion relation
and the evaluation of the series is given by
The final step is made particularly simple because
, so the end of the recurrence is simply
; the
term is added separately:
Note that the algorithm requires only the evaluation of two trigonometric quantities
and
.
Difference in meridian arc lengths
Sometimes it necessary to compute the difference of two meridian arcs in a way that maintains high relative accuracy. This is accomplished by using trigonometric identities to writeClenshaw summation can be applied in this case[2] provided we simultaneously compute
and perform a matrix summation,
where
The first element of
is the averagevalue of
and the second element is the average slope.
satisfies the recurrencerelation
where
takes the place of
in the recurrence relation, and
.The standard Clenshaw algorithm can now be applied to yield
where
are 2×2 matrices. Finally we have
This technique can be used in the
limit
and
to simultaneously compute
and the
derivative
, provided that, in evaluating
and
, we take
\lim\delta(\sink\delta)/\delta=k
.
See also
Notes and References
- Clenshaw . C. W.. A note on the summation of Chebyshev series. 10.1090/S0025-5718-1955-0071856-0. Mathematical Tables and Other Aids to Computation. 0025-5718. 9. 51. 118. July 1955 . free. Note that this paper is written in terms of the Shifted Chebyshev polynomials of the first kind
.
- Karney. C. F. F.. 2024. 68. The area of rhumb polygons. Stud. Geophys. Geod.. 10.1007/s11200-024-0709-z. free. Appendix B.