Vous êtes sur la page 1sur 10

Convergence Acceleration of Alternating Series

Henri Cohen, Fernando Rodriguez Villegas, and Don Zagier

CONTENTS
The First Acceleration Algorithm Two Flavors of the Second Algorithm Applicability Extension to Certain Nonalternating Series References

We discuss some linear acceleration methods for alternating series which are in theory and in practice much better than that of EulerVan Wijngaarden. One of the algorithms, for instance, allows one to calculate ( 1)k ak with an error of about 17.93 n from the rst n terms for a wide class of sequences ak . Such methods are useful for high precision calculations frequently appearing in number theory.

f g

The goal of this paper is to describe some linear methods to accelerate the convergence of many alternating sums. The main strength of these methods is that they are very simple to implement and permit rapid evaluation of the sums to the very high precision (say several hundred digits) frequently occurring in number theory.
THE FIRST ACCELERATION ALGORITHM

The typical series P we1will be considering are alternating series S = k=0 ( 1)k ak , where ak is a reasonably well-behaved function of k which goes slowly to 0 as k ! 1. Assume we want to compute a good approximation to S using the rst n values ak . Then our rst algorithm is:
Algorithm 1. Initialize:

d = (3 + 8)n ; d = (d + 1=d)=2; b = 1; c = d; s = 0; For k = 0 up to k = n 1, repeat: c = b c; s = s + c a k ; b = (k + n)(k n)b=((k + )(k + 1)); Output: s=d.
1 2

Keywords: Convergence acceleration, alternating sum, Chebyshev polynomial. AMS Classi cation: 11Y40

This algorithm computes an approximation to S as a weighted sum of a0 ; : : : ; an 1 with universal rational coe cients cn;k =dn (= c=d in the notation of the algorithm; note that both c and d are integers). For instance, for n = 1, 2, 3, 4 the approximations given
c A K Peters, Ltd. 1058-6458/2000 $0.50 per page Experimental Mathematics 9:1, page 3

Experimental Mathematics, Vol. 9 (2000), No. 1

by the algorithm are 2a0 =3; (16a0 8a1 )=17; (98a0 80a1 +32a2 )=99; (576a0 544a1 +384a2 128a3 )=577; respectively. The denominator dn grows like 5:828n and the absolute values of the coe cients cn;k decrease smoothly from dn 1 to 0. Proposition 1 below proves that for a large class of sequences fak g the algorithm gives an approximation with a relative accuracy of about 5:828 n , so that to get D decimal digits it su ces to take n equal to approximately 1.31D. Notice that the number of terms and the time needed to get a given accuracy are essentially independent of the particular series being summed, if we assume that the ak 's themselves are either easy to compute or have been precomputed; on a Sparcstation 5 using Pari, for instance, the computation of S to 100 or 1000 decimal digits requires about .1 or 6 seconds, respectively. The algorithm uses O(1) storage and has a running time of O(1) per value of ak used. Proposition 1. For integers n k 0 set p n p n (3 8) (1) dn = (3 + 8) + 2 and ! k X n n + m cn;k = ( 1)k dn 22 m n + m 2 m m=0 n X n n + m 22m : = ( 1)k (2) n + m 2m m=k+1 Assume that the ak are the moments of a positive measure on 0; 1] and set n 1 1 X X n;k a : Sn = cd S = ( 1)k ak ; k k=0 n k=0 Then 2p S : S jS Snj d n (3 + 8)n R1 Proof. By assumption, ak = 0 xk d , where d is a positive measure. Then Z 1 1 X 1 d ; S = ( 1)k ak = 1 + x 0 k=0

