From 4cfc9b8789875f52394fbb9fe7e1e548f1e6c3cc Mon Sep 17 00:00:00 2001 From: "S. Eric Clark" <25495882+clarkse@users.noreply.github.com> Date: Tue, 17 Sep 2024 13:42:14 -0700 Subject: [PATCH] Switching tolerance to use std::numeric_limits::epsilon() --- Src/Base/AMReX_Math.H | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/Src/Base/AMReX_Math.H b/Src/Base/AMReX_Math.H index 15280d2a62..040708074c 100644 --- a/Src/Base/AMReX_Math.H +++ b/Src/Base/AMReX_Math.H @@ -232,10 +232,7 @@ T comp_ellint_1 (T k) { // Computing K based on DLMF // https://dlmf.nist.gov/19.8 - T tol = 1e-12; - if constexpr (std::is_same::value) { - tol = 1e-6; - } + T tol = std::numeric_limits::epsilon(); T a0 = 1.0; T g0 = std::sqrt(1.0 - k*k); @@ -261,10 +258,7 @@ T comp_ellint_2 (T k) // Computing E based on DLMF // https://dlmf.nist.gov/19.8 T Kcomp = amrex::Math::comp_ellint_1(k); - T tol = 1e-12; - if constexpr (std::is_same::value) { - tol = 1e-6; - } + T tol = std::numeric_limits::epsilon(); // Step Zero T a0 = 1.0;