Fix interval<T>::cosh

This commit is contained in:
Soonho Kong 2013-08-14 19:51:54 -07:00
parent cd71218a68
commit 0a2ac88dd1

View file

@ -1314,17 +1314,17 @@ template<typename T> void interval<T>::cosh () {
numeric_traits<T>::set_rounding(false);
numeric_traits<T>::cosh(m_lower);
numeric_traits<T>::set_rounding(true);
numeric_traits<T>::cosh(m_lower);
numeric_traits<T>::cosh(m_upper);
lean_assert(check_invariant());
return;
}
if(numeric_traits<T>::is_neg(m_upper) || numeric_traits<T>::is_zero(m_upper)) {
// [a, b] where a <= b < 0
numeric_traits<T>::set_rounding(true);
numeric_traits<T>::cosh(m_lower);
std::swap(m_lower, m_upper);
numeric_traits<T>::set_rounding(false);
numeric_traits<T>::cosh(m_lower);
std::swap(m_lower, m_upper);
numeric_traits<T>::set_rounding(true);
numeric_traits<T>::cosh(m_upper);
lean_assert(check_invariant());
return;
}