[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 43bbe463 05/11: Use lmi::expm1() and lmi::log
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 43bbe463 05/11: Use lmi::expm1() and lmi::log1p() in a unit-test function |
Date: |
Thu, 26 May 2022 18:14:25 -0400 (EDT) |
branch: master
commit 43bbe46333849a2dcbf61a580c8e07fba1d6ad81
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Use lmi::expm1() and lmi::log1p() in a unit-test function
Production uses 'double' expm1() and log1p(), rather than 'long double'
as the comment previously said.
---
math_functions_test.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/math_functions_test.cpp b/math_functions_test.cpp
index 26434ad0..bd6a84ed 100644
--- a/math_functions_test.cpp
+++ b/math_functions_test.cpp
@@ -133,8 +133,8 @@ struct i_upper_n_over_n_from_i_naive
}
};
-// This implementation uses std::expm1() and std::log1p() for type T,
-// rather than the long double functions used in production.
+// This implementation uses lmi::expm1() and lmi::log1p() for type T,
+// whereas production uses those functions for type 'double' only.
template<typename T, int n>
struct i_upper_n_over_n_from_i_T
@@ -143,7 +143,7 @@ struct i_upper_n_over_n_from_i_T
T operator()(T const& i) const
{
static T const reciprocal_n = T(1) / n;
- return std::expm1(std::log1p(i) * reciprocal_n);
+ return lmi::expm1(lmi::log1p(i) * reciprocal_n);
}
};
} // Unnamed namespace.
- [lmi-commits] [lmi] master updated (47f54ead -> 77cc4d65), Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master 1b9395f2 03/11: Improve documentation, Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master 699308ab 01/11: Improve documentation, Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master 086ce6b3 06/11: Fix a probable defect introduced 20210314T1905Z, Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master 284efedf 08/11: For immediate reversion: binary exponentiation, Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master f920e584 10/11: Improve documentation, Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master 43bbe463 05/11: Use lmi::expm1() and lmi::log1p() in a unit-test function,
Greg Chicares <=
- [lmi-commits] [lmi] master 2c0ec871 07/11: Use lmi rather than std functions, Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master b1b2ed4f 09/11: Revert "For immediate reversion: binary exponentiation", Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master b6752650 02/11: Improve documentation, Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master a110f9a0 04/11: Write fdlibm forwarding functions out of line, Greg Chicares, 2022/05/26
- [lmi-commits] [lmi] master 77cc4d65 11/11: Prefer nonstd::power() to std::pow() in a particular case, Greg Chicares, 2022/05/26