Originally Posted by

**SlideRule**
I forgot to add that there is a rational expression approximation to the cdf of the standard normal distribution.

/////////////////////////////////////////////////////////////////////

//

// Approximate Standard Normal Cummulative Distribution Formula.

//

// The absolute error of this approximation is less than

// 2.5E-4 for z greater than or equal to zero.

//

// Take from Probability, by Pitman, page 95. Originally from

// Handbook of Mathematical Functions by Abramowitz and Stegun.

//

// z = (x - mu)/sigma

//

////////////////////////////////////////////////////////////////////

//

#include <math.h>

double cdf(register double z)

{

if (z < 0) return 1-cdf(-1*z);

register double p1 = 1.0+(0.196854+(0.115194+(0.000344+0.019527*z)*z)*z)*z;

register double p2 = 1.0 / (2.0*p1*p1*p1*p1);

register double p3 = 1.0 - p2;

return p3;

} // end cdf