the interchange of summations being justi ed by the positivity. Let fPn (x)g be a sequence of polynomials ~n := Pn ( 1) 6= 0. such that Pn has degree n and d Set n 1 Pn ( 1) Pn (x) = X c ~n;k xk : 1+x ~n and ~n as Sn in the proposition but with d De ne S c ~n;k instead of dn and cn;k . Then Z 1 Pn ( 1) Pn (x) d = S R ; ~n = 1 S n Pn ( 1) 0 1+x say, with Z 1 n (x) Rn = P ( P1)(1 (3) + x) d ; n 0 and by virtue of the positivity of d we can estimate the \error term" Rn by Z 1 M 1 d = Mn S; n jRnj jP ( 1)j 1 + x jPn ( 1)j n 0 where Mn is the supremum of jPn (x)j on 0; 1]. It follows that Mn =jPn ( 1)j is an upper bound for the ~n . relative error made by approximating S by S We now choose for Pn (X ) the polynomials de ned by Pn (sin2 t) = cos 2nt; (4) so that Pn (x) = Tn (1 2x) where Tn (x) is the ordinary Chebyshev polynomial. Clearly Mn = 1 and ~n = Pn ( 1) = dn with dn as in (1). d The recursion Pn+1 (X ) = 2(1 2X )Pn (X ) Pn 1 (X ) implies by induction the explicit formula n X n n + m 22m X m ; (5) Pn (X ) = ( 1)m n + m 2m m=0 so c ~n;k = cn;k with cn;k as in (2). This completes the proof of the proposition. Remarks. 1. The method implicit in Proposition 1 is well known in numerical analysis under the heading of \Pade type approximation" Brezinski 1980; Eiermann 1984; Gustafson 1978/79; Wimp 1981]. As we mentioned above, we are concerned with calculations to a high degree of accuracy, where the number of digits gained per number of steps, and the amount of storage required, are crucial. Thus our
k=0

Cohen, Rodriguez Villegas, and Zagier: Convergence Acceleration of Alternating Series

emphasis is di erent from that in numerical analysis, where one usually works in xed, and relatively low, precision. The implementation of Algorithm 1 is good in both respects. 2. The classical algorithms found in the literature (see Press et al. 1988]) are Euler's method or Euler{ Van Wijngaarden's method. These can be shown to correspond respectively to the polynomials Pn (X ) = (1 X )n with convergence like 2 n and polynomials Pn (X ) = X a (1 X )b with a + b = n dependent on the particular sequence, with convergence like 3 n for a = n=3. Note that a direct implementation of the algorithm given in Press et al. 1988] needs a lot of auxiliary storage if we want high accuracy, while our method does not. 3. Algorithm 1 computes \on the y" the coe cients of the polynomial (Pn ( 1) Pn (X ))=(1+ X ), where Pn (X ) = Tn (1 2X ). Equivalently, we could also compute on the y only the coe cients of the polynomial Pn (X ) itself and use the partial sums of the alternating series instead of the individual terms, using n n 1 X X X n n + m 22m m cn;k ak = n + ( 1)k ak : m 2 m m=1 k=0 k=0 This can be particularly useful when the sequence of partial sums is naturally given, and not the ak themselves, as in the continued fraction example mentioned at the end of this paper. 4. The hypothesis that the an 's are moments of a positive measure on the interval 0,1] is a well known one, and is equivalent by a famous theorem of Hausdor 1923] to the total monotonicity of the sequence fan g, in the sense that for each xed k, the sequence f k an g of the k-th forward di erences of fang has constant sign ( 1)k . 5. In addition to this, trivial modi cations are possible. For example, one can replace the step d = (d + 1=d)=2 by the simpler one d = d=2, since this modi es the nal result by a negligible amount, but leaves d as a nonintegral value. We could also immediately divide by d (initializing b to 1=d and c to 1). In our implementation each of these modications led to slower programs. 6. We proved convergence of the algorithm (at a rather fast geometric rate) under the above condition. However, examples show that it can be applied

