HP-42S (Free42, DM-42) mini-challenge – Wallis Product
|
07-06-2020, 02:31 AM
(This post was last modified: 07-06-2020 03:31 AM by Gerson W. Barbosa.)
Post: #13
|
|||
|
|||
RE: HP-42S (Free42, DM-42) mini-challenge – Wallis Product
The Wallis Product converges very slowly towards \(\frac{\pi}{2}\). J-M Baillard’s program above, which is about 30% faster than mine, takes 173.2 seconds on my HP-42S to run 1000 iterations, giving only two correct decimal digits of \(\pi\): 3.14080774637. Quite disappointing, isn’t it? How long would it take to compute 12 significant digits? As you have figured out by now, 10^d iterations are required for d correct significant digits. How long would it take to return 3.14159265359 on the HP-42S, or to return \(\pi\) to 34 digits +/- a couple of ULPs on your computer or smartphone running Free42? Just do the math and be astounded by the results.
I have a 141-byte, 81-step program that gives 12 digits of \(\pi\) in less than seven seconds on the real HP-42s and 34 digits instantly on my smartphone: 3.141592653589793238462643383279504 (the last digit should be a ‘3’), using the Wallis Product as a basis. These are achieved with only 8 and 24 iterations, respectively. I’ve managed to save a few bytes and steps by shamelessly borrowing part of J-M Baillard’s code. I will publish it here later, if you are interested. Thank you all for your participation, contributions and great insights so far. Gerson. Edited do fix a few typos. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)