Gamma function using Spouge Approximation - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: HP-65/67/97 Software Library (/forum-12.html) +--- Thread: Gamma function using Spouge Approximation (/thread-149.html) |
Gamma function using Spouge Approximation - Namir - 12-18-2013 06:00 AM HP-67 Implementation Memory Map R0 = x and = x-1 R1 = a R2 = CHS R3 = Sum R4 = Integer part of I, x+a R5 = sqrt(2*pi) RI = I Listiing Code: 1 LBL A RE: Gamma function using Spouge Approximation - Willy R. Kunz - 06-08-2014 03:45 PM Hi Namir, thanks for sharing this program. I pasted it into my RPN-97 emulator on the iPad and it works just fine, but only if step 68 is changed to a division. RE: Gamma function using Spouge Approximation - Namir - 06-13-2014 12:35 PM Thanks for your correction Willy. I corrected step 68 as you suggested. Also thanks for fantastic HP-67/97 emulators for the iPad! Namir RE: Gamma function using Spouge Approximation - Willy R. Kunz - 06-13-2014 09:57 PM (06-13-2014 12:35 PM)Namir Wrote: Thanks for your correction Willy. I corrected step 68 as you suggested. Thank you for the kudos. BTW, your sometimes "unorthodox" listings caused me quite a bit of headache while implementing the new source code translation capability of the emulators. But finally things are coming together. So Code:
Code:
Code:
Code:
In fact, you may even enter Code:
Code:
RE: Gamma function using Spouge Approximation - bshoring - 03-21-2015 03:26 AM Thanks Namir, for this program. I ran several samples and got a high degree of accuracy for the Gamma function. Regards, Bob RE: Gamma function using Spouge Approximation - bshoring - 04-07-2015 09:43 PM So far I am finding this program yields correct results for any positive number up to 55. For negative numbers (non-integer) I have gotten correct results on all the ones I have tried so far. I have also modified the program somewhat to work on my HP-38C as well as the iOS emulator for HP-25 (GO-25 SciRPN) which has a capacity of 99 program steps. The latter was more of a challenge as the HP-25 has no factorial or ISZ functions so those have to be re-created using additional program steps. Regards, Bob |