Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Clenshaw algorithm

From Wikipedia, the free encyclopedia

Innumerical analysis, theClenshaw algorithm, also calledClenshaw summation, is arecursive method to evaluate a linear combination ofChebyshev polynomials.[1][2] The method was published byCharles William Clenshaw in 1955. It is a generalization ofHorner's method for evaluating a linear combination ofmonomials.

It generalizes to more than just Chebyshev polynomials; it applies to any class of functions that can be defined by a three-termrecurrence relation.[3]

Clenshaw algorithm

[edit]

In full generality, the Clenshaw algorithm computes the weighted sum of a finite series of functionsϕk(x){\displaystyle \phi _{k}(x)}:S(x)=k=0nakϕk(x){\displaystyle S(x)=\sum _{k=0}^{n}a_{k}\phi _{k}(x)}whereϕk,k=0,1,{\displaystyle \phi _{k},\;k=0,1,\ldots } is a sequence of functions that satisfy the linear recurrence relationϕk+1(x)=αk(x)ϕk(x)+βk(x)ϕk1(x),{\displaystyle \phi _{k+1}(x)=\alpha _{k}(x)\,\phi _{k}(x)+\beta _{k}(x)\,\phi _{k-1}(x),}where the coefficientsαk(x){\displaystyle \alpha _{k}(x)} andβk(x){\displaystyle \beta _{k}(x)} are known in advance.

The algorithm is most useful whenϕk(x){\displaystyle \phi _{k}(x)} are functions that are complicated to compute directly, butαk(x){\displaystyle \alpha _{k}(x)} andβk(x){\displaystyle \beta _{k}(x)} are particularly simple. In the most common applications,α(x){\displaystyle \alpha (x)} does not depend onk{\displaystyle k}, andβ{\displaystyle \beta } is a constant that depends on neitherx{\displaystyle x} nork{\displaystyle k}.

