Accord.Math.Special.Erf C# (CSharp) Method

Erf() public static method

Error function of the specified value.
public static Erf ( double x ) : double
x double
return double
        public static double Erf(double x)
        {
            double y, z;

            if (System.Math.Abs(x) > 1.0)
                return (1.0 - Erfc(x));

            z = x * x;
            y = x * Polevl(z, erfc_T, 4) / P1evl(z, erfc_U, 5);

            return y;
        }

Usage Example

Example #1
0
 /// <summary>
 ///   Normal cumulative distribution function.
 /// </summary>
 ///
 /// <returns>
 ///   The area under the Gaussian p.d.f. integrated
 ///   from minus infinity to the given value.
 /// </returns>
 ///
 public static double Function(double value)
 {
     return(0.5 + 0.5 * Special.Erf(value / Constants.Sqrt2));
 }
All Usage Examples Of Accord.Math.Special::Erf