For the ones who still cherish the good old HP-28S after all those years :-)
Not at all optimized, but it runs reasonably fast. Please test for yourself the range where it is accurate enough for your needs.
Riemann's Zeta Function (HP-28S)
|
|
« Next Oldest | Next Newest »
|
▼
01-25-2013, 09:28 PM
For the ones who still cherish the good old HP-28S after all those years :-) Not at all optimized, but it runs reasonably fast. Please test for yourself the range where it is accurate enough for your needs.
▼
01-28-2013, 06:48 PM
Thanks. Big Fan both of the Zeta function and the 28S, which was the first HP calculator I ever owned (then sold for a pittance, then wonderfully re-acquired perchance from Julian of Spain via this Forum). Eduardo ▼
01-28-2013, 07:25 PM
The HP-28S was my second HP calculator, replacing a HP-15C (now I have both back, the HP-15C being my original one).
There is an older HP-28S version here: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv021.cgi?read=235199 Best regards, Gerson.
01-28-2013, 07:38 PM
On my 28S now :-)
▼
01-28-2013, 08:14 PM
The Gamma function program gives 6 or 7 digits of accuracy for x = 2 and 11 for x = 4 and greater (positive arguments only). I used the approximation involving the sinh(x) function in Viktor Toth's page. Additional correction terms were obtained by comparing the sinh(x) expansion with this series: series[e^(2*(1/(12*x^2)-1/(360x^4)+1/(1260*x^6)-1/(1680*x^8)+1/(1188*x^10)-691/(360360*x^12)+1/(156*x^14)-3617/(122400*x^16)+43867/(244188*x^18)-174611/(125400*x^20)+77683/(5796*x^22)))] Gerson.
01-29-2013, 02:21 AM
A question to the RPL users: why do people use lower case for local variables? - Pauli ▼
01-29-2013, 08:37 AM
Quoting from the HP-28S Owner's Manual, page 80: ---------------------------------------------------------------- It's useful to follow some convention to distinguish your local variables from your ordinary or "global" variables. This manual uses lower-case letters to distinguish local variables. ---------------------------------------------------------------- Gerson.
01-29-2013, 09:28 PM
Here are the listings, in case the picture becomes unavailable: -------------------------------------------------
Edited: 29 Jan 2013, 9:39 p.m. ▼
02-03-2013, 03:23 PM
Because of finite precision -- sine(x*pi/2) never evaluates to zero for even x as expected -- the program doesn't return the trivial zeroes properly. For instance, Zeta( -2.000) --> 4.00788420477E-15In order to prevent this from happening, insert this optional patch between SIN and 2, in the main program:
...Example: Zeta(-59.999) --> 5.33788222631E30 Also, in order to avoid wrong answers due to underflow and overflow, make sure flags 57 and 58 (-20 and -21 on the HP-48) are set. |