to a much wider class of series, and also, as is usual in acceleration methods, to many divergent series. 7. The choice of the Chebyshev polynomial can be shown to be close to optimal if we estimate the remainder term Rn crudely as we did above. On the other hand, as we will see below, for a di erent class of alternating series, we can estimate Rn more precisely and nd much better polynomials Pn . The corresponding algorithms and their analysis seem to be new. 8. If the sequence ak already converges at a geometric rate, better algorithms are possible which are trivial modi cations of the ones presented in this paper. For example, if one knows in advance that ln(ak ) k ln(z ) for some pin Algop z 1, then rithm 1 simply replace 3+ 8 by 2z +1+2 z (z + 1) and multiply by z the right hand side of the recursion p formula for b. The convergence is in (2z + 1 + 2 z (z + 1)) n , and thus faster than the direct application of Algorithm 1. Similar modi cations are valid for the other algorithms of this paper. The details are left to the reader. To illustrate Algorithm 1, we give a few examples. Each can also be treated individually using speci c methods. Example 1. By taking logarithms we can compute the product

A :=

1 Y
n=1

(1 + 2n1 1 ) (1 + 21n ) = 1:0621509055 : : :

rapidly to high accuracy. The product is slowly convergent and the gamma function is hard to compute, so our method is very useful here. In fact, as we will see below, Algorithm 2B is even better in this case. Example 2. Similar remarks apply to the sum

B :=

1 X

2 = 1:1443442096 : : : ( 1)n Li2 n n=2


P

k 2 where Li2 (x) = 1 k=1 x =k is the dilogarithm function. This sum arose in connection with the computation of a certain de nite integral related to Khinchin's constant Borwein and Crandall 2000].

Experimental Mathematics, Vol. 9 (2000), No. 1

