(HP65) Factorial and Gamma Function
|
10-26-2017, 06:59 AM
(This post was last modified: 10-26-2017 05:42 PM by Dieter.)
Post: #10
|
|||
|
|||
RE: (HP65) Factorial and Gamma Function
(10-25-2017 04:06 PM)peacecalc Wrote: thank you for your answers. Twenty-five years ago I wrote a "turbo-pascal" program for the gamma-fct with real arguments. Ah, yes, Turbo Pascal – I loved it. (10-25-2017 04:06 PM)peacecalc Wrote: I remember this, I also used for large arguments the stirling approx (x>10) as a example for coprozesser programming. But for smaller arguments I used the method described above (divsion by integer values). For negative number I used the formula: (...) Great. Here is an HP67/97 version that applies the same formula, modified for x! instead of Gamma. Also the sin(pi*x) part is calculated in a special way to avoid roundoff errors for multiples of pi, especially if x is large. Edit: code has been replaced with a slightly improved version Code: LBL e Initialize with f [e]. –3,6 [E] => –0,888685714 –4,6 [E] => 0,246857143 Edit: If you don't mind one more second execution time, here is a version with the constants directly in the code. Except R0 no other data registers are used, and an initialisation routine is not required either. Code: LBL E Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 5 Guest(s)