Erf { private Erf() {} private  Erf(); static double erf(double x); static double erfc(double x); static double erf(double x1, double x2); static double erfInv(final double x); static double erfcInv(final double x);  }
@Test public void testErfGnu() { final double tol = 1E-15; final double[] gnuValues = new double[] {-1, -1, -1, -1, -1, -1, -1, -1, -0.99999999999999997848, -0.99999999999999264217, -0.99999999999846254017, -0.99999999980338395581, -0.99999998458274209971, -0.9999992569016276586, -0.99997790950300141459, -0.99959304798255504108, -0.99532226501895273415, -0.96610514647531072711, -0.84270079294971486948, -0.52049987781304653809, 0, 0.52049987781304653809, 0.84270079294971486948, 0.96610514647531072711, 0.99532226501895273415, 0.99959304798255504108, 0.99997790950300141459, 0.9999992569016276586, 0.99999998458274209971, 0.99999999980338395581, 0.99999999999846254017, 0.99999999999999264217, 0.99999999999999997848, 1, 1, 1, 1, 1, 1, 1, 1}; double x = -10d; for (int i = 0; i < 41; i++) { Assert.assertEquals(gnuValues[i], Erf.erf(x), tol); x += 0.5d; } }