The Riemann zeta function can be calculated for reasonable values of the argument by 1 X ( 1)n ; 1 s 1 2 (s) = (n s n=0 + 1) 1 ) = 1:4603545088 : : : or and we nd values like ( 2 even ( 1 + i) = 0:0168761517 : : : 0:1141564804 : : : i to high accuracy and very quickly (comparable to Euler{Maclaurin). Note that the latter example works even though the coe cients ak of our \alP ternating" series ( 1)k ak are not alternating or even real and do not tend to zero. The derivatives of (s) can also be calculated similarly, e.g. we can compute 1 n log n X pn C1 := ( 1) = 0:1932888316 : : : n=1 by Algorithm 1,p and then use the identity C1 = p 2 ln 2 ( 1 ) + ) to deduce the value of (1 2) 0 ( 1 2 2 0( 1 ) = 3:9226461392 : : : . In a similar manner, we 2 can compute 1 n X C2 = ( 1) nlog n = 0:1598689037 : : : n=1 by Algorithm 1, and then use the identity C2 = log 2( 1=2 log 2) to deduce the value of Euler's constant = 0:5772156649 : : : . Moreover, as suggested to us by R. Sczech, we may even use Algorithm 1 to sum the divergent series
Example 3.

from the bound 1=d655 7 10 502 of Proposition 1. If we make di erent assumptions on the sequence fak g, we can use better polynomials than the Chebyshev polynomials. For example, we can reason as follows. Assume that d = w(x) dx for a smooth function w(x). Then taking Pn (X ) and dn as in (4) and (1) respectively and setting x = sin2 t, we get from (3) Z =2 2 2t dt cos(2nt) w(sin t) sin dn Rn = 2 1 + sin t 0 =
Z =2
0

cos(2nt) h(t) dt

C =
3

1 X
n=1

( 1)n log n = 0:2257913526 : : : ;

recovering the known value 1 log( 2 ) of the deriva2 tive of (1 21 s ) (s) at s = 0. Note that in the rst two examples ak was in fact the restriction at points of the form 1=k of a function analytic in the neighborhood of 0, and so other techniques could be used such as expanding explicitly ak in powers of 1=k. However, in the last examples, this cannot be applied. Computing the constants Ci for i = 1; 2; 3 using algorithm 1 with n = 655 took about 20 seconds in a Gp-Pari implementation on a 300 MHz computer running Linux. The relative errors were: 5 10 504 for C1 , 5 10 506 for C2 and 2 10 500 for C3 , not far

(m) The corresponding remainder term Rn satis es (m) dnRn = O(1=n2m+2 ) (and even O(1=n2m+3 ) if m is odd) as n ! 1 for xed m, so we get better and better sequences of polynomials.

for a smooth function h(t). If we integrate twice by parts, we get 1 ( 1)n c + c dn Rn = 4n 1 2 2 Z =2 1 00 4n2 0 cos(2nt) h (t) dt; (6) for some constants c1 = h0 ( =2) and c2 = h0 (0). If we multiply both sides of this equation by n2 , 1 then the rst term 4 (( 1)n c1 + c2 ) has period 2. This suggests replacing the polynomial Pn (X ) by the polynomial (1) Pn (X ) = n2 Pn (X ) (n 2)2 Pn 2 (X ) : It is then easily seen that for the new remainder (1) (1) = O(1=n5 ) instead of O(1=n2 ). we have dn Rn Rn (1) is a better polynomial Hence for our purposes Pn than Pn . Notice also that 1 d2 sin(2t) sin(2(n 1)t) : (1) Pn (sin2 t) = 2 dt2 Continuing in this way, we de ne a double family of (m) as the m-th di erence (with step polynomials Pn 2) of the sequence nm+1 Pn (where we set P n = Pn for n > 0 since cos(2nt) is an even function of n), and nd that for m > 0 1 d m+1 sin(2t)m sin(2(n m)t) (m) Pn (sin2 t) = 2 dt

Cohen, Rodriguez Villegas, and Zagier: Convergence Acceleration of Alternating Series

As polynomials in X , these polynomials can be computed either from the formula giving the m-th di erence, i.e., X (m) Pn (X ) = ( 1)r m (n 2r)m+1 Pn 2r (X ) r 0 r m (where we naturally set P n (X ) = Pn (X )) or by the formulas (m) Pn (X ) = 2m+r 1 ( D)r s nX m 1 n 2m X k+r (1 X )n m 1 k+r ( 1)k 22 k+1 k=0

TWO FLAVORS OF THE SECOND ALGORITHM

Algorithm 1 can be immediately generalized to any sequence Qn of polynomials, except that the coefcients of Qn cannot be computed on the y, thus giving rise to the following family of algorithms.

where m + 1 = 2r + s with 0 s 1, d ; and = 2X (1 X ) d + 1 2X: D = dX dX This suggests taking either the diagonal sequence (n 1) An = Pn =(2n 1 n!) (7) or the sequence (m) Bn = P n = (n m)(m + 1)! 2m (8) with m = bn=2c, where the (unimportant) normalizing constants have been chosen so that An (0) = Bn(0) = 1 (other ratios between m and n could be considered and we will brie y comment on this later). The rst few values are A0 (X ) = 1; A1 (X ) = 1 2X; A2 (X ) = 1 8X + 8X 2 ; A3 (X ) = 1 20X + 54X 2 36X 3 ; and Bn (X ) = An (X ) for n 4. Note that the formulas giving the polynomials An are particularly simple: we have dn sinn 2t ; (9) An(sin2 t) = 2n1n! dt n and 2r (1 2X ) d + 2(X X 2 ) d2 r An (X ) = (2 r)! dX dX 2 X r (1 X )r (1 2X )s if n = 2r + s with 0 s 1.

Q X b Xk. d Q c d; s = 0; k k n 1, repeat: c = bk c; s = s + c a k ; Output: s=d. In particular, applying this to the families Qn = An and Qn = Bn (de ned in (7) and (8) respectively), we obtain two algorithms 2A and 2B which are of the same sort as Algorithm 1 in that they output an approximation Sn which is a universal rational linear combination of a ; : : : ; an . The values for n = 1 and n = 2 are 2a =3, (16a 8a )=17 as before, while those for n = 3 and n = 4 are (110a 90a + 36a )=111 and (2288a 2168a + 1536a 512a )=2191, respectively (since An = Bn for n 4, the coe cients are the same for both algorithms up to that point). We now analyze the speed of convergence of these algorithms. For Algorithm 2A we will nd that it is like 7:89 n for a large class of sequences fak g and like 17:93 n for a smaller class, both better than the 5:83 n we had for Algorithm 1. For the same two classes of sequences, Algorithm 2B will be like 9:56 n and 14:41 n . In other words, depending on the sequence Algorithm 2A or 2B may be the better choice. On the other hand, unlike Algorithm 1, we do not have a quick way to compute the individual coe cients cn;k in time O(1) each but must compute (and store) the whole polynomial An (X ) or Bn (X ). As a result, these algorithms require storage O(n) and time O(n ) instead of O(1) and O(n) as before. Thus they are inferior to Algorithm 1 if the numbers ak are easy to compute (like ak = 1=(k + 1)), but superior to it if the main part of the running time is devoted to the computation of the ak (as in Examples 1 or 2 above), or in the extreme case when we only know a xed number of values a ; a ; : : : ; an and want to make the best guess of the value of P ( 1)k ak on the basis of this data.
0 1 0 0 1 0 1 2 0 1 2 3 2 0 1 1

Algorithm 2Q . Pn Let n ( ) = k=0 k Set = n ( 1); = For = 0 up to =

Experimental Mathematics, Vol. 9 (2000), No. 1

To state the result we need the constants de ned by A = cosh A = 7:8898395 : : : ; B = e B = 9:55699 : : : ; A = A r0 = 17:9340864 : : : ; p B = B r0 = 14:408763 : : : : Here A = 2:754682 : : : and B = 2:2572729 : : : are the unique real roots of A tanh A = 2L and L, respectively, where L = B e pB sinh B = 2p log(1 + 2), and r0 = 4t0 = sin 4t0 = 2:27306 : : : , where t0 = 0:652916 : : : is the unique root in 0; =2] 1 2 of t2 0 + L = 2 t0 tan 2t0 . In addition, let CA be the union of the images in the complex plane of the two maps t 7! sin2 t (sin(2t)=2)(cos(2t) i sin(2t)) ; for 0 t =2, and let CB be the union of the images in the complex plane of the two maps t 7! sin2 t (r0 sin(2t)=2) p 2 cos(2t)2 ; r0 cos(2t) i 1 r0 for t0 t
Proposition 2.

Assume that the coe cients ak are given as moments ,

=2 t (see Figure 1).


0

ak =

Q = S S Q be the For Q = A or Q = B , let Rn n di erence between the true value of S and the output Q of Algorithm 2Q . Sn 1. If w(x) extends analytically to the interior of the region bounded by the Curve CA, then for Q = A Q j is bounded by ( Q + o(1)) n . or Q = B , jRn 2. If w(x) extends analytically to the whole complex plane (or only to the interior of the region bounded by the Curve CB ), then for Q = A and Q j is bounded by ( Q + o(1)) n . Q = B , jRn In fact the proof will show that to get convergence like Q n we can allow singularities xm 1=2 (m 0) at the origin (i.e., it is su cient if xw(x2 ) rather than w(x) itself be analytic). If w is analytic in a smaller region than those described in Proposition Q 2, then we still get exponential convergence of Sn to S , but with a worse constant.

w(x) xk dx:

Here are a few simple examples. We set = Q and = Q with Q = A or Q = B , depending on whether Algorithm 2A or 2B is used. Example 4. Set ak = 1=(k + 1), S = log 2. Here w(x) = 1, so the proposition applies directly to give speed of convergence n . Hence in this case Algorithm 2A is better than Algorithm 2B , Example 5. Set ak = 1=(2k + 1), S = =4. Here x 1=2, so xw(x2 ) is analytic and we again w(x) = 1 2 get convergence n . Once again Algorithm 2A is better. p Example 6. Set ak = 1=(3k +1), S = (log 2+ = 3)=3. 1 x 2=3 with a singularity at 0, so the Here w(x) = 3 convergence is like n . Hence in this case Algorithm 2B is better than Algorithm 2A . Example 7. Set ak = 1=(k + 1)2 , S = 2 =12. Here w(x) = log(1=x), again with a singularity at 0, so we get n convergence. The same applies to ak = 1=(k +1)s , where w(x) is proportional to logs 1 (1=x) and the convergence is again like n . Again Algorithm 2B is better. Example 8. Set ak = 1=(k 2 +1), S = 1 + =(e e ). 2 Here w(x) = sin(log(1=x))=x, again with convergence like n . Again Algorithm 2B is better. Proof of Proposition 2. We rst consider the case of Algorithm 2A . The rst thing we need to know is the asymptotic behavior of An ( 1). According to Lagrange's formula, if z = a + w'(z ) with ' analytic around a then 1 dn n dz = X n (a)) w ( ' (10) da n=0 dan n! (di erentiate Hurwitz and Courant 1929, p. 138, eq. (8)] with respect to a taking f (z ) = z , for example). Choosing '(z ) = sin 2z; w = u=2 and a = t in combination with (9) yields the identity
1 X
n=0

