Re: Internal Computation of Cumulative Distributions Message #13 Posted by Rodger Rosenbaum on 22 June 2006, 10:47 p.m., in response to message #11 by Les Wright
I tweaked the Hastings formula, 26.2.19, adding two more terms and changing the final exponent. This augmented version has about two orders of magnitude lower error (1.5E9). The parameters are:
d1 = .066490394
d2 = .028736092
d3 = .0048418539
d4 = .00021102572
d5 = 8.6356160E5
d6 = 1.6802053E5
d7 = 2.2584744E6
d8 = 4.2881737E7
The full expression for Q(x) is:
Q(x)=.5*(1+d1*x+d2*x^2+d3*x^3+d4*x^4+d5*x^5+d6*x^6+d7*x^7+d8*x^8)^12
This formula is optimized for the range 1 < x < 7. I was able to get better accuracy from the extra 2 terms if I didn't go down to x=0, but rather only down to x=1.
Formula 26.2.11 seems to be the best one for low values of x. I found that 9 terms of 26.2.11 will give 10 digit accuracy, and 11 terms will give 13 digits of accuracy for 0 <= x <= 1.
Formula 26.2.12 works best for large values of x. In fact, if you examine this formula, you will see that as x becomes very large, the series approaches 1, and Z(x)/x approaches Q(x). However, this formula doesn't work well for small values of x. When x is small, the series part diverges as you add more terms. I find that 22 terms will give 11 digit accuracy for x > 7, and for x = 47, it gives 47 digit accuracy (strictly coincidental).
So, the thing to do (so far) would be to use the 9term 26.2.11 for the range 0 <= x <= 1, the augmented 26.2.19 for 1 < x < 7, and the 22term 26.2.12 for 7 < x.
Is your email address as given here in the forum info correct? I should email you some pix.
