[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] odd/brent 3bd7713 4/8: Try again / Flail again / Fla
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] odd/brent 3bd7713 4/8: Try again / Flail again / Flail better |
Date: |
Fri, 18 Jun 2021 20:19:11 -0400 (EDT) |
branch: odd/brent
commit 3bd771343f534820c945f1cd08a76040542c3f39
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Try again / Flail again / Flail better
f(x)=(x-1.7)^17 is the last function analyzed in this article:
https://www.embeddedrelated.com/showarticle/855.php
which doesn't print all the iterands, probably because they are many:
51 chand (every step is a bisection)
145 genuine brent
128 brent (< "genuine" presumably due to uncorrected mistakes)
That article graphs the logarithm of |f(x)|, which appears to be a pair
of parallel lines close together. Separating them by graphing
signum(f(x)) * (DBL_MAX_10_EXP + log(abs(f(x))))
instead interestingly shows bilateral convergence.
In terms of Kahan's trichotomy (see previous commit message), this may
be regarded as an exercise in flailing, in which phase bisection may
be the best technique in the {bisection,secant,IQI} toolbox.
---
zero_test.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/zero_test.cpp b/zero_test.cpp
index 8685f4d..7a60cdc 100644
--- a/zero_test.cpp
+++ b/zero_test.cpp
@@ -114,8 +114,8 @@ struct e_functor
struct e_nineteenth
{
// double operator()(double z) {return std::pow(z, 19);} // -1.0 , 4.0
- double operator()(double z) {return std::cos(z) - 0.999;} // -0.01, 0.8
-// double operator()(double z) {return std::pow(z - 1.7, 17.0);} // 0.0 , 2.0
+// double operator()(double z) {return std::cos(z) - 0.999;} // -0.01, 0.8
+ double operator()(double z) {return std::pow(z - 1.7, 17.0);} // 0.0 , 2.0
// double operator()(double z) {return std::pow((z - 1.0), 3);} // 0.0 , 1.8
// double operator()(double z) {return std::pow(z, 2.0) - 2.0;} // 0.0 , 2.0
};
@@ -275,8 +275,8 @@ int test_main(int, char*[])
// 195 Brent's table 4.1 (IBM 360)
// 171 x86_64 brent_zero (IEEE 754)
// 169 x86_64 decimal_root (differs slightly due to rounding)
- double lo = -0.01;
- double hi = 0.8 ;
+ double lo = 0.0;
+ double hi = 2.0;
std::cout << "test genuine brent" << std::endl;
double d = brent_zero(lo, hi, 1.0e-16, e_19);
// LMI_TEST(std::fabs(d) <= epsilon);
- [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 <=
- [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, 2021/06/18
- [lmi-commits] [lmi] odd/brent e2b9e33 8/8: Let Chandrupatla reject IQI when Brent would accept it, Greg Chicares, 2021/06/18