Post Reply 
Gerson's Pi Program
12-29-2020, 12:53 PM (This post was last modified: 12-29-2020 12:53 PM by Gerson W. Barbosa.)
Post: #5
RE: Gerson's Pi Program
(12-29-2020 09:15 AM)EdS2 Wrote:  Thanks! I will surely have seen that post before, but evidently failed to recognise the approach. I think I might blame my ever-increasing age.

My pleasure! Time goes forward for us all. I have to update my avatar so that it reflects my current age, but I don't remember how I did that twenty years ago.

Actually, this is the post where I first presented that formula, along with an explanation how I found it (not a proof, though).

https://www.hpmuseum.org/forum/post-1345...#pid134502

It appears to produce 25*n/12 correct digits (I have tested the algorithm to 1000 digits only).

The previous program is optimized for speed as it avoids two extra multiplications per iteration. For the few digits provided by most computer languages, it should be better to use this even more compact program:

Code:

10 INPUT N
15 C=0
20 D=8*N+4
25 W=2
30 FOR I=N TO 1 STEP -1
35 T=4*I*I-1
40 W=W+W/T
45 C=T/(C+D)
50 NEXT I
55 PRINT W*(2/(C+D-1)+1)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Gerson's Pi Program - EdS2 - 12-28-2020, 11:20 AM
RE: Gerson's Pi Program - Allen - 12-28-2020, 01:15 PM
RE: Gerson's Pi Program - EdS2 - 12-29-2020, 09:15 AM
RE: Gerson's Pi Program - Gerson W. Barbosa - 12-29-2020 12:53 PM
RE: Gerson's Pi Program - EdS2 - 03-01-2022, 09:39 AM
RE: Gerson's Pi Program - EdS2 - 03-02-2022, 11:17 AM
RE: Gerson's Pi Program - EdS2 - 03-04-2022, 04:50 PM
RE: Gerson's Pi Program - Valentin Albillo - 03-08-2022, 05:42 PM
RE: Gerson's Pi Program - EdS2 - 03-10-2022, 07:47 AM
RE: Gerson's Pi Program - Valentin Albillo - 03-10-2022, 11:48 AM
RE: Gerson's Pi Program - Ángel Martin - 03-09-2022, 08:12 AM
RE: Gerson's Pi Program - EdS2 - 03-11-2022, 12:42 PM
RE: Gerson's Pi Program - EdS2 - 03-15-2022, 07:44 AM



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