Error Analysis of a Computation of Eulers Constant

download Error Analysis of a Computation of Eulers Constant

of 6

Transcript of Error Analysis of a Computation of Eulers Constant

  • 7/27/2019 Error Analysis of a Computation of Eulers Constant

    1/6

    MATHEMATICS OF COMPUTATION, VOLUME 28, NUMBER 126, APRIL 1974, PAGES 599-604

    Error Analysis of a Computation of Euler's Constant*By W. A. Beyer and M. S. Waterman

    Abstract. A complete error analysis of a computation of 7 , Euler's c onstan t, is given. Theresults have been used to compute y to 71 14 places and this value has been deposited in th eUM T file.

    1. Introduction. In a paper on ergodic compu tations with continued fractions[I], we used 3561 decimal places of y, Euler's constant, as given by Sweeney [7] ocompute 3420 partial quo tients of the co ntinued fraction expansion of y. The partialquotients were sent to the Unpublished M anuscript Tables file and w ere there com-pared by Dr. Wrench with those given by Choong et al. [3].Some disagreementswere fou nd a nd it was eventually decided to reco mpute Sweeney's value. This involveda careful reading of Sweeney's method and, as his error analysis is not detailed, adistinct error analysis resulted. This analysis is presented here.

    ' 2. Error Analysis. We begin with the exponential integral -Ei(-x) [2, p.3341, nd we conside r only x > 1:(1)where

    OD e- 's t

    -Ei(-x) = 1 - f = -7 - In x 4- S ( x ) ,X2 +-- -+8 x4 ... .S ( x ) = x --* 2 ! 3 . 3 ! 4 .4 !

    The analysis of [6, . 261 ca n be adapted to show

    where IR,,(x)l S (n + I)!/X"+'.owever, we only require n = 0 and it is easy to seethatSince, for x > 0,

    Received June 26, 1973.AMS M O S ) subject classifications (1970). Primary 1064, 10A40; Secondary 41-04, 41A25.* Work partly performed under the auspices of the U. S.Atomic Energy Commission whileone of the auth ors (M.S.W.) was a faculty participant of the Associated Western Universities atLos Alamos Scientific Laboratory. The work was also supported in part by NSF grants GP-28313and GP-28313 #l.

    Copyright 0 974,American Mathematical Society599

  • 7/27/2019 Error Analysis of a Computation of Eulers Constant

    2/6

    600 W . A. BEYER AND M. 9. WATERMAN

    we infer that

    (3) e-= e-"2eS(x) -- n x 4 y 4 S(x) +2-;nx.X

    Our problem is to use Eq. (3) to compute y to a desired number of decimal places.After x is taken to be a power of 2, we must approximate e-"/x, In 2, and S(x). Thecomputation was don e, on the M aniac I1 computer which does multiple-precisioninteger arithmetic without special programming. Therefore eacb function abovewill be multiplied by an ap pro pria te power of 10, say 10". Of the u places in ouranswer, we will require that each answer be correct to d - 1 places. Equa tion (3)becomese-"

    lO"S(x)- 10"- 10" lnn I; l0"y S 1O"S(x)Xe-"z(4) + 10"e - 10"y - 10" In x.Xa

    We first consider the erro r in th e exponential terms of (4).

    ' If the expo nential terms are neglected in (3) and we desire d - 1 correct places, wemust have u - x/ln 10 < u - d or d In 10 < x. Thus, we determine d from(5) d = [x/ln 101.

    The following procedure is used to approxima te S(x). Letn - 1A,-l = 10" --2 x,kA b = 10" - (k+ 1)2xAk+1, 1 S k < n - 1 .

    Then define T(x) byIO"T(x) = xAl = ~(10 '- 5 2)

    = ~ ( 1 0 "- 3 10" -9 A,))...

  • 7/27/2019 Error Analysis of a Computation of Eulers Constant

    3/6

    ERROR ANALYSIS OF A COMPUTATION OF EULER'S CONSTANT 601

    The quantity in parentheses is the remainder term in the Taylor expansion of e.and is therefore equal to xn+'e'=/(n + l)!, 8 E (0, 1). Next, we assume n > 2x an duse a technique of C ourant [4, p. 3261 to obtain x"+'/(n + l)! < ( 2~ )~ ' / ( 2 x ) ! 2 - " - ' .ThusUsing the fact that Stirling's formula underestimates (2x)! [5, p. 541, we obtain

    Since we require d - 1 correct places, we takea + (3 x - n + 1) In 2)/h 10 < a - d

    which yieldsn > d In lO/h 2 3x/h 2 - 1 .

    But we have x > d In 10, so it is sufficient to ta ke(6) n = [4x/ln 21.We note that n = [4x/ln 21 > 2x as required above.isma& in the kth iteration:There is also round-off error in co mputing lO"T(x). Assume that an error of tk

    Then1O" f ' ( x ) = x A I...

  • 7/27/2019 Error Analysis of a Computation of Eulers Constant

    4/6

    602

    miril 1

    ' 1 11'1 !", FVATERMAN

    I 1 1 8 1 11iii1 laces, one can use (3) to computeI 1 I I I, imputation of the decimals of In 2 is

    I 1 1 I IC !some positive integer to be deter-I I I t 1 c:btained from Taylor's series):

    1 . - - + 7+ . . . .I i o a ioR1 ! 1 . 3 6 7 . 3 ). . . . . .

    whi(8)Thi

    (9)

    Thi ~

    mii

    (11 1Hi( 1 : I1

    I lI I : ~ 3 by the condition that11 1 l I ) : 3 2 k+1 .

    I I IIO i,.l oiminated by

    I 1 1 1 ] i i,e dominated by k - 1. Hence11 ' l'I(k - 1) + 9/4,

    I I I.idies (8). An upper bound to k as given

    i

    II ,

    /:I! In I O / h 3 + a .1:11icsees from (12) that the error in In 2I II:II laces. We actually have only reported

  • 7/27/2019 Error Analysis of a Computation of Eulers Constant

    5/6

    ERROR ANALYSIS OF A COMPUTATIONOF EULER'S CONSTANT 603TABLE

    Theoretical Frequencyof n:1 (n +-lnample Frequencyn of n In 2 n(n + 2)

    1 0.4225 0.41502 0.1646 0.16993 0.08% 0.09314 0.0527 0.05895 0.0438 0.04066 0.0308 0.02977 0.0228 0.02278 0.0216 0.01799 0.0121 0.014410 0.0124 0.0119

    Guaranteed Numberof Actu al Num berX d - 1 Correct DigitsCorrect Digits of

    8163264128256

    512102420484096819216384

    25122654110221443888177735567114

    4714295711322444688917953561

    4. Computation of y. For our calculation, we used x = 2". From this x,we obtained d = [x/ln 101 = 7115, a = 2d + 1 = 14231, n = [4x/ln 21 = 94548,an d k = [a n 10/(2 In 311 + 1 = 14914. The above analysis shows that o ur com-putation of y is accurate to 71 14 places. The err ors from e -= / x an d S(x) might eachaffect the 7115th place.From this computation, we obtained 7114 correct decimal places of y. Thesevalues were used to calculate 6920 partial quo tients in the continued fraction expan-sion of y. The 7121 places of In 2 yielded 6890 partial quotients of In 2. Note that

  • 7/27/2019 Error Analysis of a Computation of Eulers Constant

    6/6

    604 W. A. BEYER AND M. S. WATERMANthe number of partial quotients of y is more than th at of In 2. These have been sentto the U npublished Manuscript Tables (UM T) file of this journal.In Choong et al. [3], Table 1gives sample frequency of n and theoretical frequencyof n for 3470 partial quotients of y. Ou r Table 1corrects their Table 1.Our Table 2gives our results for x = 2 ( t = 3, 4, * . , 14) and is thus a check of our analysis.

    Acknowledgements. The authors thank Dr. J . W. Wrench, Jr. for helpfulsuggestions and encouragement in this work. We thank the referee for pointing outsome oversights.Los Alamos Scientific LaboratoryLos Alamos, New Mexico 87544Idaho State UniversityPocatello, Idah o 83201

    1 . W. A. BEYER& M. S.WATERMAN,Ergodic computations with continued fractions andJacobis algorithm, Numer. Math., v. 19, 1972, pp. 195-205. Errata, v. 20, 1973, p. 430. MR46 #2832.2. T. J. IA. BROMWICH, n Introduction to the Theory of Infinite Series, 2nd rev. ed.,Macmillan, London, 1949.3. K. Y. CHOONG,D. E. DAYKIN C. R. RATHBONE,Rational approximations to T,Math. Comp. , v. 25, 1971, pp . 387-392. (See also M a t h . Co m p . , v. 27, 1973, p. 451, M TE501.) MR 46 #141.4. R. COURANT,iffer enti al and Integral C alculus. Vol. I, 2n d rev. ed., Interscience, NewYork, 1937.5. W. FELLER,n Introduction to Probability Theory and its Applications. Vol. I, 3r drev. ed., Wiley, New York, 1968. M R 37 #3604.6. G. H. HARDY,ivergent Series, Clarendon Press, Oxford, 1949. M R 11,25.7. D. W. SWEENEY,On he computation of Eulers constant, Math. Cornp., v. 17, 1963,pp. 170-178. (See Corrigendum in Math. Comp. , v. 17, 1963, p. 488 . ) M R 28 #3522.