lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master d0a65c2 04/23: Demonstrate that Brent's δ ca


From: Greg Chicares
Subject: [lmi-commits] [lmi] master d0a65c2 04/23: Demonstrate that Brent's δ can be almost arbitrarily small
Date: Tue, 27 Jul 2021 21:59:50 -0400 (EDT)

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

    Demonstrate that Brent's δ can be almost arbitrarily small
---
 zero_test.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/zero_test.cpp b/zero_test.cpp
index ff06add..6afd8e0 100644
--- a/zero_test.cpp
+++ b/zero_test.cpp
@@ -721,6 +721,15 @@ void test_various_functions()
     test_a_decimal_function(f06, root_06, -2.1 , 1.9, 15     , __LINE__);
     test_a_function        (f06, root_06,  1.9, -2.1, 1.0e-15, __LINE__);
     test_a_function        (f06, root_06, -2.1 , 1.9, 1.0e-15, __LINE__);
+
+    // Here, the input tolerance is legitimately much smaller than ϵ.
+    // Brent describes 'tol' as positive, so it shouldn't be zero, yet
+    // it has no absolute minimum (other than DBL_TRUE_MIN) because
+    // it is a relative error. Thus, when ζ = 0, δ has no minimum at
+    // all (other than DBL_TRUE_MIN).
+    auto f07 = [](double x) {return 1.23 * (x - 1.0e-100);};
+    auto root_07 = 1.0e-100;
+    test_a_function(f07, root_07, 1.0e-10, 1.0e-200, 1.0e-150, __LINE__);
 }
 
 void test_hodgepodge()



reply via email to

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