[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
- [lmi-commits] [lmi] odd/brent updated (8ccfa28 -> e2b9e33), Greg Chicares, 2021/06/18
- [lmi-commits] [lmi] odd/brent a36f54b 2/8: Search for the square root of two, Greg Chicares, 2021/06/18
- [lmi-commits] [lmi] odd/brent 3bd7713 4/8: Try again / Flail again / Flail better, Greg Chicares, 2021/06/18
- [lmi-commits] [lmi] odd/brent ec32d2b 5/8: Transplant Chandrupatla's condition into some Brent code, Greg Chicares, 2021/06/18
- [lmi-commits] [lmi] odd/brent ea32ee0 1/8: Suppress unwanted output, Greg Chicares, 2021/06/18
- [lmi-commits] [lmi] odd/brent a24eea7 3/8: Find a root of cos(x)-0.999, Greg Chicares, 2021/06/18
- [lmi-commits] [lmi] odd/brent 0ad36f9 6/8: Display Brent and Chandrupatla conditions, Greg Chicares, 2021/06/18
- [lmi-commits] [lmi] odd/brent b60b29b 7/8: Test Chandrupatla condition in genuine brent code,
Greg Chicares <=
- [lmi-commits] [lmi] odd/brent e2b9e33 8/8: Let Chandrupatla reject IQI when Brent would accept it, Greg Chicares, 2021/06/18