正在加载图片...
5.6 Quadratic and Cubic Equations 183 The solution in such cases is to use an alternative Clenshaw recurrence that incorporates ck's in an upward direction.The relevant equations are y-2=y-1=0 (5.5.25) 1 张=k+1,可lk-2-ak,躲-1-c (k=0,1,,N-1) (5.5.26) f(x)=cvFv(z)-(N,x)FN-1(x)N-1-Fw(z)yN-2(5.5.27) The rare case where equations (5.5.25)-(5.5.27)should be used instead of 81 equations (5.5.21)and (5.5.23)can be detected automatically by testing whether the operands in the first sum in(5.5.23)are opposite in sign and nearly equal in magnitude.Other than in this special case,Clenshaw's recurrence is always stable, 餐 independent of whether the recurrence for the functions F is stable in the upward or downward direction. RECIPESI CITED REFERENCES AND FURTHER READING: 2 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).pp.xii,697.[1] Press. Gautschi,W.1967,S/AM Review,vol.9,pp.24-82.[2] Lakshmikantham,V.,and Trigiante,D.1988,Theory of Difference Equations:Numerical Methods and Applications (San Diego:Academic Press).[3] Acton,F.S.1970,Numerica/Methods That Work,1990,corrected edition (Washington:Mathe- matical Association of America),pp.20ff.[4] SCIENTIFIC Clenshaw,C.W.1962,Mathematica/Tables,vol.5,National Physical Laboratory (London:H.M. Stationery Office).[5] 6 Dahlquist,G..and Bjorck,A.1974,Numerica/Methods (Englewood Cliffs,NJ:Prentice-Hall). 84.4.3,p.111. Goodwin,E.T.(ed.)1961,Modern Computing Methods,2nd ed.(New York:Philosophical Li- brary),p.76. 10-521 5.6 Quadratic and Cubic Equations Numerical Recipes 43106 The roots of simple algebraic equations can be viewed as being functions of the (outside equations'coefficients.We are taught these functions in elementary algebra.Yet. North Software. surprisingly many people don't know the right way to solve a quadratic equation with two real roots,or to obtain the roots of a cubic equation. There are two ways to write the solution of the quadratic equation az2+bx+c=0 (5.6.1) with real coefficients a,b,c,namely x=-b±vP-4ac (5.6.2) 2a5.6 Quadratic and Cubic Equations 183 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). The solution in such cases is to use an alternative Clenshaw recurrence that incorporates ck’s in an upward direction. The relevant equations are y−2 = y−1 =0 (5.5.25) yk = 1 β(k + 1, x) [yk−2 − α(k, x)yk−1 − ck], (k = 0, 1,...,N − 1) (5.5.26) f(x) = cN FN (x) − β(N, x)FN−1(x)yN−1 − FN (x)yN−2 (5.5.27) The rare case where equations (5.5.25)–(5.5.27) should be used instead of equations (5.5.21) and (5.5.23) can be detected automatically by testing whether the operands in the first sum in (5.5.23) are opposite in sign and nearly equal in magnitude. Other than in this special case, Clenshaw’s recurrence is always stable, independent of whether the recurrence for the functions Fk is stable in the upward or downward direction. CITED REFERENCES AND FURTHER READING: 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), pp. xiii, 697. [1] Gautschi, W. 1967, SIAM Review, vol. 9, pp. 24–82. [2] Lakshmikantham, V., and Trigiante, D. 1988, Theory of Difference Equations: Numerical Methods and Applications (San Diego: Academic Press). [3] Acton, F.S. 1970, Numerical Methods That Work; 1990, corrected edition (Washington: Mathe￾matical Association of America), pp. 20ff. [4] Clenshaw, C.W. 1962, Mathematical Tables, vol. 5, National Physical Laboratory (London: H.M. Stationery Office). [5] Dahlquist, G., and Bjorck, A. 1974, Numerical Methods (Englewood Cliffs, NJ: Prentice-Hall), §4.4.3, p. 111. Goodwin, E.T. (ed.) 1961, Modern Computing Methods, 2nd ed. (New York: Philosophical Li￾brary), p. 76. 5.6 Quadratic and Cubic Equations The roots of simple algebraic equations can be viewed as being functions of the equations’ coefficients. We are taught these functions in elementary algebra. Yet, surprisingly many people don’t know the right way to solve a quadratic equation with two real roots, or to obtain the roots of a cubic equation. There are two ways to write the solution of the quadratic equation ax2 + bx + c =0 (5.6.1) with real coefficients a, b, c, namely x = −b ± √ b2 − 4ac 2a (5.6.2)
向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有