An (sin t) un = 1 u1cos 2z
2

sin 2z =t z u 2

(11)

and in particular
1 X
n=0

An ( 1) un = 1 u1cos 2z

z u sin 2z =iL 2

Cohen, Rodriguez Villegas, and Zagier: Convergence Acceleration of Alternating Series

2i

CB

i
0

iL
1

D(r )
0

D(1)
2 1

i
0

CA 1 2

iL

i
2i

where p L = log( 2+1) (or, more precisely, any value log( 2 + 1) + in ). To nd the limiting value of jAn ( 1)j1=n , we need to look at the values of u for which the expression on the right becomes singular. This clearly happens if u cos 2z = 1 for a value of z with z (u=2) sin 2z = iL: The smallest value of juj occurs for z = i A =2 and equals 1= A , with A and A as in the proposition. Hence lim supn!1 jAn ( 1)j1=n = A . A more careful analysis gives n+1=2 =p n( 2 1) An ( 1) 2 A A or even an asymptotic expansion, but we will not use this. Now if we used the proof of Proposition 1 directly A would be estimated essentially by the error term Rn Mn =An ( 1), where Mn = 0max jA (x)j: x 1 n Using (11), one can show that this number grows like (1:5088 : : : )n (the maximum is attained at x = 1 2 if n is even), leading to an error estimate of about 5:23 n , which is worse than we had before. But of course the motivation for introducting the polyno(m) mials Pn and the diagonal subsequence An was to improve the error term by assuming that the function w(x) or h(t) was smooth and use repeated integration by parts; see (6). Making this assumption

