Skip to content

Commit db7868a

Browse files
committed
check sin(x) > eps for checking bound instead
1 parent 1bc5d2a commit db7868a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Source/driver/Castro_math.H

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ cross_product(amrex::GpuArray<amrex::Real, 3> const& a,
2525
AMREX_GPU_HOST_DEVICE AMREX_INLINE
2626
amrex::Real cot(amrex::Real x) {
2727

28-
AMREX_ASSERT(x != 0.0_rt && x != M_PI);
28+
constexpr amrex::Real eps = 1.e-14_rt;
29+
AMREX_ASSERT(std::abs(std::sin(x)) > eps);
2930

3031
// we want to reflect outside of x in [0, pi]
3132
// i.e. if x = -0.1 -> x = 0.1

0 commit comments

Comments
 (0)