Post Reply 
Yet another π formula
01-10-2021, 02:57 PM (This post was last modified: 01-10-2021 03:12 PM by Gerson W. Barbosa.)
Post: #15
RE: Yet another π formula
Hello, Albert Chan,

(01-09-2021 09:22 PM)Albert Chan Wrote:  First, try n=0, i.e. summation term = 0.
Relied only on limit, convergence rate is bad, but it is indeed approach pi.

>>> from gmpy2 import *
>>> get_context().precision = 1000 # ~ 300 dec. digits
>>> pi = const_pi()
>>> for i in range(7): print i, format(pi - test_pi(n = 0, cf = 10**i), 'g')
...
0  0.297148
1  0.0675375
2  0.00772836
3  0.000784124
4  7.85271e-05
5  7.85385e-06
6  7.85397e-07

I did that about seven years ago ( https://www.hpmuseum.org/forum/post-9194.html#pid9194 ). Then I noticed that optimal result (best approximation using the least number of terms) is obtained when the number of terms of the series is equal to the number of terms of the continued fraction.

ln(2) = 1 - 1/2 + 1/3 - 1/4 + ... + (-1)^(n + 1)/n + 1/((2*n+1) + CF)

CF: numeratorₖ = k*k; denominatorₖ = 2*n + 1; k = 1 to ∞

n = 2
k = 1

ln(2) ~ 1 - 1/2 + (-1)^(1 + 1)/((2*2+1)+1*1/(2*2+1))
~ 9/13
~ 0.69(23076923076923076923076923076923)

n = 2
k = 10^6

ln(2) ~ 0.693147180559945309417232121458(3016)

n = 2
k = 10^7

ln(2) ~ 0.6931471805599453094172321214581766

Here we need 10^7 terms of the continued fraction to correct ln(2) ~ 1/2 to 34 digits. On the other hand we get the same result with n = 22 and k = 22.

Perhaps the correction CF for the Wallis Product is easier to prove, since the equivalent polynomial expressions of the first few terms of the CF match those described in this paper. More details in the beginning of this post.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Yet another π formula - Gerson W. Barbosa - 01-04-2021, 08:41 PM
RE: Yet another π formula - Albert Chan - 01-05-2021, 10:50 PM
RE: Yet another π formula - Albert Chan - 01-06-2021, 01:32 AM
RE: Yet another π formula - Albert Chan - 01-07-2021, 09:56 PM
RE: Yet another π formula - Albert Chan - 11-25-2024, 10:01 PM
RE: Yet another π formula - Albert Chan - Yesterday, 01:32 AM
RE: Yet another π formula - toml_12953 - 01-06-2021, 02:10 AM
RE: Yet another π formula - ttw - 01-06-2021, 03:44 AM
RE: Yet another π formula - Albert Chan - 01-09-2021, 09:22 PM
RE: Yet another π formula - Gerson W. Barbosa - 01-10-2021 02:57 PM
RE: Yet another π formula - Albert Chan - 11-06-2021, 06:28 PM
RE: Yet another π formula - Thomas Klemm - 11-24-2024, 01:59 PM
RE: Yet another π formula - Albert Chan - 11-25-2024, 01:47 PM
RE: Yet another π formula - Albert Chan - Yesterday, 01:28 PM
RE: Yet another π formula - Ren - 11-25-2024, 01:08 AM
RE: Yet another π formula - Thomas Klemm - 11-25-2024, 06:47 PM
RE: Yet another π formula - EdS2 - Yesterday, 02:09 PM
RE: Yet another π formula - Albert Chan - Yesterday, 05:57 PM
RE: Yet another π formula - AnnoyedOne - Yesterday, 02:19 PM
RE: Yet another π formula - C.Ret - Yesterday, 03:42 PM
RE: Yet another π formula - AnnoyedOne - Yesterday, 05:37 PM
RE: Yet another π formula - EdS2 - Today, 09:14 AM



User(s) browsing this thread: 1 Guest(s)