public static double NormalCdf(double x, double mean, double variance)
        {
            double centered = x - mean;
            double ztrans   = centered / (Math.Sqrt(variance) * Math.Sqrt(2));

            return(0.5 * (1 + ProbabilityFunctions.Erf(ztrans)));
        }
 public static double StdNormalCdf(double x)
 {
     return(0.5 * (1 + ProbabilityFunctions.Erf(x * 1 / Math.Sqrt(2))));
 }