FIGURE 1.

The sets CA and CB.

and doing the integration by parts, we obtain Z 1 w(x) dx A An ( 1) Rn = An(x) 1 +x 0 =


Z =2
0

An(sin t) h(t) dt
2

Z =2 n 1 d sinn(2t) h(t) dt = 2n n! n dt 0 Z = 2 n n n (2t) d h(t) dt; = (2n1) sin n! 0 dtn so by Taylor's theorem Z =2 1 X A n h t u An ( 1) Rn u = 2 sin 2t dt: 0 n=0 As t goes from 0 to =2 for a xed (complex) value sin 2t moves along a path of u, the argument t u 2 Cu connecting the points 0 and =2. If for some r > 0 the function h(t) is entire in the region D(r) = S juj r Cu , then the above integral representation of P A un shows that this sum is analytic in An ( 1) Rn the disc juj < r and hence that A j1=n 1=r: lim sup jAn ( 1)Rn

The best value of r we can hope for (unless w is very special) is the number r0 = 2:27306 : : : , for which the point t = iL lies on the boundary of D(r), since at this point the denominator 1 + sin2 t of h(t) will vanish. (The value of r0 can be computed by simple p calculus: r0 is the minimum p of 2 t2 + L2 =jsin 2tj for t 2 0; =2] and is equal to 4t0 = sin 4t0 with t0 as

n!1

10

Experimental Mathematics, Vol. 9 (2000), No. 1

