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.[2]
Clenshaw algorithm
Suppose that is a sequence of functions that satisfy the linear recurrence relation
where the coefficients and are known in advance. Note that in the most common applications, does not depend on , and is a constant that depends on neither nor .
Our goal is to evaluate a weighted sum of these functions
Given the coefficients , compute the values by the "reverse" recurrence formula:
The linear combination of the satisfies:
See Fox and Parker[3] for more information and stability analyses.
Horner as a special case of Clenshaw
A particularly simple case occurs when evaluating a polynomial of the form
.
The functions are simply
and are produced by the recurrence coefficients and .
In this case, the recurrence formula to compute the sum is
One way to evaluate this is to continue the recurrence one more step, and compute
(note the doubled a0 coefficient) followed by
Geodetic applications
Clenshaw's algorithm is extensively used in geodetic applications
where it is usually referred to as Clenshaw summation.[4] A simple application is summing the trigonometric series to compute
the meridian arc. These have the form
Leaving off the initial term, the remainder is a summation of the appropriate form. There is no leading term because .
Failed to parse (syntax error): {\displaystyle b_k(\theta) = C_k + 2\cos \theta \,b_{k+1}(\theta) - b_{k+2}(\theta),\quad\text{for $n\ge k \ge 1$}. }
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 .
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 write
Clenshaw summation can be applied in this case[5]
provided we simultaneously compute
and perform a matrix summation,
where
, and
. The first
element of is the average
value of and the second element is the average slope.
satisfies the recurrence
relation
where
The standard Clenshaw algorithm can now be applied to yield
Failed to parse (unknown function "\begin{aligned}"): {\displaystyle \begin{aligned} \mathsf B_{n+1} &= \mathsf B_{n+2} = \mathsf 0, \\ \mathsf B_k &= C_k \mathsf I + \mathsf A \mathsf B_{k+1} - \mathsf B_{k+2}, \qquad\text{for $n\ge k \ge 1$},\\ \mathsf M(\theta_1,\theta_2) &= C_0 \begin{bmatrix}\mu\\1\end{bmatrix} + \mathsf B_1 \mathsf F_1(\theta_1,\theta_2), \end{aligned} }
where are matrices. Finally
we have
In the limit , this relation
correctly evaluates the derivative ,
providing that, in evaluating and , we take .
^Attention: This template ({{cite doi}}) is deprecated. To cite the publication identified by doi:10.1090/S0025-5718-1955-0071856-0, please use {{cite journal}} (if it was published in a bona fide academic journal, otherwise {{cite report}} with |doi=10.1090/S0025-5718-1955-0071856-0 instead. Note that this paper is written in terms of the Shifted Chebyshev polynomials of the first kind .