To perform the summation for given series of coefficientsa0,,an{\displaystyle a_{0},\ldots ,a_{n}}, compute the valuesbk(x){\displaystyle b_{k}(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).{\displaystyle {\begin{aligned}b_{n+1}(x)&=b_{n+2}(x)=0,\\b_{k}(x)&=a_{k}+\alpha _{k}(x)\,b_{k+1}(x)+\beta _{k+1}(x)\,b_{k+2}(x).\end{aligned}}}

Note that this computation makes no direct reference to the functionsϕk(x){\displaystyle \phi _{k}(x)}. After computingb2(x){\displaystyle b_{2}(x)} andb1(x){\displaystyle b_{1}(x)},the desired sum can be expressed in terms of them and the simplest functionsϕ0(x){\displaystyle \phi _{0}(x)} andϕ1(x){\displaystyle \phi _{1}(x)}:S(x)=ϕ0(x)a0+ϕ1(x)b1(x)+β1(x)ϕ0(x)b2(x).{\displaystyle S(x)=\phi _{0}(x)\,a_{0}+\phi _{1}(x)\,b_{1}(x)+\beta _{1}(x)\,\phi _{0}(x)\,b_{2}(x).}

See Fox and Parker[4] for more information and stability analyses.

Examples

[edit]

Horner as a special case of Clenshaw

[edit]

A particularly simple case occurs when evaluating a polynomial of the formS(x)=k=0nakxk.{\displaystyle S(x)=\sum _{k=0}^{n}a_{k}x^{k}.}The functions are simplyϕ0(x)=1,ϕk(x)=xk=xϕk1(x){\displaystyle {\begin{aligned}\phi _{0}(x)&=1,\\\phi _{k}(x)&=x^{k}=x\phi _{k-1}(x)\end{aligned}}}and are produced by the recurrence coefficientsα(x)=x{\displaystyle \alpha (x)=x} andβ=0{\displaystyle \beta =0}.

In this case, the recurrence formula to compute the sum isbk(x)=ak+xbk+1(x){\displaystyle b_{k}(x)=a_{k}+xb_{k+1}(x)}and, in this case, the sum is simplyS(x)=a0+xb1(x)=b0(x),{\displaystyle S(x)=a_{0}+xb_{1}(x)=b_{0}(x),}which is exactly the usualHorner's method.

Special case for Chebyshev series

[edit]

Consider a truncatedChebyshev seriespn(x)=a0+a1T1(x)+a2T2(x)++anTn(x).{\displaystyle p_{n}(x)=a_{0}+a_{1}T_{1}(x)+a_{2}T_{2}(x)+\cdots +a_{n}T_{n}(x).}

The coefficients in the recursion relation for theChebyshev polynomials areα(x)=2x,β=1,{\displaystyle \alpha (x)=2x,\quad \beta =-1,}with the initial conditionsT0(x)=1,T1(x)=x.{\displaystyle T_{0}(x)=1,\quad T_{1}(x)=x.}

Thus, the recurrence isbk(x)=ak+2xbk+1(x)bk+2(x){\displaystyle b_{k}(x)=a_{k}+2xb_{k+1}(x)-b_{k+2}(x)}and the final results areb0(x)=a0+2xb1(x)b2(x),{\displaystyle b_{0}(x)=a_{0}+2xb_{1}(x)-b_{2}(x),}pn(x)=12[a0+b0(x)b2(x)].{\displaystyle p_{n}(x)={\tfrac {1}{2}}\left[a_{0}+b_{0}(x)-b_{2}(x)\right].}

An equivalent expression for the sum is given bypn(x)=a0+xb1(x)b2(x).{\displaystyle p_{n}(x)=a_{0}+xb_{1}(x)-b_{2}(x).}

Meridian arc length on the ellipsoid

[edit]

Clenshaw summation is extensively used ingeodetic applications.[2] A simple application is summing the trigonometric series to compute themeridian arc distance on the surface of an ellipsoid. These have the formm(θ)=C0θ+C1sinθ+C2sin2θ++Cnsinnθ.{\displaystyle m(\theta )=C_{0}\,\theta +C_{1}\sin \theta +C_{2}\sin 2\theta +\cdots +C_{n}\sin n\theta .}

Leaving off the initialC0θ{\displaystyle C_{0}\,\theta } term, the remainder is a summation of the appropriate form. There is no leading term becauseϕ0(θ)=sin0θ=sin0=0{\displaystyle \phi _{0}(\theta )=\sin 0\theta =\sin 0=0}.

Therecurrence relation forsinkθ{\displaystyle \sin k\theta } issin(k+1)θ=2cosθsinkθsin(k1)θ,{\displaystyle \sin(k+1)\theta =2\cos \theta \sin k\theta -\sin(k-1)\theta ,}making the coefficients in the recursion relationαk(θ)=2cosθ,βk=1.{\displaystyle \alpha _{k}(\theta )=2\cos \theta ,\quad \beta _{k}=-1.}and the evaluation of the series is given bybn+1(θ)=bn+2(θ)=0,bk(θ)=Ck+2cosθbk+1(θ)bk+2(θ),for nk1.{\displaystyle {\begin{aligned}b_{n+1}(\theta )&=b_{n+2}(\theta )=0,\\b_{k}(\theta )&=C_{k}+2\cos \theta \,b_{k+1}(\theta )-b_{k+2}(\theta ),\quad \mathrm {for\ } n\geq k\geq 1.\end{aligned}}}The final step is made particularly simple becauseϕ0(θ)=sin0=0{\displaystyle \phi _{0}(\theta )=\sin 0=0}, so the end of the recurrence is simplyb1(θ)sin(θ){\displaystyle b_{1}(\theta )\sin(\theta )}; theC0θ{\displaystyle C_{0}\,\theta } term is added separately:m(θ)=C0θ+b1(θ)sinθ.{\displaystyle m(\theta )=C_{0}\,\theta +b_{1}(\theta )\sin \theta .}

Note that the algorithm requires only the evaluation of two trigonometric quantitiescosθ{\displaystyle \cos \theta } andsinθ{\displaystyle \sin \theta }.

Difference in meridian arc lengths

[edit]

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 writem(θ1)m(θ2)=C0(θ1θ2)+k=1n2Cksin(12k(θ1θ2))cos(12k(θ1+θ2)).{\displaystyle m(\theta _{1})-m(\theta _{2})=C_{0}(\theta _{1}-\theta _{2})+\sum _{k=1}^{n}2C_{k}\sin {\bigl (}{\textstyle {\frac {1}{2}}}k(\theta _{1}-\theta _{2}){\bigr )}\cos {\bigl (}{\textstyle {\frac {1}{2}}}k(\theta _{1}+\theta _{2}){\bigr )}.}Clenshaw summation can be applied in this case[5]provided we simultaneously computem(θ1)+m(θ2){\displaystyle m(\theta _{1})+m(\theta _{2})}and perform a matrix summation,M(θ1,θ2)=[(m(θ1)+m(θ2))/2(m(θ1)m(θ2))/(θ1θ2)]=C0[μ1]+k=1nCkFk(θ1,θ2),{\displaystyle {\mathsf {M}}(\theta _{1},\theta _{2})={\begin{bmatrix}(m(\theta _{1})+m(\theta _{2}))/2\\(m(\theta _{1})-m(\theta _{2}))/(\theta _{1}-\theta _{2})\end{bmatrix}}=C_{0}{\begin{bmatrix}\mu \\1\end{bmatrix}}+\sum _{k=1}^{n}C_{k}{\mathsf {F}}_{k}(\theta _{1},\theta _{2}),}whereδ=12(θ1θ2),μ=12(θ1+θ2),Fk(θ1,θ2)=[coskδsinkμsinkδδcoskμ].{\displaystyle {\begin{aligned}\delta &={\tfrac {1}{2}}(\theta _{1}-\theta _{2}),\\[1ex]\mu &={\tfrac {1}{2}}(\theta _{1}+\theta _{2}),\\[1ex]{\mathsf {F}}_{k}(\theta _{1},\theta _{2})&={\begin{bmatrix}\cos k\delta \sin k\mu \\{\dfrac {\sin k\delta }{\delta }}\cos k\mu \end{bmatrix}}.\end{aligned}}}The first element ofM(θ1,θ2){\displaystyle {\mathsf {M}}(\theta _{1},\theta _{2})} is the averagevalue ofm{\displaystyle m} and the second element is the average slope.Fk(θ1,θ2){\displaystyle {\mathsf {F}}_{k}(\theta _{1},\theta _{2})} satisfies the recurrencerelationFk+1(θ1,θ2)=A(θ1,θ2)Fk(θ1,θ2)Fk1(θ1,θ2),{\displaystyle {\mathsf {F}}_{k+1}(\theta _{1},\theta _{2})={\mathsf {A}}(\theta _{1},\theta _{2}){\mathsf {F}}_{k}(\theta _{1},\theta _{2})-{\mathsf {F}}_{k-1}(\theta _{1},\theta _{2}),}whereA(θ1,θ2)=2[cosδcosμδsinδsinμsinδδsinμcosδcosμ]{\displaystyle {\mathsf {A}}(\theta _{1},\theta _{2})=2{\begin{bmatrix}\cos \delta \cos \mu &-\delta \sin \delta \sin \mu \\-\displaystyle {\frac {\sin \delta }{\delta }}\sin \mu &\cos \delta \cos \mu \end{bmatrix}}}takes the place ofα{\displaystyle \alpha } in the recurrence relation, andβ=1{\displaystyle \beta =-1}.The standard Clenshaw algorithm can now be applied to yieldBn+1=Bn+2=0,Bk=CkI+ABk+1Bk+2,for nk1,M(θ1,θ2)=C0[μ1]+B1F1(θ1,θ2),{\displaystyle {\begin{aligned}{\mathsf {B}}_{n+1}&={\mathsf {B}}_{n+2}={\mathsf {0}},\\[1ex]{\mathsf {B}}_{k}&=C_{k}{\mathsf {I}}+{\mathsf {A}}{\mathsf {B}}_{k+1}-{\mathsf {B}}_{k+2},\qquad \mathrm {for\ } n\geq k\geq 1,\\[1ex]{\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}}}whereBk{\displaystyle {\mathsf {B}}_{k}} are 2×2 matrices. Finally we havem(θ1)m(θ2)θ1θ2=M2(θ1,θ2).{\displaystyle {\frac {m(\theta _{1})-m(\theta _{2})}{\theta _{1}-\theta _{2}}}={\mathsf {M}}_{2}(\theta _{1},\theta _{2}).}This technique can be used in thelimitθ2=θ1=μ{\displaystyle \theta _{2}=\theta _{1}=\mu } andδ=0{\displaystyle \delta =0} to simultaneously computem(μ){\displaystyle m(\mu )} and thederivativedm(μ)/dμ{\displaystyle dm(\mu )/d\mu }, provided that, in evaluatingF1{\displaystyle {\mathsf {F}}_{1}} andA{\displaystyle {\mathsf {A}}}, we takelimδ0(sinkδ)/δ=k{\displaystyle \lim _{\delta \to 0}(\sin k\delta )/\delta =k}.

See also

[edit]

References

[edit]
  1. ^Clenshaw, C. W. (July 1955)."A note on the summation of Chebyshev series".Mathematical Tables and Other Aids to Computation.9 (51): 118.doi:10.1090/S0025-5718-1955-0071856-0.ISSN 0025-5718. Note that this paper is written in terms of theShifted Chebyshev polynomials of the first kindTn(x)=Tn(2x1){\displaystyle T_{n}^{*}(x)=T_{n}(2x-1)}.
  2. ^abTscherning, C. C.; Poder, K. (1982),"Some Geodetic applications of Clenshaw Summation"(PDF),Bolletino di Geodesia e Scienze Affini,41 (4):349–375, archived fromthe original(PDF) on 2007-06-12, retrieved2012-08-02
  3. ^Press, WH; Teukolsky, SA; Vetterling, WT; Flannery, BP (2007),"Section 5.4.2. Clenshaw's Recurrence Formula",Numerical Recipes: The Art of Scientific Computing (3rd ed.), New York: Cambridge University Press,ISBN 978-0-521-88068-8
  4. ^Fox, Leslie; Parker, Ian B. (1968),Chebyshev Polynomials in Numerical Analysis, Oxford University Press,ISBN 0-19-859614-6
  5. ^Karney, C. F. F. (2024)."The area of rhumb polygons".Stud. Geophys. Geod.68 (3–4):99–120.arXiv:2303.03219.doi:10.1007/s11200-024-0709-zAppendix B{{cite journal}}: CS1 maint: postscript (link)
Retrieved from "https://en.wikipedia.org/w/index.php?title=Clenshaw_algorithm&oldid=1282104653"
Category:
Hidden category:

[8]ページ先頭

©2009-2025 Movatter.jp