[math-fun] continued fractions yielding pi
[image: Add contact] RCS> I think F1 below (for erfc) has crummy convergence. The numerators in the cf terms are increasing linearly, while the denominators are constant. The recurrence for successive convergents' numerators & denominators will overemphasize the older term over the newer term, which retards the decay of the oscillation around the limit. Gosper can likely say more. Rich I had an Mma function for CF convergence, but I forgot how it works and broke it.-{ But I seem to recall linerar/constant converges "T3" (see below). WDS> On 2/21/14, Warren D Smith <warren.wds@gmail.com> wrote: Well, two natural questions arise: Q1. is there any known series expansion for pi (or something closely related) which, like the usual series for e, converges factorially rather than merely geometrically? If said series arose from an analytic function's Taylor series, then this would necessarily be an "entire" function, ruling out stuff like arcsine, arctan, elliptic functions, elliptic integrals, log, and polylogs, but permitting, e.g, the reciprocal of the Gamma function, and erf and erfc, and new functions. --various continued fractions for erf and erfc are available here:http://functions.wolfram.com/GammaBetaErf/Erfc/10/01/http://functions.wolfra... These would allow computing pi using a sum of two continued fraction evaluations to compute integral_0^infinity exp(-t^2) dt = sqrt(pi)/2. For example, let F1(z) = (sqrt(pi)/2)*erfc(z) F2(z) = (sqrt(pi)/2)*erf(z) so that for any z>0 we have sqrt(pi)/2 = F1(z) + F2(z) and could choose the value of z to maximize convergence speed or whatever. Then we have such continued fractions as F1(z) = exp(-z^2) * 1/(2z+) 2/(2z+) 4/(2z+) 6/(2z+) 8/(2z+...) F2(z) = exp(-z^2) * z/(1-x+) (2x/(3-x+)) (4x/(5-2x+)) (6x/(7-2x+)) (8x/((9-2x+...) where x=2*z*z. Similarly one could compute pi in a different way via a sum of continued fractions by computing certain gamma function values as a sum of two incomplete gamma functions to get the whole Euler-gamma-integral. <WDS See 2010 mail near end. In the 70s, Rich, Gene, and I dreamed that we could show the algebraic independence of π and e by proving the empirical "fact" that e was T2 and π was T3, where Tk means time complexity n (log n)^k loglog n for n digits. Multiplication, and, more generally, algebraic functions are T1. Confluent hypergeometric series are T2, and (p+1)Fp are T3. Then Gene ruined everything by finding the T2 AGM method for π. --rwg Subj: Re: [math-fun] sqrt(pi) Date: 2013-03-24 02:10 2013-03-24 02:10 The slower converging "half" of this formula is the [w,oo) integral, w^z/(E^w*Gamma[z, w]) == MProd[MatrixForm[{{-1 + 2*n + w - z, n*(-n + z)}, {1, 0}}], {n, 1, Infinity}] where MProd is matrix product, and the matrices a1 b1 . a2 b2 . . . 1 0 1 0 compute the continued fraction a1+b1/(a2+b2/(... . Unfortunately, this K quadratic/linear is not a special case of the path invariant system at the bottom of p13 of http://www.tweedledum.com/rwg/stanfordn3.pdf, so I couldn't accelerate it. Finally, I found the {n,j} pair n: {{a + j + 2 n, -n (j + n)}, {1, 0}}, j: {{-a - n, (-1 + n) (j + n)}, {-1, j + n}} but the first few contours proved disappointing, so I sought a third dimension k. Usually this would be no easier (nor likelier to happen) than dredging up the original j matrix, but I found a cheap trick which seems too good to be true (and probably is, in most cases): The system is free of k, so the k matrix is obviously {1,0;0,1} : In[330]:= updatemat[k, IdentityMatrix[2]] Out[330]= {{n, {{a + j + 2 n, -n (j + n)}, {1, 0}}}, {k, {{1, 0}, {0, 1}}}, {j, {{-a - n, (-1 + n) (j + n)}, {-1, j + n}}}} Then In[331]:= recoord[n -> n + k] Out[331]= {{n, {{a + j + 2 (k + n), -(k + n) (j + k + n)}, {1, 0}}}, {k, {{a + j + 2 (k + n), -(k + n) (j + k + n)}, {1, 0}}}, {j, {{-a - k - n, (-1 + k + n) (j + k + n)}, {-1, j + k + n}}}} making the k matrix the same as the n matrix. Then In[332]:= recoord[j -> j - k] Out[332]= {{n, {{a + j + k + 2 n, -(j + n) (k + n)}, {1, 0}}}, {k, {{-((a + j + n)/(1 + a)), ((-1 + j + n) (k + n))/(1 + a)}, {-(1/(1 + a)), (k + n)/(1 + a)}}}, {j, {{-a - k - n, (j + n) (-1 + k + n)}, {-1, j + n}}}} Now the n matrix is symmetric in j and k, so k is highly legitimate! But why aren't the j and k matrices analogous? They are, but all the elements of k are divided by 1+a. Scaling the whole matrix (even by a function of k) is irrelevant to path invariance, so In[333]:= updatemat[k, (1 + a)*mats[k]] Out[333]= {{n, {{a + j + k + 2 n, -(j + n) (k + n)}, {1, 0}}}, {k, {{-a - j - n, (-1 + j + n) (k + n)}, {-1, k + n}}}, {j, {{-a - k - n, (j + n) (-1 + k + n)}, {-1, j + n}}}} In[334]:= picheck[%] Out[334]= True (Path invariance check.) This matrix functions package is from Corey Ziegler Hunts. Early results from these {j,k,n} matrices are inconclusive. I'm hitting a lot of numerical instability, which seems inherent: When a CF matrix a b c d converges, a/c approaches b/d. And thus the matrix approaches singularity. --rwg On Tue, Aug 3, 2010 at 4:09 PM, Bill Gosper <billgosper@gmail.com> wrote: Pairwise combining the terms of A&S 6.5.31 (upper Gamma CF), then adding last week's lower gamma CF: In[185]:= Equal[Gamma[ z], ((y^z*((1/(cfk[n*(z - n), -z + y + 2*n + 1, List[n, Infinity]] - z + y + 1)) + (1/(z + cfk[n*y, z - y + n, List[n, Infinity]] - y))))/(E^y))] z 1 Gamma[z] == (y (------------------------------------------- + -y + z + cfk[n y, n - y + z, {n, Infinity}] 1 y -----------------------------------------------------------)) / E 1 + y - z + cfk[n (-n + z), 1 + 2 n + y - z, {n, Infinity}] where cfk:=ContinuedFractionK and y>0 can be chosen to optimize convergence. Specializing, In[186]:= % /. z -> 1/2 /. y -> 1 Out[186]= 1 Sqrt[Pi] == (-------------------------------------- + 1 1 -(-) + cfk[n, -(-) + n, {n, Infinity}] 2 2 1 ------------------------------------------) / E 3 1 3 - + cfk[(- - n) n, - + 2 n, {n, Infinity}] 2 2 2 In[192]:= N[List @@ %186 /. cfk[num_, den_, _] :> ContinuedFractionK[num, den, {n, 9}]] Out[192]= {1.77245, 1.77244} This is the first non-asymptotic sum or CF I've seen for sqrt(pi). But the sum behind the lowergamma cf has been there all along, so I must not have been paying attention. --rwg
participants (1)
-
Bill Gosper