utiliser le système ;
espace de noms Legalsoft.Truffer
{ public class Normaldist : Erf { private double mu { get; ensemble; } double signature privée { obtenir ; ensemble; }
public Normaldist(double mmu = 0.0, double ssig = 1.0)
{ this.mu = mmu; this.sig = ssig; if (sig <= 0.0) { throw new Exception("bad sig in Normaldist"); } }
public double p(double x)
{ return (0.398942280401432678 / sig) * Math.Exp(-0.5 * Globals.SQR((x - mu) / sig)); }
public double cdf(double x)
{ return 0.5 * erfc(-0.707106781186547524 * (x - mu) / sig); }
public double invcdf(double p)
{ if (p <= 0.0 || p >= 1.0) { throw new Exception("bad p in Normaldist"); } return -1.41421356237309505 * sig * inverfc(2.0 * p) + mu ; } } }