Post Reply 
Stoneham's series
06-08-2024, 05:16 PM
Post: #12
RE: Stoneham's series
(06-08-2024 05:02 AM)Johnh Wrote:  I put it into Free42, similar code that I posted above, with a 'View' line added to monitor the convergence towards Pi. I let it run 30 minutes, by which time it had completed 84 million loops ... stopped it it was at 3.14159266291 and counting down maybe one digit every few seconds in the 11th decimal place, slowing down exponentially

Convergence is slow, similar to Basel problem, error ≈ 1/n
see thread Evaluation of ζ(2) by the definition (sort of) [HP-42S & HP-71B]

(06-07-2024 08:54 PM)Albert Chan Wrote:  Or, we do product backwards, for more accuracy.
Code:
function q(n) -- 1 - product((1-1/b^2), b = n-(n+1)%2 .. 3 step -2)
    local a = 0
    for b=n-(n+1)%2,3,-2 do a = a + (1-a)/(b*b) end
    return a
end

With b going big, (1-a) does not change much.
If we assume (1-a) = 1, product turned into summation.

a = 1/3^2 + 1/5^2 + 1/7^2 + ... + 1/n^2 = (pi^2/8 - 1) if n→∞

Because this only sum odd square reciprocal, error ≈ .5/n

We are using (1-a)*4 for pi estimate, so we expected error ≈ -2/n
Of course (1-a) ≈ pi/4 ≠1 --> my guess is error around (-pi/2)/n

lua> n = 84e6*2+1
lua> (1-q(n)) * 4
3.1415926629397712
lua> _ + (-pi/2)/n
3.141592653589793
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Stoneham's series - ttw - 06-04-2024, 01:31 PM
RE: Stoneham's series - KeithB - 06-04-2024, 02:20 PM
RE: Stoneham's series - Nigel (UK) - 06-04-2024, 03:37 PM
RE: Stoneham's series - Thomas Klemm - 06-04-2024, 03:34 PM
RE: Stoneham's series - Thomas Klemm - 06-04-2024, 07:57 PM
RE: Stoneham's series - Albert Chan - 06-04-2024, 08:44 PM
RE: Stoneham's series - Thomas Klemm - 06-05-2024, 04:20 AM
RE: Stoneham's series - Johnh - 06-07-2024, 07:55 PM
RE: Stoneham's series - Albert Chan - 06-07-2024, 08:54 PM
RE: Stoneham's series - Johnh - 06-08-2024, 03:07 AM
RE: Stoneham's series - Johnh - 06-08-2024, 05:02 AM
RE: Stoneham's series - Albert Chan - 06-08-2024 05:16 PM
RE: Stoneham's series - Gerson W. Barbosa - 06-09-2024, 10:36 PM
RE: Stoneham's series - Albert Chan - 06-11-2024, 05:12 PM
RE: Stoneham's series - Gerson W. Barbosa - 06-12-2024, 07:01 PM
RE: Stoneham's series - Gerson W. Barbosa - 06-14-2024, 05:42 PM
RE: Stoneham's series - Gerson W. Barbosa - 06-18-2024, 05:42 AM
RE: Stoneham's series - Namir - 06-09-2024, 10:55 PM
RE: Stoneham's series - Gerson W. Barbosa - 06-09-2024, 11:04 PM
RE: Stoneham's series - Gerson W. Barbosa - 06-11-2024, 02:31 AM



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