Re: HP71b  what to look for when buying Message #20 Posted by Gerson W. Barbosa on 16 Feb 2013, 4:33 a.m., in response to message #19 by Thomas Klemm
Hello Thomas,
Quote:
Gerson, thanks for reminding me of this
Short & Sweet Math Challenge #19
. It made me look at the various solutions and I wondered what I was doing then:
Same here. I've decided to write an RPL version for A starting from scratch:
%%HP: T(3)A(D)F(,);
DIR
FISCHER
\<< 10, DUP LN * \Gb NEG 2, 11,
FOR n DUP n GET n NEG ALOG * n Zeta * ROT + SWAP
NEXT DROP
\>>
\Gb
\<< { 10, } 2, 11,
FOR n 0, SWAP n 2,
FOR k n k COMB n k  1, + ALOG k ALOG  1, + * SWAP DUP n k  1, + GET ROT * ROT + SWAP 1,
STEP n DUP ALOG 9,  * ROT NEG 11, n ^ n ALOG  10, * + SWAP / +
NEXT
\>>
Zeta
\<< 1,  DUP 1, SWAP PSI SWAP ! / DUP SIGN *
\>>
END
<< FISCHER >> TEVAL > 22,9206766192
s:4,7817
Considering Valentin's HP71B program finds this answer in about 20 seconds this HP 50g program is somewhat slow. The beta subprogram alone takes about 2 seconds, perhaps an optimization attempt should start here.
The program is just an implementation of the formula in page 2 of Thomas Schmelzer and Robert Baillie's paper:
http://eprints.maths.ox.ac.uk/1106/1/NA0617.pdf
I have no idea why this formula works, however.
Cheers,
Gerson.
