This subject was dealt with the year 2004 by Gene Wright (HP Forum Archives 14). As a newcomer, I only now have noticed the archive. It is said there that there are two programs to compute many digits of pi with the TI-95 calculator, one by Hewlet Ladd (1987) and another by Palmer Hanson (2004). Some members asked then for the Hanson listing, but he answered that was not ready to type the 750 steps by hand, and that he would send an attached copy of the printed listing if the interested people supply him his e-mail address. Well, I would like also to have this listing and that by Hewlet Ladd. Can anyone supply these listings?. In the same archive is a post by Gordon Dyer showing a program to compute pi on a HP-42. However, the program gives only 11 digits. Does anyone know a similar program for the same calculator but computing as many digits as possible? Does anyone know a similar arbitrary precisión program to compute many digits of pi on any calculator (HP or other brands) using only the Machin arctangent formula (pi = 16/arctg (5) - 4/arctg (239))? Many thanks in advance
Computing many digits of Pi
|
|
« Next Oldest | Next Newest »
|
▼ ▼
Post: #3
09-11-2007, 08:52 AM
Katie Wasserman used the formula: ▼
Post: #4
09-11-2007, 09:54 PM
The program for the 32Sii needs some modification in order to extend it for many more registers. The 9 digits/register was necessary to avoid overflows when just 99 digits are computed. You'll probably need to cut back to 6 digits/register if you're going put this on the 35s and try for 10000+ digits. More to the point, the run time goes up roughly as the square of the number of digits and the 35s isn't much faster than the 32sii so it's going to take.... let's see..... 11 (minutes for around 100 digits) * 9/6 (number of digits per register correction * 100^2 (100 times more digits that go as the square) = ...... pretty close to forever! The 35s just isn't fast enough to do much useful calculation with all those registers. Even a good (NlogN) sorting routine would likely take longer than anyone would want to wait. -Katie
▼
Post: #5
09-12-2007, 08:38 AM
Many thanks Katie Of course, you are right. Your program is a little wonder, but I know that to compute over a few thousands of digits on any calculator a long job if using classical algorithms linked to trigonometric formulas. I am not sure if the translation to other calculators deserves trying. Thanks anyway
Post: #6
09-12-2007, 09:32 PM
Quote:I did not realize this about the technique you implemented on the 32sII. I guess I should have studied it a bit before flippantly postulating about computing 20,000+ digits on the 35s. (I probably should have realized. After all, if calculating pi was easy, it would not have worked as an effective method to drive a malevolent entity from the computer of the Enterprise. I sure hope that Spock was the only one authorized to instruct the computer to use all resources, to the exlusion of all other processes if I recall correctly, for a particular task.) ▼
Post: #7
09-14-2007, 09:47 AM
There are methods for computing pi that converge quadratically, of course they are also grow linearly with the number of digits required. So, they're ultimate convergence is N*Log(N). I'm not sure if Spock was aware of these methods when he issued his command, but he still would have gotten his intended result -- to be expected from "the best first officer in the fleet" to quote Dr. McCoy.
Post: #8
09-12-2007, 08:24 AM
Many thanks. Katie's program is wonderful given the small amount of memory of the HP-32. I will try to translate it to TI-95. However, it does not use the Machin's formula, but one of the many related ones.
Post: #9
09-11-2007, 09:00 AM
Ola, Juan; ¿que tal? I'd sugget trying these threads (in addition to Jeff´s):
Yet another not quite pi puzzle I guess you may find what you need. Cheers. Luiz (Brazil)
Edited: 11 Sept 2007, 9:06 a.m. ▼
Post: #10
09-12-2007, 08:29 AM
Muito obrigado, Luiz Juan Pablo
Post: #11
09-11-2007, 10:00 AM
Here's some more interesting forum message links for calculating PI on both the HP-41 and the HP-42: Have Fun, Bill ▼
Post: #12
09-12-2007, 08:40 AM
Many thanks, Bill The links are very useful. I am astonished of the cleverness of the deep.pi program. It would be nice to know used
Post: #13
09-11-2007, 05:19 PM
Hi Juan Pablo! The following vintage program in french gives 128 digits of PI:
Que j'aime à faire apprendre ce nombre utile aux sages ! 3 1 4 1 5 9 2 6 5 3 5 It should run in less one minute on a well trained brain :-)) Cheers. Etienne ▼
Post: #14
09-12-2007, 08:47 AM
You are right, Etienne. This is perhaps the fastest algorithm, but it is rather difficult to implement it in a calculator. I knew already the poem by heart, but only the first lines, about 60 digits. There is plenty of similar texts in different languages, helping to memorize even 1000 digits of pi. Of course, there is still a faster algorithm, to look at the many existing printed values, to look in the web for any of the several pi pages, or to use any of the available multiprecision programs, either Derive, Maple, Mathematica, etc. However, none of these ways has much to do with calculators.
Post: #15
09-12-2007, 03:58 PM
I have a pasteup available for my 2004 program for the TI-95. It is a conversion of the TI-59 program by Bob Fruit which appeared in V7N4/5P27 ff of TI PPC Notes. Since you keep your e-mail address private you will have to send your address to me at pohmwh@earthlink.net if you want a copy. I haven't figured out how to attach anything to the secure communication through the museum. I have not found a pasteup of the Hewlett Ladd program for the TI-95. It is a convwersion of the Science et Vie program for the TI-59 which appeared in V8N3P8-9 of TI PPC Notes. For a translation of the Science et Vie article go to V8N4P21-24 of TI PPC Notes. ▼
Post: #16
09-12-2007, 05:05 PM
It would be nice, If you can send me the TI-95 version too. Thank you.
Post: #17
09-13-2007, 04:49 AM
Many, many thanks! Finally I managed to contact you. I did not realize that my e-mail address was kept private. Here is it: jpmr...ipe.csic.es (with the @ sign instead the dots). I would be very grateful if you send me the paste. Besides several HP calculators I still own and use an old TI95. I wonder if your program could be changed to allow the use of either supplementary memory modules up to 32 K or even data recorded in magnetic tape. Thanks again ▼
Post: #18
09-13-2007, 09:14 AM
I have the 2004 program in an 8K RAM module. I don't think I ever had it on tape since my tape reader isn't working. I sort of remember having the Hewlett Ladd program on tape but I haven't been able to find it. It is not on a RAM module. I have found a reference in which Hewlett indicated that his program was a translation of a TI-59 program from V8N4P26 of TI PPC Notes, that it was only 296 bytes and would calculate up to 1573 digits.
Post: #19
09-18-2007, 10:35 PM
Using the Spigot Algorithm from Pi Unleashed + HPGCC I can compute 15000 digits of PI in 412 seconds on my 50g. If you are interested I can send you the binary so that you do not need to compile and install the ARM Toolbox. NOTE: Real 50g/49g+ required.
To use: 15000 pidfOutput to stack: bytes used: 210056SD card will have file PIDIGITS.TXT with the output formatted with 32 digits/line, recall to stack with: 3:PIDIGITS.TXT RCLUp Arrow VIEW to see all digits.
NOTE: HPGCC binaries can be large. Best to store on SD card and run with: 3:pidf EVALPut that in a small UserRPL script and save to main memory.
You can hold down any key (but ON) to stop the run and collect partial output. When done exit with ON. /*
Edited: 24 Sept 2007, 11:37 a.m. after one or more responses were posted ▼
Post: #20
09-19-2007, 08:02 AM
I have a xerox of an old paper about the computation of Pi, titled "Some Comments on a NORC Computation of Pi". I think the paper dates from around 1956. The authors say in the first paragraph: "Among the problems suggested as demonstration routines for the NORC (Naval Ordnance Research Computer) was the calculation of Pi to a large number of digits. In 1949, Pi was calculated to 2035 digits on the ENIAC. The present computation on the NORC, which was carried out by the authors at the Watson Scientific Computing Laboratory, produced 3089 digits. This limit was chosen since the entire calculation could be contained in the NORC's high speed memory (2000 locations). The program was designed to produce any number of digits up to this limit." They say that the computation took 13 minutes. I wonder what kind of memory the NORC had? All of "2000 locations". And how much power was consumed during the computation? In 2007, using the power provided by a few penlight cells, Pi can be computed to 15,000 digits in about 7 minutes. On a pocket sized computer with over 200,000 memory "locations"! Mathematica keeps the first 10,000 digits of Pi pre-calculated and stored in memory. So if a calculation needs up to 10,000 digits, there's no delay in calculating them; they're just fetched from memory. If more digits are needed, they're calculated using the Chudnovsky formula. On my laptop, Mathematica takes 3.5 seconds to calculate 1,000,000 digits of Pi, and 58 seconds to calculate 10,000,000 digits. And, no doubt, using far less power than the ENIAC or NORC did. This is progress. ▼
Post: #21
09-19-2007, 09:38 AM
The Spigot method isn't the fastest. But it is small, does not require MP or FP math (integers only), and you get to watch the action. If I have time I'll try out Chudnovsky.
Post: #22
09-24-2007, 04:11 AM
Many thanks for your advice. Do you know if the program can be run also in a HP-49g?(not a HP-49g+) Juan Pablo ▼
Post: #23
09-24-2007, 10:58 AM
AFAIK, the 49g uses the Saturn CPU. You need an ARM-based unit (49g+/50g). |