private static void CheckPow(double x, int exp, double errBound) { var xdd = new DD(x); var pow = xdd.Pow(exp); // TestContext.WriteLine("Pow(" + x + ", " + exp + ") = " + pow); var pow2 = SlowPow(xdd, exp); double err = (pow - pow2).ToDoubleValue(); bool isOK = err < errBound; if (!isOK) { TestContext.WriteLine("Test slowPow value " + pow2); } Assert.IsTrue(err <= errBound); }
private static void CheckPow(double x, int exp, double errBound) { var xdd = new DD(x); var pow = xdd.Pow(exp); Console.WriteLine("Pow(" + x + ", " + exp + ") = " + pow); var pow2 = SlowPow(xdd, exp); double err = pow.Subtract(pow2).ToDoubleValue(); var isOK = err < errBound; if (!isOK) Console.WriteLine("Test slowPow value " + pow2); Assert.IsTrue(err <= errBound); }