lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 41d1896 08/13: Move some tests out of a hodge


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 41d1896 08/13: Move some tests out of a hodgepodge
Date: Sun, 4 Jul 2021 19:04:45 -0400 (EDT)

branch: master
commit 41d18961c929545bd7ddfe120ca7ccff20e53a15
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Move some tests out of a hodgepodge
---
 zero_test.cpp | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/zero_test.cpp b/zero_test.cpp
index 8f5cfad..b945c41 100644
--- a/zero_test.cpp
+++ b/zero_test.cpp
@@ -498,6 +498,21 @@ void test_various_functions()
     test_a_decimal_function(f01, root_01, -1.0 , 4.0, 17     , __LINE__, 163);
     test_a_function        (f01, root_01, -1.0 , 4.0, 1.0e-15, __LINE__);
 
+    e_nineteenth e_19; // Same function as f01()--refactor soon.
+
+    // For now, test_a_decimal_function() tests that the error is
+    // within tolerance, ignoring roundoff in the computed function.
+    // That may very often be useful, but it can produce spurious
+    // failures, as in these three commented-out lines:
+//  test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 20, __LINE__, 169);
+//  test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 19, __LINE__, 171);
+//  test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 18, __LINE__, 168);
+    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 17, __LINE__, 163);
+    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 16, __LINE__, 156);
+    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 15, __LINE__, 142);
+    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 14, __LINE__, 128);
+    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 12, __LINE__, 112);
+
     auto f02 = [](double x) {return std::pow(x - 1.7, 17.0);};
     auto root_02 = 1.7;
     test_a_decimal_function(f02, root_02, 0.0, 2.0, 17     , __LINE__, 145);
@@ -568,21 +583,6 @@ void test_hodgepodge()
     // but small variations betoken no catastrophe.
     LMI_TEST(169 <= r.n_iter && r.n_iter <= 173); // weak
 
-    // Similar, using unit-test function template.
-    //
-    // For now, test_a_decimal_function() tests that the error is
-    // within tolerance, ignoring roundoff in the computed function.
-    // That may very often be useful, but it can produce spurious
-    // failures, as in these three commented-out lines:
-//  test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 20, __LINE__, 169);
-//  test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 19, __LINE__, 171);
-//  test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 18, __LINE__, 168);
-    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 17, __LINE__, 163);
-    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 16, __LINE__, 156);
-    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 15, __LINE__, 142);
-    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 14, __LINE__, 128);
-    test_a_decimal_function(e_19, 0.0, -1.0, 4.0, 12, __LINE__, 112);
-
     d = brent_zero(eq_2_1, -100.0, 100.0, 0.5);
     zeta = -100.0;
     double eq_2_1_upper = zeta + max_err(zeta, 0.5);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]