(35S) spigot algorithm for the digits of PI

05302015, 05:03 PM
(This post was last modified: 06152017 01:20 PM by Gene.)
Post: #1




(35S) spigot algorithm for the digits of PI
Program:
Code: P001 LBL P P018 FS? 0 P035 INT÷ Usage: Calculate the first 40 digits of \(\pi\): 3.141592653589793238462643383279502884197 40 XEQ P001 For the next digits to appear just keep hitting the [R/S] button: Code: P= This is a translation of the Cprogram from: Pi Unleashed. Jörg Arndt, Christoph Hänel Rediscovered in: A Sigma Function in the 35s Solver! 

05302015, 09:33 PM
(This post was last modified: 05302015 09:40 PM by Steve Simpkin.)
Post: #2




RE: (HP35s) spigot algorithm for the digits of \(\pi\)
Thanks for the fun program!
A couple of notes: Set display format to ALL for best results. On my HP35s, 40 XEQ P001 takes about 33 seconds to execute. The next press of R/S takes about 26 seconds. The execution time of each subsequent press of R/S gets progressively smaller with about 3 seconds for the final calculation. Do not press R/S after the final calculation. The execution time will be very long. 

05312015, 03:11 AM
Post: #3




RE: (HP35s) spigot algorithm for the digits of \(\pi\)
Instead of 4 digits a time we can display 5 or 6 digits together.
For this the magic numbers have to be adjusted accordingly. 5 digits: Code: P003 5 6 digits: Code: P003 6 Make sure the GTOcommands still point to the correct lines after changing the program. 

05312015, 03:39 AM
Post: #4




RE: (HP35s) spigot algorithm for the digits of \(\pi\)
(05302015 09:33 PM)Steve Simpkin Wrote: The execution time of each subsequent press of R/S gets progressively smaller with about 3 seconds for the final calculation. Quote: The second improvement is really a textbook tip which, however,Pi  Unleashed, p. 83 

03242017, 10:25 PM
Post: #5




RE: (HP35s) spigot algorithm for the digits of \(\pi\)
This was a lot of fun. I used it to compute the first 100 digits of PI in about 15 minutes. It in fact returned 105 digits, the first 103 being correct, and the 104th & 105th digits being wrong (according to Google). I am pretty well flabbergasted that such a small program can give 103 digits of PI correctly in only 15 minutes. Thanks for putting this together.


« Next Oldest  Next Newest »

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