diff --git a/src/interval/interval_def.h b/src/interval/interval_def.h index 370a3373b..2e0d77e93 100644 --- a/src/interval/interval_def.h +++ b/src/interval/interval_def.h @@ -1600,12 +1600,14 @@ template void interval::acosh() { numeric_traits::acosh(m_lower); if(upper_kind() == XN_NUMERAL) { numeric_traits::set_rounding(true); - numeric_traits::acosh(m_lower); + numeric_traits::acosh(m_upper); } lean_assert(check_invariant()); return; } template void interval::atanh() { + lean_assert(lower_kind() == XN_NUMERAL && m_lower >= -1.0); + lean_assert(upper_kind() == XN_NUMERAL && m_upper <= 1.0); if(lower_kind() == XN_NUMERAL) { numeric_traits::set_rounding(true); m_lower = -m_lower; diff --git a/src/tests/interval/double_interval.cpp b/src/tests/interval/double_interval.cpp index abbd72125..c2c76cb7c 100644 --- a/src/tests/interval/double_interval.cpp +++ b/src/tests/interval/double_interval.cpp @@ -966,6 +966,68 @@ static void double_interval_trans() { check_uop(double, cot, ozero_ninf); check_uop(double, cot, czero_pinf); check_uop(double, cot, czero_ninf); + + cout << "=====================" << endl; + check_uop(double, asinh, i1); + check_uop(double, asinh, i2); + check_uop(double, asinh, i3); + check_uop(double, asinh, i4); + check_uop(double, asinh, i5); + check_uop(double, asinh, i6); + check_uop(double, asinh, i7); + check_uop(double, asinh, i8); + check_uop(double, asinh, i9); + check_uop(double, asinh, i10); + check_uop(double, asinh, i11); + check_uop(double, asinh, i12); + check_uop(double, asinh, i13); + check_uop(double, asinh, i14); + check_uop(double, asinh, i15); + check_uop(double, asinh, oi1); + check_uop(double, asinh, oi2); + check_uop(double, asinh, oi3); + check_uop(double, asinh, oi4); + check_uop(double, asinh, oi5); + check_uop(double, asinh, oi6); + check_uop(double, asinh, oi7); + check_uop(double, asinh, oi8); + check_uop(double, asinh, oi9); + check_uop(double, asinh, oi10); + check_uop(double, asinh, oi11); + check_uop(double, asinh, oi12); + check_uop(double, asinh, oi13); + check_uop(double, asinh, oi14); + check_uop(double, asinh, oi15); + check_uop(double, asinh, inf); + check_uop(double, asinh, ozero_pinf); + check_uop(double, asinh, ozero_ninf); + check_uop(double, asinh, czero_pinf); + check_uop(double, asinh, czero_ninf); + + cout << "=====================" << endl; + check_uop(double, acosh, i1); + check_uop(double, acosh, i2); + check_uop(double, acosh, i5); + check_uop(double, acosh, i7); + check_uop(double, acosh, i8); + check_uop(double, acosh, oi1); + check_uop(double, acosh, oi2); + check_uop(double, acosh, oi5); + check_uop(double, acosh, oi7); + check_uop(double, acosh, oi8); + + cout << "=====================" << endl; + check_uop(double, atanh, i10); + check_uop(double, atanh, i11); + check_uop(double, atanh, i12); + check_uop(double, atanh, i13); + check_uop(double, atanh, i14); + check_uop(double, atanh, i15); + check_uop(double, atanh, oi11); + check_uop(double, atanh, oi12); + check_uop(double, atanh, oi13); + check_uop(double, atanh, oi14); + check_uop(double, atanh, oi15); } int main() { diff --git a/src/tests/interval/float_interval.cpp b/src/tests/interval/float_interval.cpp index 8bb0f3746..45705a7d1 100644 --- a/src/tests/interval/float_interval.cpp +++ b/src/tests/interval/float_interval.cpp @@ -966,6 +966,68 @@ static void float_interval_trans() { check_uop(float, cot, ozero_ninf); check_uop(float, cot, czero_pinf); check_uop(float, cot, czero_ninf); + + cout << "=====================" << endl; + check_uop(float, asinh, i1); + check_uop(float, asinh, i2); + check_uop(float, asinh, i3); + check_uop(float, asinh, i4); + check_uop(float, asinh, i5); + check_uop(float, asinh, i6); + check_uop(float, asinh, i7); + check_uop(float, asinh, i8); + check_uop(float, asinh, i9); + check_uop(float, asinh, i10); + check_uop(float, asinh, i11); + check_uop(float, asinh, i12); + check_uop(float, asinh, i13); + check_uop(float, asinh, i14); + check_uop(float, asinh, i15); + check_uop(float, asinh, oi1); + check_uop(float, asinh, oi2); + check_uop(float, asinh, oi3); + check_uop(float, asinh, oi4); + check_uop(float, asinh, oi5); + check_uop(float, asinh, oi6); + check_uop(float, asinh, oi7); + check_uop(float, asinh, oi8); + check_uop(float, asinh, oi9); + check_uop(float, asinh, oi10); + check_uop(float, asinh, oi11); + check_uop(float, asinh, oi12); + check_uop(float, asinh, oi13); + check_uop(float, asinh, oi14); + check_uop(float, asinh, oi15); + check_uop(float, asinh, inf); + check_uop(float, asinh, ozero_pinf); + check_uop(float, asinh, ozero_ninf); + check_uop(float, asinh, czero_pinf); + check_uop(float, asinh, czero_ninf); + + cout << "=====================" << endl; + check_uop(float, acosh, i1); + check_uop(float, acosh, i2); + check_uop(float, acosh, i5); + check_uop(float, acosh, i7); + check_uop(float, acosh, i8); + check_uop(float, acosh, oi1); + check_uop(float, acosh, oi2); + check_uop(float, acosh, oi5); + check_uop(float, acosh, oi7); + check_uop(float, acosh, oi8); + + cout << "=====================" << endl; + check_uop(float, atanh, i10); + check_uop(float, atanh, i11); + check_uop(float, atanh, i12); + check_uop(float, atanh, i13); + check_uop(float, atanh, i14); + check_uop(float, atanh, i15); + check_uop(float, atanh, oi11); + check_uop(float, atanh, oi12); + check_uop(float, atanh, oi13); + check_uop(float, atanh, oi14); + check_uop(float, atanh, oi15); } int main() { diff --git a/src/tests/interval/mpfp_interval.cpp b/src/tests/interval/mpfp_interval.cpp index 27bf2c4b9..e5a0192ed 100644 --- a/src/tests/interval/mpfp_interval.cpp +++ b/src/tests/interval/mpfp_interval.cpp @@ -966,6 +966,68 @@ static void mpfp_interval_trans() { check_uop(mpfp, cot, ozero_ninf); check_uop(mpfp, cot, czero_pinf); check_uop(mpfp, cot, czero_ninf); + + cout << "=====================" << endl; + check_uop(mpfp, asinh, i1); + check_uop(mpfp, asinh, i2); + check_uop(mpfp, asinh, i3); + check_uop(mpfp, asinh, i4); + check_uop(mpfp, asinh, i5); + check_uop(mpfp, asinh, i6); + check_uop(mpfp, asinh, i7); + check_uop(mpfp, asinh, i8); + check_uop(mpfp, asinh, i9); + check_uop(mpfp, asinh, i10); + check_uop(mpfp, asinh, i11); + check_uop(mpfp, asinh, i12); + check_uop(mpfp, asinh, i13); + check_uop(mpfp, asinh, i14); + check_uop(mpfp, asinh, i15); + check_uop(mpfp, asinh, oi1); + check_uop(mpfp, asinh, oi2); + check_uop(mpfp, asinh, oi3); + check_uop(mpfp, asinh, oi4); + check_uop(mpfp, asinh, oi5); + check_uop(mpfp, asinh, oi6); + check_uop(mpfp, asinh, oi7); + check_uop(mpfp, asinh, oi8); + check_uop(mpfp, asinh, oi9); + check_uop(mpfp, asinh, oi10); + check_uop(mpfp, asinh, oi11); + check_uop(mpfp, asinh, oi12); + check_uop(mpfp, asinh, oi13); + check_uop(mpfp, asinh, oi14); + check_uop(mpfp, asinh, oi15); + check_uop(mpfp, asinh, inf); + check_uop(mpfp, asinh, ozero_pinf); + check_uop(mpfp, asinh, ozero_ninf); + check_uop(mpfp, asinh, czero_pinf); + check_uop(mpfp, asinh, czero_ninf); + + cout << "=====================" << endl; + check_uop(mpfp, acosh, i1); + check_uop(mpfp, acosh, i2); + check_uop(mpfp, acosh, i5); + check_uop(mpfp, acosh, i7); + check_uop(mpfp, acosh, i8); + check_uop(mpfp, acosh, oi1); + check_uop(mpfp, acosh, oi2); + check_uop(mpfp, acosh, oi5); + check_uop(mpfp, acosh, oi7); + check_uop(mpfp, acosh, oi8); + + cout << "=====================" << endl; + check_uop(mpfp, atanh, i10); + check_uop(mpfp, atanh, i11); + check_uop(mpfp, atanh, i12); + check_uop(mpfp, atanh, i13); + check_uop(mpfp, atanh, i14); + check_uop(mpfp, atanh, i15); + check_uop(mpfp, atanh, oi11); + check_uop(mpfp, atanh, oi12); + check_uop(mpfp, atanh, oi13); + check_uop(mpfp, atanh, oi14); + check_uop(mpfp, atanh, oi15); } int main() {