### How an HP-27 computes N.D.

Posted:

**Sun Sep 13, 2020 3:44 pm**The trace feature of a well known system running almost all classical HP calculators virtually (look for 'Free Downloads' at http://teenix.org/) enabled me to easily find out the procedure how an HP-27 computes "N.D." (Normal Distribution). It uses from Abramowitz and Stegun (further on "A&S") formula 26.2.17, constants b3..b5 rounded to nine digits, respecting the area of validity mentioned there, also 26.2.1, 26.2.5, and 26.2.6. The formula is evaluated using Horner's method but rounding intermediate results to ten digits.

Plotting e(x), the difference to (1-erf(x/sqrt(2)))/2, once with the a. m. roundings and restrictions and again with all constants as given in A&S and computing with 25 digits precision show apparently identical diagrams.

One more word about using A&S. It is favourable to pay attention to the area of validity. A bad example here (just for fun run the routine with input x = -100000/47047). It is A&S formula 7.1.25 which is not applicable for x<0. The author of the routine once posted it in the general section of MoHPC forum and some jester moderator moved it to 'HP Software Libraries' what smells like "approved" alas with [x_out]incorrect formula and[/x_out] (meanwhile the typo is corrected silently) incomplete routine. Although filed in a somewhat seriously looking library, the quality of few contributions could be quite doubtful. It seems there is neither an admin, nor moderator nor an interested community any more willing to take the role as lector.

Edit: a pettily rectification.

Plotting e(x), the difference to (1-erf(x/sqrt(2)))/2, once with the a. m. roundings and restrictions and again with all constants as given in A&S and computing with 25 digits precision show apparently identical diagrams.

One more word about using A&S. It is favourable to pay attention to the area of validity. A bad example here (just for fun run the routine with input x = -100000/47047). It is A&S formula 7.1.25 which is not applicable for x<0. The author of the routine once posted it in the general section of MoHPC forum and some jester moderator moved it to 'HP Software Libraries' what smells like "approved" alas with [x_out]incorrect formula and[/x_out] (meanwhile the typo is corrected silently) incomplete routine. Although filed in a somewhat seriously looking library, the quality of few contributions could be quite doubtful. It seems there is neither an admin, nor moderator nor an interested community any more willing to take the role as lector.

Edit: a pettily rectification.