in the proposition.) This then leads to the estimate 1 A j1=n lim supn!1 jRn A with A = r0 A , and is valid whenever h is analytic in D(r0 ) or equivalently, whenever w is analytic in the region fsin2 t j t 2 D(r0)g, which is the region bounded by Curve CB in Figure 1. If w(x) has a singularity within this region then we get a worse estimate. In particular, if w(x) has a singularity at the origin, as in the examples 3{6 above and many others, then the convergence of A to S will be like n if h(t) has no singularities in Sn A D(1), since r = 1 is the largest value of r for which 0 is not in the interior of D(r). The boundary of the region fsin2 t j t 2 D(1)g is shown as Curve CA in Figure 1. The case of Algorithm 2B is very similar, but slightly more complicated. We sketch it brie y. To be able to apply Lagrange's formula (10), we introduce d m (e2it sin 2t)m e 2it Cm (t) = m!12m dt sin 2t so that + Cm+1 ( t) for m > 0 : B2m (sin2 t) = Cm+1 (t) 2 im Then a similar use of Lagrange's formula (10) shows that 2 lim sup jCm ( iL)j1=m = B ;
m!1

before), but with the numbers there replaced by

and

occurring

so that lim sup jBn ( 1)j1=n = B when n ! 1 through even values of n. A similar proof shows that the same holds for odd values. The rest of the proof is essentially unchanged, still using the functions Cm (t). Since e2it is of modulus 1 when t is real, the domains of analycity required for w(sin2 t) are still the same. We thus obB j1=m 1=r0 and simitain lim supm!1 jB2m ( 1)R2 m B 1=n larly for 2 m +1, hence lim sup n!1 jBn ( 1)Rn j p 1= r0 as claimed. Remarks. 1. More generally we can consider Algo(m) rithm 2Q with Qn proportional to Pn with m = n=(1 + ) + O(1) and > 0, Algorithm 2A corresponding to = 0 and Algorithm 2B to = 1 (the exact choice of m has no e ect on the speed of convergence of the algorithm). The same analysis as before shows that the analogue of Proposition 2 remains true (with the same curves CA and CB as

= e (cosh + sinh ) 1=( +1) ; 1=( +1) = r0 ; where = is a root of 1=(coth + ) = 2L and r0 = 2:2736 : : : is the same number as before. It can be shown that = 0, i.e. Algorithm 2A , gives the largest value of , and that = 1, i.e. Algorithm 2B , gives the largest value of , whence the choice of these two algorithms. (Note: the largest value of is in fact obtained for = 0:123559 : : : , but we must restrict to non-negative values of since otherwise more than n terms of the sequence fak g are used.) 2. We do not claim that the sequences of polynomials that we have given give the best results, only that they are natural choices. Other sequences of polynomials Pn can be used for linear acceleration of alternating sequences which for certain classes of sequences fak g will give even better convergence. These sequences of polynomials are related to polynomials which are used in Diophantine approximation to get good irrationality measures for numbers such as log 2, or (3), following the works of Apery, Beukers, Rhin et al. 3. For sequences fak g for which w(x) is analytic in an even larger region than the one bounded by Curve CB, we can improve the 17:93 n bound for Algorithm 2A by taking a linear combination of ak and some standard sequence like 1 a0 k = k+1 to force w(x) to vanish at 1. Then 0 Sn = S + w( 1)(Sn S 0 ) + "n ; where the error term "n tends to 0 faster than before (and even more than exponentially if w(x) is entire, since the modi ed series
X

Qn ( 1)Rn =

un

Z =2
0

(entire in t, u) dt

has in nite radius of convergence), and using this with two di erent values of n to eliminate the w( 1) term we get improved approximations to S .

Cohen, Rodriguez Villegas, and Zagier: Convergence Acceleration of Alternating Series

11

APPLICABILITY

Since we have given three algorithms, some advice is necessary to be able to choose between the three. If the sequence fak g is very easy to compute and not too many decimal digits are required (say at most 1000), we suggest using Algorithm 1, which has the advantage of being by far the simplest to implement and which does not require any storage. This is the default choice made in the Pari system for example. If the sequence fak g already converges to 0 at a geometric rate, then w(x) cannot be analytic and hence Algorithm 1 should again be chosen, taking into account Remark 8 on page 5. If the sequence fak g is di cult to compute or if a large number of decimal digits are desired, it should be better to use Algorithms 2A or 2B . Since a priori one does not know the analytic behavior of w(x), in view of the examples which have been presented, w(x) has frequently a singularity at x = 0, hence we suggest using Algorithm 2B . Of course, if we know that w(x) is much better behaved, then Algorithm 2A becomes useful also.
EXTENSION TO CERTAIN NONALTERNATING SERIES

shows that one can rewrite S as an \alternating" sum b1 b2 + b1 b2 b3 1 S = qbq ; q1q2 q2 q3 0 1 where the qi are de ned by q 1 = 0, q0 = 1 and qn = cn qn 1 + bn qn 2 , and we can then apply one of the given algorithms to the sequence Q b ak = 1q jq k+1 j : k k+1 Note that frequently continued fractions converge geometrically (this is true for example in the case of simple continued fractions, i.e. bk = 1 for all k and ak positive integers) hence Remark 8 on page 5 must be taken into account, and Algorithm 1 should usually be preferred.
REFERENCES

The algorithms given can also be used in cases where alternating series occur only indirectly. A rst example is the summation of series with positive terms. Using a trick due to Van Wijngaarden and described in Press et al. 1988], such a series can be converted to an alternating series as follows:
1 X
k=1

