diff --git a/src/interval/interval_def.h b/src/interval/interval_def.h index b9e6cdbc6..9842d2418 100644 --- a/src/interval/interval_def.h +++ b/src/interval/interval_def.h @@ -1166,7 +1166,7 @@ template void interval::cos () { m_lower_open = m_upper_open = false; m_lower_inf = m_upper_inf = false; T const pi_twice = numeric_traits::pi_twice(); - fmod(pi_twice); + fmod(interval(numeric_traits::pi_twice_lower(), numeric_traits::pi_twice_upper())); if(m_upper - m_lower >= pi_twice) { // If the input width is bigger than 2pi, // it covers whole domain and gets [-1.0, 1.0] @@ -1178,7 +1178,7 @@ template void interval::cos () { if(m_lower >= numeric_traits::pi_upper()) { // If the input is bigger than pi, we handle it recursively by the fact: // cos(x) = -cos(x - pi) - *this -= numeric_traits::pi(); + *this -= interval(numeric_traits::pi_lower(), numeric_traits::pi_upper()); cos(); neg(); lean_assert(check_invariant());