(35S) spigot algorithm for the digits of PI - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (35S) spigot algorithm for the digits of PI (/thread-4025.html) |
(35S) spigot algorithm for the digits of PI - Thomas Klemm - 05-30-2015 05:03 PM 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 C-program from: Pi Unleashed. Jörg Arndt, Christoph Hänel Rediscovered in: A Sigma Function in the 35s Solver! RE: (HP-35s) spigot algorithm for the digits of \(\pi\) - Steve Simpkin - 05-30-2015 09:33 PM 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. RE: (HP-35s) spigot algorithm for the digits of \(\pi\) - Thomas Klemm - 05-31-2015 03:11 AM 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 GTO-commands still point to the correct lines after changing the program. RE: (HP-35s) spigot algorithm for the digits of \(\pi\) - Thomas Klemm - 05-31-2015 03:39 AM (05-30-2015 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 RE: (HP-35s) spigot algorithm for the digits of \(\pi\) - pbnelson - 03-24-2017 10:25 PM 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. |