[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master c01b9b0 02/22: Improve concinnity
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master c01b9b0 02/22: Improve concinnity |
Date: |
Sun, 6 Jun 2021 21:37:59 -0400 (EDT) |
branch: master
commit c01b9b0ad03a823691fa39e7727a31efe1104f88
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Improve concinnity
---
zero.hpp | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/zero.hpp b/zero.hpp
index 8b69e4c..b3ec634 100644
--- a/zero.hpp
+++ b/zero.hpp
@@ -258,19 +258,19 @@ root_type decimal_root
,std::ostream& os_trace = null_stream()
)
{
- os_trace.precision(DECIMAL_DIG);
+ static constexpr double epsilon {std::numeric_limits<double>::epsilon()};
- static double const epsilon = std::numeric_limits<double>::epsilon();
+ round_to<double> const round_dec {decimals, r_to_nearest};
int number_of_iterations {0};
interpolation_technique technique {interpolate_initialization};
- double t = 0.5 * std::pow(10.0, -decimals);
+ os_trace.precision(DECIMAL_DIG);
- round_to<double> const round_(decimals, r_to_nearest);
+ double t = 0.5 * std::pow(10.0, -decimals);
- double a = round_(bound0);
- double b = round_(bound1);
+ double a = round_dec(bound0);
+ double b = round_dec(bound1);
double fa = static_cast<double>(f(a));
detail::expatiate(number_of_iterations, os_trace, technique, a, fa);
@@ -391,7 +391,7 @@ root_type decimal_root
{
b -= tol;
}
- b = round_(b);
+ b = round_dec(b);
if(b == a) // Note 4.
{
- [lmi-commits] [lmi] master updated (f0526be -> 86661b6), Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 7bd1245 01/22: Add a unit test: root of another unfriendly function, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master c01b9b0 02/22: Improve concinnity,
Greg Chicares <=
- [lmi-commits] [lmi] master 012967c 08/22: Diagnose any attempt to find a root in a zero-measure interval, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 83eb025 05/22: Rename a local variable, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master ec0a308 06/22: Refactor, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 99aebcc 07/22: Treat decimal_root return value more flexibly, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 5c31ab3 09/22: Fix latent unit-test errors, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 2391573 11/22: Rename a variable, for terseness, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master b14e318 18/22: Adjust tolerance for a particular unit-test function, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 1c448d8 20/22: Augment decimal_root()'s return type, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 53c3513 21/22: Reorder unit tests, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 5cf534c 04/22: Constify, Greg Chicares, 2021/06/06