lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 22f33cd 3/5: Make root-finding trace more inf


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 22f33cd 3/5: Make root-finding trace more informative
Date: Mon, 2 Aug 2021 18:25:15 -0400 (EDT)

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

    Make root-finding trace more informative
    
    Curiously, though not astonishingly, showing more information in a trace
    has the effect of changing the number of function evaluations required
    to find a particular root with x87 only. Experimental (not committed)
    investigation shows that the cause is a minuscule difference in an early
    iterate, which could be expected with an 80- to 64-bit register spill.
---
 zero.hpp      | 9 ++++++++-
 zero_test.cpp | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/zero.hpp b/zero.hpp
index 3d33e45..34bf944 100644
--- a/zero.hpp
+++ b/zero.hpp
@@ -634,7 +634,14 @@ root_type decimal_root
         auto const i = m.find(r);
         if(m.end() != i)
             {
-            os_trace << "Superfluous evaluation avoided" << std::endl;
+            os_trace
+                << "Superfluous evaluation at "
+                << x
+                << ", which rounds to "
+                << r
+                << ", avoided."
+                << std::endl
+                ;
             return i->second;
             }
         else
diff --git a/zero_test.cpp b/zero_test.cpp
index 1c79aab..149392e 100644
--- a/zero_test.cpp
+++ b/zero_test.cpp
@@ -1063,7 +1063,7 @@ void test_hodgepodge()
     // rather than a theoretical maximum. Perhaps they'll always
     // succeed, because floating-point behavior is determinate;
     // but small variations betoken no catastrophe.
-    LMI_TEST_RELATION(156,<=,r.n_eval); // weak
+    LMI_TEST_RELATION(153,<=,r.n_eval); // weak
     LMI_TEST_RELATION(r.n_eval,<=,166); // weak
 
     d = brent_zero(eq_2_1, -100.0, 100.0, 0.5);



reply via email to

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