lmi-commits
[Top][All Lists]
Advanced

[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);



reply via email to

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