|Origins of HP41 numerical routines ot compute statistical distributions|
Message #1 Posted by Les Wright on 8 May 2006, 1:07 p.m.
This is more of a theoretical question.
In the Stat Pac module there is a routine, SigmaNormd, that computes a number of features relevant to the standard normal distribution--i.e., actual value of the density function for a given z, upper-tail prob of given z, z of a given upper tail probability.
On inspecting the code, it looks like the probability density function is approximated algebraically in some way--for example, it looks like there are a number of numeric constants stored in the first few registers on initialization of the routine, and these get recalled later as the relevant estimates are computed. In other words, it doesn't look as though the program works directly with the actual density function (i.e., (1/sqrt(2*Pi))*exp(-z^2/2)).
Does anyone know the origins of this routine? Is it from Numerical Recipes? Is it based on a Taylor series approximation? (As for the latter, I have found on my HP48 that one has to go to a pretty high order in order for the polynomial approximation to maintain accuracy in the upper and lower tails. In emulation this is fast enough, but on the actual calculator its as slow as molasses.)
This is more of a point of curiosity than of great practical relevance, but if anyone knows what the actual formulae used are, and their source, I would be much obliged.