Re: Error function 35s vs. 32SII Message #5 Posted by Les Wright on 31 July 2007, 12:48 p.m., in response to message #4 by Les Wright
Thomas, here is my offering. The reference is formula 7.1.6 of Abramowitz and Stegun, whereas you seem to use 7.1.5. The idea of each term being a recursion on the prior term I get from the Numerical Recipes code for the series computation of the incomplete gamma function.
(E001) LBL E
STO T
STO S
x^2
STO Z
1
STO D
RCL S
(E009) STO O
2
STO+ D
RCL Z
STO* T
2
STO* T
RCL D
STO/ T
RCL T
STO+ S
RCL O
RCL S
x#y?
GTO E009
RCL Z
+/
e^x
*
2
*
PI
SQRT
/
(E033) RTN
5 XEQ E ENTER returns 1.00000000002 in a few seconds (certainly no more than 10), whereas the actual 12digit result should be 9.99999999998e1. This should come as no surpriserounding error is bound to crop up. For input greater than about 1.8, one should compute erfc by the continued fraction and get erf as the complement (erf(z) = 1  erfc(z))
But for smaller arguments, the above does very wellerf(1) is computed swiftly as 0.84270079295, which is completely accurate. erf(0.1) is even faster, giving 1.12462916019e1 (the last digit should be an 8).
I guess what caught my attention is that I knew one could compute these series faster on the 33S and 32sii than what you were reporting. I must confess that the comparative sluggishness of the 35S (though still much faster than the 41 series, the 11C, the 15C, the Spice series, and even the 42S) is a disappointment. I love the speed of the 33S, despite its foibles, and really hoped this would port to the 35s intact. Alas, that hasn't happened.
I may port my continued fraction code for the incomplete gamma function, modified for the special case of erfc, and post it later if anyone is interested.
Les
Edited: 31 July 2007, 12:49 p.m.
