Algorithms: evaluation of the Chebyshev polynomial Tn(X) by recursion
暂无分享,去创建一个
Contributions to this department must be in the form stated in the Algorithms Department policy statement (Communications, February, 1960) except that ALGOL 60 notation should be used (see Communications, May, 1960). Contributions shmfld be sent to J. Algorithms should be in the Publication form of ALGOL 60 and written in a style pat-terned after the most recent algorithms appearing in this department. Although each algorithm has been tested by its contributor, no warranty, express or implied, is made by the contributor, the editor, or the Association for Computing Machinery as to the accuracy and functioning of the algorithm and related algorithm materiM and no responsibility is assumed by the contributor, the editor, or the Association for Computing Machinery in connection therewith. The reproduction of algorithms appearing in this department is explicitly permitted without any charge. When reproduction is for publication purposes, reference must be made to the algorithm author and to the Com-mwnicatiores issue bearing the algorithm. if n = 0 then e := a else if n = 1 then c := b else for i = 1 step 1 until n-I do begin c := (1 + 2 × i-X) × b-(i ]" 2) × a ; a:=b This procedure computes the Hermite polynomial Hn(X) = (-1)" X e x2 X (dn/dX"(e-X~)) for any if n = () then c := a else if n = 1 then e := b else for i := 1 step 1 until n-1 do eo]nlnent This procedure computes the Legendre polynomial P~(X) = (1/(2~ X n!)) × d~/dXn(X ~-1) ~ for if n = 0 then e := a else if n = 1 then c := b else for i := 1 step 1 until n-1 do begin c := bXX+ (i/(i+l)) X (XX b-a) ; a:=b ; b:=c end Le := e end Communications of the ACM 353