Skip to content

Commit

Permalink
Switching tolerance to use std::numeric_limits<T>::epsilon()
Browse files Browse the repository at this point in the history
  • Loading branch information
clarkse committed Sep 17, 2024
1 parent 1819253 commit 4cfc9b8
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions Src/Base/AMReX_Math.H
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, float>::value) {
tol = 1e-6;
}
T tol = std::numeric_limits<T>::epsilon();

T a0 = 1.0;
T g0 = std::sqrt(1.0 - k*k);
Expand All @@ -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<T>(k);
T tol = 1e-12;
if constexpr (std::is_same<T, float>::value) {
tol = 1e-6;
}
T tol = std::numeric_limits<T>::epsilon();

// Step Zero
T a0 = 1.0;
Expand Down

0 comments on commit 4cfc9b8

Please sign in to comment.