ArticleslgStudy

computer science

Clenshaw algorithm

Clenshaw algorithm is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Clenshaw algorithm rather than just read about it. In short: In numerical analysis, the Clenshaw algorithm, also called Clenshaw summation, is a recursive method to evaluate a linear combination of Chebyshev polynomials. The method was published by Charles William Clenshaw in 1955.

Key takeaways

  • Clenshaw algorithm belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Clenshaw algorithm to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Clenshaw algorithm from memory before moving on to harder problems.

Reference excerpt

In numerical analysis, the Clenshaw algorithm, also called Clenshaw summation, is a recursive method to evaluate a linear combination of Chebyshev polynomials. 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 ϕk(x): S(x)=∑k=0nakϕk(x) where ϕk,k=0,1,… is a sequence of functions that satisfy the linear recurrence relation ϕk+1(x)=αk(x)ϕk(x)+βk(x)ϕk−1(x), where the coefficients αk(x) and βk(x) are known in advance. The algorithm is most useful when ϕk(x) are functions that are complicated to compute directly, but αk(x) and βk(x) are particularly simple. In the most common applications, α(x) does not depend on k, and β is a constant that depends on neither x nor k. To perform the summation for given series of coefficients a0,…,an, compute the values bk(x) by the "reverse" recurrence formula: bn+1(x)=bn+2(x)=0,bk(x)=ak+αk(x)bk+1(x)+βk+1(x)bk+2(x). Note that this computation makes no direct reference to the functions ϕk(x). After computing b2(x) and b1(x), the desired sum can be expressed in terms of them and the simplest functions ϕ0(x) and ϕ1(x): S(x)=ϕ0(x)a0+ϕ1(x)b1(x)+β1(x)ϕ0(x)b2(x). 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 S(x)=∑k=0nakxk. The functions are simply ϕ0(x)=1,ϕk(x)=xk=xϕk−1(x) and are produced by the recurrence coefficients α(x)=x and β=0. In this case, the recurrence formula to compute the sum is bk(x)=ak+xbk+1(x) and, in this case, the sum is simply S(x)=a0+xb1(x)=b0(x), which is exactly the usual Horner's method.

Special case for Chebyshev series Consider a truncated Chebyshev series pn(x)=a0+a1T1(x)+a2T2(x)+⋯+anTn(x). The coefficients in the recursion relation for the Chebyshev polynomials are α(x)=2x,β=−1, with the initial conditions T0(x)=1,T1(x)=x. Thus, the recurrence is bk(x)=ak+2xbk+1(x)−bk+2(x) and the final results are b0(x)=a0+2xb1(x)−b2(x), pn(x)=12[a0+b0(x)−b2(x)]. An equivalent expression for the sum is given by pn(x)=a0+xb1(x)−b2(x).

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 m(θ)=C0θ+C1sin⁡θ+C2sin⁡2θ+⋯+Cnsin⁡nθ. Leaving off the initial C0θ term, the remainder is a summation of the appropriate form. There is no leading term because ϕ0(θ)=sin⁡0θ=sin⁡0=0. The recurrence relation for sin⁡kθ is sin⁡(k+1)θ=2cos⁡θsin⁡kθ−sin⁡(k−1)θ, making the coefficients in the recursion relation αk(θ)=2cos⁡θ,βk=−1. and the evaluation of the series is given by bn+1(θ)=bn+2(θ)=0,bk(θ)=Ck+2cos⁡θbk+1(θ)−bk+2(θ),for n≥k≥1. The final step is made particularly simple because ϕ0(θ)=sin⁡0=0, so the end of the recurrence is simply b1(θ)sin⁡(θ); the C0θ term is added separately: m(θ)=C0θ+b1(θ)sin⁡θ. Note that the algorithm requires only the evaluation of two trigonometric quantities cos⁡θ and sin⁡θ.

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 m(θ1)−m(θ2)=C0(θ1−θ2)+∑k=1n2Cksin⁡(12k(θ1−θ2))cos⁡(12k(θ1+θ2)). Clenshaw summation can be applied in this case provided we simultaneously compute m(θ1)+m(θ2) and perform a matrix summation, 𝖬(θ1,θ2)=[(m(θ1)+m(θ2))/2(m(θ1)−m(θ2))/(θ1−θ2)]=C0[μ1]+∑k=1nCk𝖥k(θ1,θ2), where δ=12(θ1−θ2),μ=12(θ1+θ2),𝖥k(θ1,θ2)=[cos⁡kδsin⁡kμsin⁡kδδcos⁡kμ]. The first element of 𝖬(θ1,θ2) is the average value of m and the second element is the average slope. 𝖥k(θ1,θ2) satisfies the recurrence relation 𝖥k+1(θ1,θ2)=𝖠(θ1,θ2)𝖥k(θ1,θ2)−𝖥k−1(θ1,θ2), where 𝖠(θ1,θ2)=2[cos⁡δcos⁡μ−δsin⁡δsin⁡μ−sin⁡δδsin⁡μcos⁡δcos⁡μ] takes the place of α in the recurrence relation, and β=−1. The standard Clenshaw algorithm can now be applied to yield 𝖡n+1=𝖡n+2=𝟢,𝖡k=Ck𝖨+𝖠𝖡k+1−𝖡k+2,for n≥k≥1,𝖬(θ1,θ2)=C0[μ1]+𝖡1𝖥1(θ1,θ2), where 𝖡k are 2×2 matrices. Finally we have m(θ1)−m(θ2)θ1−θ2=𝖬2(θ1,θ2). This technique can be used in the limit θ2=θ1=μ and δ=0 to simultaneously compute m(μ) and the derivative dm(μ)/dμ, provided that, in evaluating 𝖥1 and 𝖠, we take limδ→0(sin⁡kδ)/δ=k.

See also Horner scheme to evaluate polynomials in monomial form De Casteljau's algorithm to evaluate polynomials in Bézier form

References

Worked examples

Example 1 — a first encounter with Clenshaw algorithm

Start with the simplest possible case. Write down what Clenshaw algorithm claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Clenshaw algorithm before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Clenshaw algorithm ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Clenshaw algorithm

In research
Clenshaw algorithm appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Clenshaw algorithm in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Clenshaw algorithm is common in secondary-school and first-year university syllabi. It links to neighbouring topics Numerical analysis, so understanding it makes those chapters shorter.
In everyday life
Look for Clenshaw algorithm outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Clenshaw algorithm” →

How to study Clenshaw algorithm in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Clenshaw algorithm means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Clenshaw algorithm out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Clenshaw algorithm in simple terms?

In numerical analysis, the Clenshaw algorithm, also called Clenshaw summation, is a recursive method to evaluate a linear combination of Chebyshev polynomials. The method was published by Charles William Clenshaw in 1955.

Why does Clenshaw algorithm matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Clenshaw algorithm?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Clenshaw algorithm.

Tags

  • Numerical analysis

Keep exploring