public void ComplexErfFresnel () { // don't let x get too big or we run into problem of accruacy for arguments of large trig-like functions foreach (double x in TestUtilities.GenerateRealValues(1.0E-1, 1.0E2, 16)) { Complex z = Math.Sqrt(Math.PI) * (1.0 - ComplexMath.I) * x / 2.0; Complex w = (1.0 + ComplexMath.I) * AdvancedComplexMath.Erf(z) / 2.0; Assert.IsTrue(TestUtilities.IsNearlyEqual(w.Re, AdvancedMath.FresnelC(x))); Assert.IsTrue(TestUtilities.IsNearlyEqual(w.Im, AdvancedMath.FresnelS(x))); } }