In
numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of numerical methods th ...
, the Clenshaw algorithm, also called Clenshaw summation, is a
recursive
Recursion (adjective: ''recursive'') occurs when a thing is defined in terms of itself or of its type. Recursion is used in a variety of disciplines ranging from linguistics to logic. The most common application of recursion is in mathemati ...
method to evaluate a linear combination of
Chebyshev polynomials
The Chebyshev polynomials are two sequences of polynomials related to the cosine and sine functions, notated as T_n(x) and U_n(x). They can be defined in several equivalent ways, one of which starts with trigonometric functions:
The Chebys ...
.
[ Note that this paper is written in terms of the ''Shifted'' Chebyshev polynomials of the first kind .] The method was published by
Charles William Clenshaw in 1955. It is a generalization of
Horner's method
In mathematics and computer science, Horner's method (or Horner's scheme) is an algorithm for polynomial evaluation. Although named after William George Horner, this method is much older, as it has been attributed to Joseph-Louis Lagrange by Hor ...
for evaluating a linear combination of
monomial
In mathematics, a monomial is, roughly speaking, a polynomial which has only one term. Two definitions of a monomial may be encountered:
# A monomial, also called power product, is a product of powers of variables with nonnegative integer expon ...
s.
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
In mathematics, a recurrence relation is an equation according to which the nth term of a sequence of numbers is equal to some combination of the previous terms. Often, only k previous terms of the sequence appear in the equation, for a paramete ...
.
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 form
:
.
The functions are simply
:
and are produced by the recurrence coefficients
and
.
In this case, the recurrence formula to compute the sum is
:
and, in this case, the sum is simply
:
,
which is exactly the usual
Horner's method
In mathematics and computer science, Horner's method (or Horner's scheme) is an algorithm for polynomial evaluation. Although named after William George Horner, this method is much older, as it has been attributed to Joseph-Louis Lagrange by Hor ...
.
Special case for Chebyshev series
Consider a truncated
Chebyshev series
:
The coefficients in the recursion relation for the
Chebyshev polynomials
The Chebyshev polynomials are two sequences of polynomials related to the cosine and sine functions, notated as T_n(x) and U_n(x). They can be defined in several equivalent ways, one of which starts with trigonometric functions:
The Chebys ...
are
:
with the initial conditions
:
Thus, the recurrence is
:
and the final sum is
:
One way to evaluate this is to continue the recurrence one more step, and compute
:
(note the doubled ''a''
0 coefficient) followed by
:
Meridian arc length on the ellipsoid
Clenshaw summation is extensively used in
geodetic
Geodesy ( ) is the Earth science of accurately measuring and understanding Earth's figure (geometric shape and size), orientation in space, and gravity. The field also incorporates studies of how these properties change over time and equivale ...
applications.
A simple application is summing the trigonometric series to compute
the
meridian arc
In geodesy and navigation, a meridian arc is the curve between two points on the Earth's surface having the same longitude. The term may refer either to a segment of the meridian, or to its length.
The purpose of measuring meridian arcs is to ...
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
.
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 write
:
Clenshaw summation can be applied in this case
[
]
provided we simultaneously compute
and perform a matrix summation,
:
where
:
The first element of
is the average
value of
and the second element is the average slope.
satisfies the recurrence
relation
:
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
Limit or Limits may refer to:
Arts and media
* ''Limit'' (manga), a manga by Keiko Suenobu
* ''Limit'' (film), a South Korean film
* Limit (music), a way to characterize harmony
* "Limit" (song), a 2016 single by Luna Sea
* "Limits", a 2019 ...
and
to simultaneously compute
and the
derivative
In mathematics, the derivative of a function of a real variable measures the sensitivity to change of the function value (output value) with respect to a change in its argument (input value). Derivatives are a fundamental tool of calculus. ...
, provided that, in evaluating
and
,
we take
.
See also
*
Horner scheme to evaluate polynomials in
monomial form
In mathematics the monomial basis of a polynomial ring is its basis (as a vector space or free module over the field or ring of coefficients) that consists of all monomials. The monomials form a basis because every polynomial may be uniquely w ...
*
De Casteljau's algorithm to evaluate polynomials in
Bézier form
In the mathematical field of numerical analysis, a Bernstein polynomial is a polynomial that is a linear combination of Bernstein basis polynomials. The idea is named after Sergei Natanovich Bernstein.
A numerically stable way to evaluate polyn ...
References
{{DEFAULTSORT:Clenshaw Algorithm
Numerical analysis