sal/rtl/math.cxx | 2 +- sc/source/core/tool/interpr1.cxx | 3 ++- sc/source/core/tool/interpr3.cxx | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-)
New commits: commit 6f75ec6115f0152517be634070607bc61bf96dd0 Author: offtkp <[email protected]> AuthorDate: Sat May 7 01:20:33 2022 +0300 Commit: Bartosz Kosiorek <[email protected]> CommitDate: Wed May 11 10:32:30 2022 +0200 tdf#148430 Use atanh from <cmath> instead of our own Change wrapper in rtl::math::atanh to use atanh from <cmath>. Also changed all occurrences of rtl::math::atanh on files that use this function to directly use the standard atanh instead. Change-Id: Idc5c456f67291f5816756f023b61afde844b5ceb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133965 Tested-by: Jenkins Reviewed-by: Bartosz Kosiorek <[email protected]> diff --git a/sal/rtl/math.cxx b/sal/rtl/math.cxx index a4775585ace4..b53cbec144b3 100644 --- a/sal/rtl/math.cxx +++ b/sal/rtl/math.cxx @@ -769,7 +769,7 @@ double SAL_CALL rtl_math_atanh(double fValue) SAL_THROW_EXTERN_C() __attribute__((no_sanitize("float-divide-by-zero"))) // atahn(1) -> inf #endif { - return 0.5 * rtl_math_log1p(2.0 * fValue / (1.0-fValue)); + return ::atanh(fValue); } /** Parent error function (erf) */ diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index f6dbbffa2d3f..f71c1941b1a2 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -75,6 +75,7 @@ #include <memory> #include <limits> #include <string_view> +#include <cmath> const sal_uInt64 n2power48 = SAL_CONST_UINT64( 281474976710656); // 2^48 @@ -1919,7 +1920,7 @@ void ScInterpreter::ScArcTanHyp() if (fabs(fVal) >= 1.0) PushIllegalArgument(); else - PushDouble( ::rtl::math::atanh( fVal)); + PushDouble(::atanh(fVal)); } void ScInterpreter::ScArcCotHyp() diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 25b5f44038f2..e5ae61962014 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -28,6 +28,7 @@ #include <scmatrix.hxx> #include <cassert> +#include <cmath> #include <memory> #include <set> #include <vector> @@ -1152,7 +1153,7 @@ void ScInterpreter::ScFisher() if (std::abs(fVal) >= 1.0) PushIllegalArgument(); else - PushDouble( ::rtl::math::atanh( fVal)); + PushDouble(::atanh(fVal)); } void ScInterpreter::ScFisherInv()