ak =

1 X

In this case the coe cients bm of the alternating sum are themselves in nite sums, hence are hard to compute, and so it is usually useful to use Algorithm 2B instead of Algorithm 1. A second example is the computation of continued fractions S = b1 =(c1 + b2 =(c2 + )) with bk and ck positive. The standard theory of continued fractions

m=1

( 1)m bm with bm =

1 X
k=0

2k a2k m :

Borwein and Crandall 2000] J. Borwein and R. Crandall, In preparation. Brezinski 1980] C. Brezinski, Pade-type approximation and general orthogonal polynomials, Intern. Series of Numer. Anal. 50, Birkhauser, Basel, 1980. Eiermann 1984] M. Eiermann, \On the convergence of Pade-type approximants to analytic functions", J. Comput. Appl. Math. 10:2 (1984), 219{227. _ Gustafson, \Convergence Gustafson 1978/79] S.-A. acceleration on a general class of power series", Computing 21:1 (1978/79), 53{69. Hausdor 1923] F. Hausdor , \Momentprobleme fur ein endliches Intervall", Math. Z. 16 (1923), 220{248. Hurwitz and Courant 1929] A. Hurwitz and R. Courant, Vorlesungen uber allgemeine Funktionentheorie und elliptische Funktionen, Springer, Berlin, 1929. Press et al. 1988] W. H. Press, B. P. Flannery, S. A. Teukolsky, and W. T. Vetterling, Numerical recipes in C, 2nd ed., Cambridge University Press, Cambridge, 1988. Wimp 1981] J. Wimp, Sequence transformations and their applications, Math. in Sci. and Engin. 154, Academic Press, New York, 1981.

12

Experimental Mathematics, Vol. 9 (2000), No. 1

Henri Cohen, Laboratoire d'Algorithmique Arithmetique et Experimentale (A2X), Universite Bordeaux I, 33405 Talence, France (Henri.Cohen@math.u-bordeaux.fr) Fernando Rodriguez Villegas, Department of Mathematics, University of Texas at Austin, Austin, TX 78712, USA (villegas@math.utexas.edu) Don Zagier, Max Planck Institut fur Mathematik, Gottfried Claren Strasse 26, 53225 Bonn, Germany (don@mpim-bonn.mpg.de) Received December 7, 1998; accepted January 25, 1999

Vous aimerez peut-être aussi