dotnet/AbramowitzStegun.cs
/// <summary>
/// This is an approximation by Abramowitz and Stegun.
/// See 26.2.23 at http://people.math.sfu.ca/~cbm/aands/page_933.htm
/// </summary>
/// <param name="p">
/// Input probability (rectangular). Must be greater than 0 (to avoid
/// infinity in the calculation) and less than or equal to 0.5
/// </param>
/// <returns>
/// A rational approximation for x where Q(x)=p and Q is the
/// complementary cumulative distribution function for a standard
/// normal distribution.
/// </returns>
This is an approximation by Abramowitz and Stegun.
This is an approximation by Abramowitz and Stegun .
private static double Approximation(double p)
        {
            double t = Math.Sqrt(-2.0 * Math.Log(p));
            double tt = t * t;
            double ttt = tt * t;
            return t - ((c0 + c1 * t + c2 * tt) / (1 + d1 * t + d2 * tt + d3 * ttt));
        }
private static double Approximation ( double p ) { double t = Math . Sqrt ( - 2.0 * Math . Log ( p ) ) ; double tt = t * t ; double ttt = tt * t ; return t - ( ( c0 + c1 * t + c2 * tt ) / ( 1 + d1 * t + d2 * tt + d3 * ttt ) ) ; }
This is an approximation by Abramowitz and Stegun.
This is an approximation by Abramowitz and Stegun .
//double t = Math.Sqrt(Math.Log(1.0 / (p * p)));
A rational approximation for x where Q(x)=p and Q is the
complementary cumulative distribution function for a standard
normal distribution.
A rational approximation for x where Q ( x ) = p and Q is the complementary cumulative distribution function for a standard normal distribution .
p
double
Input probability (rectangular). Must be greater than 0 (to avoid
infinity in the calculation) and less than or equal to 0.5
Input probability ( rectangular ) . Must be greater than 0 ( to avoid infinity in the calculation ) and less than or equal to 0 . 5