Julian has found that a convergence estimator I reported last year is less accurate than I thought, but hardly useless. With his correction, I just found a surprise in the convergence rate of the slower CF in the Γ formula below. For this quadratic/linear with z:=1/2, the formula predicts an error proportional to E^(-4 √(n y)). While this is asymptotically 0 bits/term, it is enormously better than any (q+1)Fq[1], whose error after n terms is 1/polynomial(n). Roughly speaking, instead of 10^n terms, we need only n^2. And note the surprising sensitivity to the free parameter y, a presumably small, fixed number added to the growing variable 2n. In fact, the formula predicts nonconvergence for y=0. It's almost right. Another oddity: simply changing the sign of the CF numerators, i.e. cfk[n*(n - z), -z + y + 2*n + 1,{n,∞}], almost completely desensitizes to y the convergence. The formula says the second, faster CF converges like y^(-1 + n)/(-1 + n)! Note that, unlike the first cf, this error increases with y. Suppose we are willing to compute 69 terms of each CF. Equating the two error terms and solving, Mathematica gave an exact large Lambert-W expression, approximately y=7.1, yielding about 36 digits of √π. At "0 bits/term"! But this remains a non-competitive Γ method unless we find a (presumably matrix) speedup of the siower CF. --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
Traffic signs can lie. I saw one that said No turn on red, and then the red turned on.