diff --git a/test/test_bessel_i.hpp b/test/test_bessel_i.hpp index f6d38f0e0..b2626305c 100644 --- a/test/test_bessel_i.hpp +++ b/test/test_bessel_i.hpp @@ -191,7 +191,7 @@ void test_bessel(T, const char* name) { BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(T(0.25), T(8000)), std::numeric_limits::infinity()); } - else + else BOOST_IF_CONSTEXPR(std::numeric_limits::max_exponent10 < 9200) { BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(T(0.25), T(21000)), std::numeric_limits::infinity()); } @@ -209,6 +209,8 @@ void test_bessel(T, const char* name) #endif BOOST_IF_CONSTEXPR (std::numeric_limits::max_exponent > 1000) { + BOOST_IF_CONSTEXPR(std::is_floating_point::value == false) + tolerance *= 2; // multiprecision type. BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(0, T(700)), SC_(1.5295933476718737363162072288904508649662689614661164851272e302), tolerance); BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(1, T(600)), SC_(6.1411813450668919369004006361519512681603654557478168763761e258), tolerance); } diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index 8e59ae225..cf28369c3 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -180,7 +180,7 @@ void test_bessel(T, const char* name) BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity) { BOOST_CHECK_EQUAL(boost::math::cyl_bessel_k(T(0), T(0)), std::numeric_limits::infinity()); - BOOST_IF_CONSTEXPR(std::numeric_limits::min_exponent <= -1021) + BOOST_IF_CONSTEXPR(std::numeric_limits::min_exponent > -1021) { BOOST_CHECK_EQUAL(boost::math::cyl_bessel_k(16, ldexp(T(1), -1021)), std::numeric_limits::infinity()); } diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index ccbf61f78..8123a777f 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -247,29 +247,42 @@ void test_bessel(T, const char* name) BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity && (std::numeric_limits::min_exponent < -1072)) { static const std::array, 7> coverage_data = { { -#if LDBL_MAX_10_EXP > 4931 +#if (LDBL_MAX_10_EXP > 4931) || defined(TEST_MPF_50) || defined(TEST_MPFR_50) || defined(TEST_CPP_DEC_FLOAT) || defined(TEST_FLOAT128) || defined(TEST_CPP_BIN_FLOAT) {{ SC_(15.25), ldexp(T(1), -1071), SC_(-9.39553199265929955912687892204143267985847111378392154596e4931)}}, #else {{ SC_(15.25), ldexp(T(1), -1071), -std::numeric_limits::infinity() }}, #endif -#if LDBL_MAX_10_EXP > 4945 +#if (LDBL_MAX_10_EXP > 4945) || defined(TEST_MPF_50) || defined(TEST_MPFR_50) || defined(TEST_CPP_DEC_FLOAT) || defined(TEST_FLOAT128) || defined(TEST_CPP_BIN_FLOAT) {{ SC_(15.25), ldexp(T(1), -1074), SC_(-5.55960167798850683070863439793e+4945)}}, #else {{ SC_(15.25), ldexp(T(1), -1074), -std::numeric_limits::infinity() }}, #endif -#if LDBL_MAX_10_EXP > 9872 +#if (LDBL_MAX_10_EXP > 9872) || defined(TEST_MPF_50) || defined(TEST_MPFR_50) || defined(TEST_CPP_DEC_FLOAT) || defined(TEST_FLOAT128) || defined(TEST_CPP_BIN_FLOAT) {{ SC_(31.25), ldexp(T(1), -1045), SC_(-1.64443614527479263825137492596041426343778386094212520006e9872)}}, #else {{ SC_(31.25), ldexp(T(1), -1045), -std::numeric_limits::infinity() }}, #endif +#if defined(TEST_MPF_50) || defined(TEST_MPFR_50) || defined(TEST_CPP_DEC_FLOAT) || defined(TEST_FLOAT128) || defined(TEST_CPP_BIN_FLOAT) + // Our exponent range may be so extreme that we can't trigger the coverage cases below, so use a copy of previous cases here + // as a placeholder. + {{ SC_(15.25), ldexp(T(1), -1071), SC_(-9.39553199265929955912687892204143267985847111378392154596e4931)}}, + {{ SC_(15.25), ldexp(T(1), -1071), SC_(-9.39553199265929955912687892204143267985847111378392154596e4931)}}, +#else {{ SC_(233.0), ldexp(T(1), -63), -std::numeric_limits::infinity() }}, {{ SC_(233.0), ldexp(T(1), -64), -std::numeric_limits::infinity() }}, -#if LDBL_MAX_10_EXP > 413 +#endif +#if (LDBL_MAX_10_EXP > 413) || defined(TEST_MPF_50) || defined(TEST_MPFR_50) || defined(TEST_CPP_DEC_FLOAT) || defined(TEST_FLOAT128) || defined(TEST_CPP_BIN_FLOAT) {{ SC_(200.25), SC_(1.25), SC_(-3.545198572052800784992190965856441074217589237581037286156e413)}}, #else {{ SC_(200.25), SC_(1.25), -std::numeric_limits::infinity()}}, #endif +#if defined(TEST_MPF_50) || defined(TEST_MPFR_50) || defined(TEST_CPP_DEC_FLOAT) || defined(TEST_FLOAT128) || defined(TEST_CPP_BIN_FLOAT) + // Our exponent range may be so extreme that we can't trigger the coverage cases below, so use a copy of previous cases here + // as a placeholder. + {{ SC_(15.25), ldexp(T(1), -1071), SC_(-9.39553199265929955912687892204143267985847111378392154596e4931)}}, +#else {{ SC_(1652.25), SC_(1.25), -std::numeric_limits::infinity()}}, +#endif } }; do_test_cyl_neumann_y(coverage_data, name, "Extra Coverage Data"); diff --git a/test/test_binomial_coeff.hpp b/test/test_binomial_coeff.hpp index 0c6762c6f..a790a2c53 100644 --- a/test/test_binomial_coeff.hpp +++ b/test/test_binomial_coeff.hpp @@ -83,9 +83,11 @@ void test_binomial(T, const char* type_name) // BOOST_CHECK_THROW(boost::math::binomial_coefficient(2, 3), std::domain_error); T tolerance = boost::math::tools::epsilon() * 200; -#if LDBL_MAX_10_EXP > 320 +#if (LDBL_MAX_10_EXP > 320) || defined(TEST_MPF_50) || defined(TEST_MPFR_50) || defined(TEST_CPP_DEC_FLOAT) || defined(TEST_FLOAT128) || defined(TEST_CPP_BIN_FLOAT) BOOST_IF_CONSTEXPR(std::numeric_limits::max_exponent10 > 320) { + BOOST_IF_CONSTEXPR(std::is_floating_point::value == false) + tolerance *= 2; BOOST_CHECK_CLOSE_FRACTION(boost::math::binomial_coefficient(1072, 522), SC_(8.5549524921358966076960008392254468438388716743112653656397e320), tolerance); } else BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity) @@ -98,12 +100,13 @@ void test_binomial(T, const char* type_name) BOOST_CHECK_EQUAL(boost::math::binomial_coefficient(1072, 522), std::numeric_limits::infinity()); } #endif -#if LDBL_MAX_10_EXP > 4946 +#if (LDBL_MAX_10_EXP > 4946) || defined(TEST_MPF_50) || defined(TEST_MPFR_50) || defined(TEST_CPP_DEC_FLOAT) || defined(TEST_FLOAT128) || defined(TEST_CPP_BIN_FLOAT) + BOOST_IF_CONSTEXPR(std::numeric_limits::max_exponent10 > 4946) { BOOST_CHECK_CLOSE_FRACTION(boost::math::binomial_coefficient(16441, 8151), SC_(5.928641856224322477306131563286843903129818155323061805272e4946), tolerance); } - else BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity) + else BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity && (std::numeric_limits::max_exponent10 < 4950)) { BOOST_CHECK_EQUAL(boost::math::binomial_coefficient(16441, 8151), std::numeric_limits::infinity()); }