lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] odd/brent b60b29b 7/8: Test Chandrupatla condition i


From: Greg Chicares
Subject: [lmi-commits] [lmi] odd/brent b60b29b 7/8: Test Chandrupatla condition in genuine brent code
Date: Fri, 18 Jun 2021 20:19:11 -0400 (EDT)

branch: odd/brent
commit b60b29b983b0df116ba73afb36f1d934ae9bf41f
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Test Chandrupatla condition in genuine brent code
    
    Print "X " before each IQI step that Chandrupatla would reject.
    
    Just prior to this commit, the "test genuine brent" test took 145
    iterations. With this commit, it takes exactly the same number.
---
 zero.hpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/zero.hpp b/zero.hpp
index 4deb532..43f0964 100644
--- a/zero.hpp
+++ b/zero.hpp
@@ -589,11 +589,21 @@ int j = 0;
                 }
             s = e;
             e = d;
+            double xi  = ( b -  c) / ( a -  c);
+            double phi = (fb - fc) / (fa - fc);
+            bool cond_c =
+                   (phi * phi) < xi
+                && ((1.0 - phi) * (1.0 - phi)) < (1.0 - xi)
+                ;
             if
                 (   p < 1.5 * m * q - std::fabs(tol * q)
                 &&  p < std::fabs(0.5 * s * q)
                 )
                 {
+                if(interpolate_inverse_quadratic == technique && !cond_c)
+                    {
+                    std::cout << "X ";
+                    }
                 d = p / q;
                 }
             else



reply via email to

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