[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master de0234e 3/6: Use std::fabs as appropriate in
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master de0234e 3/6: Use std::fabs as appropriate in f2c-translated code |
Date: |
Wed, 27 Oct 2021 18:22:21 -0400 (EDT) |
branch: master
commit de0234e52fee980f2ba2cfa5d37183ebcfd38f51
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Use std::fabs as appropriate in f2c-translated code
---
zero.hpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/zero.hpp b/zero.hpp
index c511f10..6e8efd8 100644
--- a/zero.hpp
+++ b/zero.hpp
@@ -1211,7 +1211,7 @@ inline int tole_(double* b, double* tol, int* neps,
double* eps)
// dividing repeatedly by ten.
*tol = tolx;
}
- *tol += abs(*b) * 2. * *eps;
+ *tol += std::fabs(*b) * 2. * *eps;
*tol *= 2.;
// std::cout << "actual tolerance " << *tol << std::endl;
return 0;
@@ -1278,7 +1278,7 @@ int rroot_(FunctionalType& f, int* nprob, int* neps,
double* eps,
/* CALCULATES THE TERMINATION CRITERION. STOPS THE PROCEDURE IF THE */
/* CRITERION IS SATISFIED. */
- if (abs(fb) <= abs(fa)) {
+ if (std::fabs(fb) <= std::fabs(fa)) {
tole_(b, &tol, neps, eps);
} else {
tole_(a, &tol, neps, eps);
@@ -1358,7 +1358,7 @@ int rroot_(FunctionalType& f, int* nprob, int* neps,
double* eps,
/* TAKES THE DOUBLE-SIZE SECANT STEP. */
- if (abs(fa) < abs(fb)) {
+ if (std::fabs(fa) < std::fabs(fb)) {
u = *a;
fu = fa;
} else {
@@ -1366,7 +1366,7 @@ int rroot_(FunctionalType& f, int* nprob, int* neps,
double* eps,
fu = fb;
}
c0 = u - fu / (fb - fa) * 2. * (*b - *a);
- if ((d_1 = c0 - u, abs(d_1)) > (*b - *a) * .5) {
+ if ((d_1 = c0 - u, std::fabs(d_1)) > (*b - *a) * .5) {
c0 = *a + (*b - *a) * .5;
}
@@ -1481,7 +1481,7 @@ int brackt_(FunctionalType& f, int* nprob, double* a,
double* b,
/* UPDATE THE TERMINATION CRITERION ACCORDING TO THE NEW ENCLOSING */
/* INTERVAL. */
- if (abs(*fb) <= abs(*fa)) {
+ if (std::fabs(*fb) <= std::fabs(*fa)) {
tole_(b, tol, neps, eps);
} else {
tole_(a, tol, neps, eps);
- [lmi-commits] [lmi] master updated (f43af72 -> bc7259f), Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master e1482a3 5/6: Add unit tests for stifle_unused_warning(), Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master bc7259f 6/6: Make stifle_unused_warning() constexpr, Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master be063aa 4/6: Merge "stifle" function templates, Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master 7f3f9c8 1/6: Clarify, Greg Chicares, 2021/10/27
- [lmi-commits] [lmi] master de0234e 3/6: Use std::fabs as appropriate in f2c-translated code,
Greg Chicares <=
- [lmi-commits] [lmi] master 3899747 2/6: Avoid ambiguous abbreviations, Greg Chicares, 2021/10/27