正在加载图片...
5.2 Evaluation of Continued Fractions 169 into equation (5.1.11),and then setting 2=1. Sometimes you will want to compute a function from a series representation even when the computation is not efficient.For example,you may be using the values obtained to fit the function to an approximating form that you will use subsequently (cf.$5.8).If you are summing very large numbers of slowly convergent terms,pay attention to roundoff errors!In floating-point representation it is more accurate to sum a list of numbers in the order starting with the smallest one,rather than starting with the largest one.It is even better to group terms pairwise,then in pairs of pairs, etc.,so that all additions involve operands of comparable magnitude. 81 CITED REFERENCES AND FURTHER READING: Goodwin,E.T.(ed.)1961,Modern Computing Methods,2nd ed.(New York:Philosophical Li- brary),Chapter 13 [van Wijngaarden's transformations].[1] Dahlquist,G.,and Bjorck,A.1974,Numerica/Methods (Englewood Cliffs,NJ:Prentice-Hall). ICAL Chapter 3. Abramowitz,M.,and Stegun,I.A.1964,Handbook of Mathematical Functions,Applied Mathe- matics Series,Volume 55(Washington:National Bureau of Standards;reprinted 1968 by RECIPES Dover Publications,New York),$3.6. Mathews,J.,and Walker,R.L.1970,Mathematical Methods of Physics,2nd ed.(Reading,MA: W.A.Benjamin/Addison-Wesley),82.3.[2] g 令 Press. 5.2 Evaluation of Continued Fractions IENTIFIC Continued fractions are often powerful ways of evaluating functions that occur in scientific applications.A continued fraction looks like this: f(z)=6o+ (5.2.1) MPUTING 02 b1+ 1920 b2+ (ISBN 44 b3+ b4++ Numerica 10.621 Printers prefer to write this as 是 43108 a1 a2 a3 a4 a5 Recipes f()=b如+1+2+b朗+1+5+ (5.2.2) (outside In either(5.2.1)or(5.2.2),the a's and b's can themselves be functions of x,usually Software. 首 linear or quadratic monomials at worst (i.e.,constants times x or times z2).For example,the continued fraction representation of the tangent function is tamr=1-3-5-7- (5.2.3) Continued fractions frequently converge much more rapidly than power series expansions,and in a much larger domain in the complex plane (not necessarily including the domain of convergence of the series,however).Sometimes the continued fraction converges best where the series does worst,although this is not5.2 Evaluation of Continued Fractions 169 Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copyin Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by Numerical Recipes Software. Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5) g of machine￾readable files (including this one) to any server computer, is strictly prohibited. To order Numerical Recipes books or CDROMs, visit website http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America). into equation (5.1.11), and then setting z = 1. Sometimes you will want to compute a function from a series representation even when the computation is not efficient. For example, you may be using the values obtained to fit the function to an approximating form that you will use subsequently (cf. §5.8). If you are summing very large numbers of slowly convergent terms, pay attention to roundoff errors! In floating-point representation it is more accurate to sum a list of numbers in the order starting with the smallest one, rather than starting with the largest one. It is even better to group terms pairwise, then in pairs of pairs, etc., so that all additions involve operands of comparable magnitude. CITED REFERENCES AND FURTHER READING: Goodwin, E.T. (ed.) 1961, Modern Computing Methods, 2nd ed. (New York: Philosophical Li￾brary), Chapter 13 [van Wijngaarden’s transformations]. [1] Dahlquist, G., and Bjorck, A. 1974, Numerical Methods (Englewood Cliffs, NJ: Prentice-Hall), Chapter 3. Abramowitz, M., and Stegun, I.A. 1964, Handbook of Mathematical Functions, Applied Mathe￾matics Series, Volume 55 (Washington: National Bureau of Standards; reprinted 1968 by Dover Publications, New York), §3.6. Mathews, J., and Walker, R.L. 1970, Mathematical Methods of Physics, 2nd ed. (Reading, MA: W.A. Benjamin/Addison-Wesley), §2.3. [2] 5.2 Evaluation of Continued Fractions Continued fractions are often powerful ways of evaluating functions that occur in scientific applications. A continued fraction looks like this: f(x) = b0 + a1 b1 + a2 b2+ a3 b3+ a4 b4+ a5 b5+··· (5.2.1) Printers prefer to write this as f(x) = b0 + a1 b1 + a2 b2 + a3 b3 + a4 b4 + a5 b5 + ··· (5.2.2) In either (5.2.1) or (5.2.2), the a’s and b’s can themselves be functions of x, usually linear or quadratic monomials at worst (i.e., constants times x or times x2). For example, the continued fraction representation of the tangent function is tan x = x 1 − x2 3 − x2 5 − x2 7 − ··· (5.2.3) Continued fractions frequently converge much more rapidly than power series expansions, and in a much larger domain in the complex plane (not necessarily including the domain of convergence of the series, however). Sometimes the continued fraction converges best where the series does worst, although this is not
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有