Fix interval::acosh and add more tests on interval to improve code coverage

This commit is contained in:
Soonho Kong 2013-08-18 01:19:04 -07:00
parent 65b4845fbc
commit ec83fd8093
4 changed files with 189 additions and 1 deletions

View file

@ -1600,12 +1600,14 @@ template<typename T> void interval<T>::acosh() {
numeric_traits<T>::acosh(m_lower);
if(upper_kind() == XN_NUMERAL) {
numeric_traits<T>::set_rounding(true);
numeric_traits<T>::acosh(m_lower);
numeric_traits<T>::acosh(m_upper);
}
lean_assert(check_invariant());
return;
}
template<typename T> void interval<T>::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<T>::set_rounding(true);
m_lower = -m_lower;

View file

@ -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() {

View file

@ -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() {

View file

@ -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() {