tailieunhanh - Evaluation of Functions part 6

0 w + i d 2w √ c + id = |d| 2w + iw |d| − iw 2w w=0 w = 0, c ≥ 0 w = 0, c | 178 Chapter5. Evaluation ofFunctions Then the answer is 0 w i V c id d 2w W d iw 2w w 0 w 0 c 0 w 0 c 0 d 0 w 0 c 0 d 0 Routines implementing these algorithms are listed in Appendix C. CITED REFERENCES AND FURTHER READING Midy P. and Yakovlev Y. 1991 Mathematics and Computers in Simulation vol. 33 pp. 33-49. Knuth . 1981 SeminumericalAlgorithms 2nd ed. vol. 2 of TheArtofComputerProgramming Reading MA Addison-Wesley see solutions to exercises and . Recurrence Relations and Clenshaw s Recurrence Formula Many useful functions satisfy recurrence relations . n 1 Pn i x 2n 1 xPn x - nPn-i x Jn 1 x Jn x - Jn-1 x x nEn i x e-x - xEn x cos n0 2 cos 0 cos n 1 0 cos n 2 0 sin n0 2 cos 0 sin n 1 0 sin n 2 0 where the first three functions are Legendre polynomials Bessel functions of the first kind and exponential integrals respectively. For notation see 1 . These relations are useful for extending computational methods from two successive values of n to other values either larger or smaller. Equations and motivate us to say afew words about trigonometric functions. If your program s running time is dominated by evaluating trigonometric functions you are probably doing something wrong. Trig functions whose arguments form a linear sequence 0 00 nd n 0 1 2 . are efficiently calculated by the following recurrence Sample page from NUMERICAL RECIPES IN C THE ART OF SCIENTIFIC COMPUTING ISBN 0-521-43108-5 cos 0 d cos 0 a cos 0 3 sin 0 sin 0 d sin 0 a sin 0 3 cos 0 Recurrence Relations and Clenshaw s Recurrence Formula 179 where a and 3 are the precomputed coefficients . S a 2 sin2 I - 3 sin S Sample page from NUMERICAL RECIPES IN C THE ART OF SCIENTIFIC COMPUTING ISBN 0-521-43108-5 t tan The reason for doing things this way rather than with the standard and equivalent identities for sums of angles is that here a and 3 do not lose significance if the O -g incremental 6 is small. Likewise the .