public static double Erf(double x) { double y, z; if (Math.Abs(x) > 1.0) return (1.0 - Erfc(x)); z = x*x; y = x*polevl(z, ERF_T, 4)/p1evl(z, ERF_U, 5); return y; }