17.11.2012 Views

Numerical recipes

Numerical recipes

Numerical recipes

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

172 Chapter 5. Evaluation of Functions<br />

Manipulating Continued Fractions<br />

Several important properties of continued fractions can be used to rewrite them<br />

in forms that can speed up numerical computation. An equivalence transformation<br />

an → λan, bn → λbn, an+1 → λan+1 (5.2.11)<br />

leaves the value of a continued fraction unchanged. By a suitable choice of the scale<br />

factor λ you can often simplify the form of the a’s and the b’s. Of course, you<br />

can carry out successive equivalence transformations, possibly with different λ’s, on<br />

successive terms of the continued fraction.<br />

The even and odd parts of a continued fraction are continued fractions whose<br />

successive convergents are f2n and f2n+1, respectively. Their main use is that they<br />

converge twice as fast as the original continued fraction, and so if their terms are not<br />

much more complicated than the terms in the original there can be a big savings in<br />

computation. The formula for the even part of (5.2.2) is<br />

feven = d0 + c1<br />

d1 +<br />

where in terms of intermediate variables<br />

we have<br />

α1 = a1<br />

b1<br />

c2<br />

d2 +<br />

αn = an<br />

, n ≥ 2<br />

bnbn−1<br />

d0 = b0, c1 = α1, d1 =1+α2<br />

cn = −α2n−1α2n−2, dn =1+α2n−1 + α2n, n ≥ 2<br />

··· (5.2.12)<br />

(5.2.13)<br />

(5.2.14)<br />

You can find the similar formula for the odd part in the review by Blanch [1]. Often<br />

a combination of the transformations (5.2.14) and (5.2.11) is used to get the best<br />

form for numerical work.<br />

We will make frequent use of continued fractions in the next chapter.<br />

CITED REFERENCES AND FURTHER READING:<br />

Abramowitz, M., and Stegun, I.A. 1964, Handbook of Mathematical Functions, Applied Mathematics<br />

Series, Volume 55 (Washington: National Bureau of Standards; reprinted 1968 by<br />

Dover Publications, New York), §3.10.<br />

Blanch, G. 1964, SIAM Review, vol. 6, pp. 383–421. [1]<br />

Acton, F.S. 1970, <strong>Numerical</strong> Methods That Work; 1990, corrected edition (Washington: Mathematical<br />

Association of America), Chapter 11. [2]<br />

Cuyt, A., and Wuytack, L. 1987, Nonlinear Methods in <strong>Numerical</strong> Analysis (Amsterdam: North-<br />

Holland), Chapter 1.<br />

Fike, C.T. 1968, Computer Evaluation of Mathematical Functions (Englewood Cliffs, NJ: Prentice-<br />

Hall), §§8.2, 10.4, and 10.5. [3]<br />

Wallis, J. 1695, in Opera Mathematica, vol. 1, p. 355, Oxoniae e Theatro Shedoniano. Reprinted<br />

by Georg Olms Verlag, Hildeshein, New York (1972). [4]<br />

Sample page from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING (ISBN 0-521-43108-5)<br />

Copyright (C) 1988-1992 by Cambridge University Press. Programs Copyright (C) 1988-1992 by <strong>Numerical</strong> Recipes Software.<br />

Permission is granted for internet users to make one paper copy for their own personal use. Further reproduction, or any copying of machinereadable<br />

files (including this one) to any server computer, is strictly prohibited. To order <strong>Numerical</strong> Recipes books or CDROMs, visit website<br />

http://www.nr.com or call 1-800-872-7423 (North America only), or send email to directcustserv@cambridge.org (outside North America).

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!