From 9e189430901757f40b5afaa846ec7ba1f886849d Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 21 Jan 2024 16:58:08 +0000 Subject: [PATCH 01/26] Improve test coverage. Try and get all the special_functions/a*.hpp files up to 100%. --- include/boost/math/special_functions/airy.hpp | 4 ++-- include/boost/math/special_functions/atanh.hpp | 12 +++--------- test/acosh_test.hpp | 9 ++++++++- test/asinh_test.hpp | 5 +++++ test/atanh_test.hpp | 5 +++++ 5 files changed, 23 insertions(+), 12 deletions(-) diff --git a/include/boost/math/special_functions/airy.hpp b/include/boost/math/special_functions/airy.hpp index d7da0035d8..06eee92383 100644 --- a/include/boost/math/special_functions/airy.hpp +++ b/include/boost/math/special_functions/airy.hpp @@ -186,7 +186,7 @@ T airy_ai_zero_imp(int m, const Policy& pol) std::uintmax_t iterations_used = iterations_allowed; // Use a dynamic tolerance because the roots get closer the higher m gets. - T tolerance; + T tolerance; // LCOV_EXCL_LINE if (m <= 10) { tolerance = T(0.3F); } else if(m <= 100) { tolerance = T(0.1F); } @@ -238,7 +238,7 @@ T airy_bi_zero_imp(int m, const Policy& pol) std::uintmax_t iterations_used = iterations_allowed; // Use a dynamic tolerance because the roots get closer the higher m gets. - T tolerance; + T tolerance; // LCOV_EXCL_LINE if (m <= 10) { tolerance = T(0.3F); } else if(m <= 100) { tolerance = T(0.1F); } diff --git a/include/boost/math/special_functions/atanh.hpp b/include/boost/math/special_functions/atanh.hpp index 6204dc434f..543fb5fce3 100644 --- a/include/boost/math/special_functions/atanh.hpp +++ b/include/boost/math/special_functions/atanh.hpp @@ -40,21 +40,15 @@ namespace boost if(x < -1) { - return policies::raise_domain_error( - function, - "atanh requires x >= -1, but got x = %1%.", x, pol); + return policies::raise_domain_error(function, "atanh requires x >= -1, but got x = %1%.", x, pol); } else if(x > 1) { - return policies::raise_domain_error( - function, - "atanh requires x <= 1, but got x = %1%.", x, pol); + return policies::raise_domain_error(function, "atanh requires x <= 1, but got x = %1%.", x, pol); } else if((boost::math::isnan)(x)) { - return policies::raise_domain_error( - function, - "atanh requires -1 <= x <= 1, but got x = %1%.", x, pol); + return policies::raise_domain_error(function, "atanh requires -1 <= x <= 1, but got x = %1%.", x, pol); } else if(x < -1 + tools::epsilon()) { diff --git a/test/acosh_test.hpp b/test/acosh_test.hpp index 906025c3e9..0ef604ece8 100644 --- a/test/acosh_test.hpp +++ b/test/acosh_test.hpp @@ -83,7 +83,14 @@ BOOST_TEST_CASE_TEMPLATE_FUNCTION(acosh_test, T) { T inf = std::numeric_limits::infinity(); boost::math::policies::policy > pol; - BOOST_CHECK_EQUAL(boost::math::asinh(inf, pol), inf); + BOOST_CHECK_EQUAL(boost::math::acosh(inf, pol), inf); + } + x = -1; + BOOST_CHECK_THROW(boost::math::acosh(x), std::domain_error); + if (std::numeric_limits::has_quiet_NaN) + { + T n = std::numeric_limits::quiet_NaN(); + BOOST_CHECK_THROW(boost::math::acosh(n), std::domain_error); } } diff --git a/test/asinh_test.hpp b/test/asinh_test.hpp index 98aa55576e..c19a0e433e 100644 --- a/test/asinh_test.hpp +++ b/test/asinh_test.hpp @@ -65,6 +65,11 @@ BOOST_TEST_CASE_TEMPLATE_FUNCTION(asinh_test, T) BOOST_CHECK_EQUAL(boost::math::asinh(inf, pol), inf); BOOST_CHECK_EQUAL(boost::math::asinh(-inf, pol), -inf); } + if(std::numeric_limits::has_quiet_NaN) + { + T n = std::numeric_limits::quiet_NaN(); + BOOST_CHECK_THROW(boost::math::asinh(n), std::domain_error); + } } diff --git a/test/atanh_test.hpp b/test/atanh_test.hpp index e002402e84..e76ae6edd0 100644 --- a/test/atanh_test.hpp +++ b/test/atanh_test.hpp @@ -89,6 +89,11 @@ BOOST_TEST_CASE_TEMPLATE_FUNCTION(atanh_test, T) BOOST_MATH_CHECK_THROW(atanh(T(1)), std::overflow_error); BOOST_MATH_CHECK_THROW(atanh(T(-2)), std::domain_error); BOOST_MATH_CHECK_THROW(atanh(T(2)), std::domain_error); + if (std::numeric_limits::has_quiet_NaN) + { + T n = std::numeric_limits::quiet_NaN(); + BOOST_CHECK_THROW(boost::math::atanh(n), std::domain_error); + } } From 7431f8141c7057f52aa7c489bd62bf6096d6292f Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 22 Jan 2024 13:23:33 +0000 Subject: [PATCH 02/26] Improve bernoulli and bessel coverage. --- .../boost/math/special_functions/acosh.hpp | 4 +- .../boost/math/special_functions/asinh.hpp | 4 +- .../boost/math/special_functions/bessel.hpp | 48 ++++++++----------- test/test_bernoulli_constants.cpp | 5 ++ test/test_bessel_airy_zeros.cpp | 21 ++++++-- test/test_bessel_i.hpp | 10 ++++ test/test_bessel_j.hpp | 6 +++ test/test_bessel_k.hpp | 10 ++++ test/test_bessel_y.hpp | 17 +++++++ 9 files changed, 88 insertions(+), 37 deletions(-) diff --git a/include/boost/math/special_functions/acosh.hpp b/include/boost/math/special_functions/acosh.hpp index c601960fc3..63e8e2dff0 100644 --- a/include/boost/math/special_functions/acosh.hpp +++ b/include/boost/math/special_functions/acosh.hpp @@ -38,9 +38,7 @@ namespace boost if((x < 1) || (boost::math::isnan)(x)) { - return policies::raise_domain_error( - "boost::math::acosh<%1%>(%1%)", - "acosh requires x >= 1, but got x = %1%.", x, pol); + return policies::raise_domain_error("boost::math::acosh<%1%>(%1%)", "acosh requires x >= 1, but got x = %1%.", x, pol); } else if ((x - 1) >= tools::root_epsilon()) { diff --git a/include/boost/math/special_functions/asinh.hpp b/include/boost/math/special_functions/asinh.hpp index d66551e499..52362dd294 100644 --- a/include/boost/math/special_functions/asinh.hpp +++ b/include/boost/math/special_functions/asinh.hpp @@ -38,9 +38,7 @@ namespace boost if((boost::math::isnan)(x)) { - return policies::raise_domain_error( - "boost::math::asinh<%1%>(%1%)", - "asinh requires a finite argument, but got x = %1%.", x, pol); + return policies::raise_domain_error("boost::math::asinh<%1%>(%1%)", "asinh requires a finite argument, but got x = %1%.", x, pol); } if (x >= tools::forth_root_epsilon()) { diff --git a/include/boost/math/special_functions/bessel.hpp b/include/boost/math/special_functions/bessel.hpp index 5fe518a365..12e5884f4c 100644 --- a/include/boost/math/special_functions/bessel.hpp +++ b/include/boost/math/special_functions/bessel.hpp @@ -99,20 +99,23 @@ T cyl_bessel_j_imp(T v, T x, const bessel_no_int_tag& t, const Policy& pol) if(x < 0) { // better have integer v: - if(floor(v) == v) + if (floor(v) == v) { + // LCOV_EXCL_START + // This branch is hit by multiprecision types only, and is + // tested by our real_concept tests, but thee are excluded from coverage + // due to time constraints. T r = cyl_bessel_j_imp(v, T(-x), t, pol); - if(iround(v, pol) & 1) + if (iround(v, pol) & 1) r = -r; return r; + // LCOV_EXCL_STOP } else - return policies::raise_domain_error( - function, - "Got x = %1%, but we need x >= 0", x, pol); + return policies::raise_domain_error(function, "Got x = %1%, but we need x >= 0", x, pol); } - T result_J, y; + T result_J, y; // LCOV_EXCL_LINE bessel_jy(v, x, &result_J, &y, need_j, pol); return result_J; } @@ -143,9 +146,7 @@ inline T sph_bessel_j_imp(unsigned n, T x, const Policy& pol) { BOOST_MATH_STD_USING // ADL of std names if(x < 0) - return policies::raise_domain_error( - "boost::math::sph_bessel_j<%1%>(%1%,%1%)", - "Got x = %1%, but function requires x > 0.", x, pol); + return policies::raise_domain_error("boost::math::sph_bessel_j<%1%>(%1%,%1%)", "Got x = %1%, but function requires x > 0.", x, pol); // // Special case, n == 0 resolves down to the sinus cardinal of x: // @@ -190,9 +191,7 @@ T cyl_bessel_i_imp(T v, T x, const Policy& pol) return r; } else - return policies::raise_domain_error( - "boost::math::cyl_bessel_i<%1%>(%1%,%1%)", - "Got x = %1%, but we need x >= 0", x, pol); + return policies::raise_domain_error("boost::math::cyl_bessel_i<%1%>(%1%,%1%)", "Got x = %1%, but we need x >= 0", x, pol); } if(x == 0) { @@ -221,7 +220,7 @@ T cyl_bessel_i_imp(T v, T x, const Policy& pol) } if((v > 0) && (x / v < 0.25)) return bessel_i_small_z_series(v, x, pol); - T result_I, result_K; + T result_I, result_K; // LCOV_EXCL_LINE bessel_ik(v, x, &result_I, &result_K, need_i, pol); return result_I; } @@ -240,11 +239,9 @@ inline T cyl_bessel_k_imp(T v, T x, const bessel_no_int_tag& /* t */, const Poli if(x == 0) { return (v == 0) ? policies::raise_overflow_error(function, nullptr, pol) - : policies::raise_domain_error( - function, - "Got x = %1%, but we need x > 0", x, pol); + : policies::raise_domain_error(function, "Got x = %1%, but we need x > 0", x, pol); } - T result_I, result_K; + T result_I, result_K; // LCOV_EXCL_LINE bessel_ik(v, x, &result_I, &result_K, need_k, pol); return result_K; } @@ -278,11 +275,9 @@ inline T cyl_neumann_imp(T v, T x, const bessel_no_int_tag&, const Policy& pol) { return (v == 0) && (x == 0) ? policies::raise_overflow_error(function, nullptr, pol) - : policies::raise_domain_error( - function, - "Got x = %1%, but result is complex for x <= 0", x, pol); + : policies::raise_domain_error(function, "Got x = %1%, but result is complex for x <= 0", x, pol); } - T result_J, y; + T result_J, y; // LCOV_EXCL_LINE bessel_jy(v, x, &result_J, &y, need_y, pol); // // Post evaluation check for internal overflow during evaluation, @@ -290,7 +285,7 @@ inline T cyl_neumann_imp(T v, T x, const bessel_no_int_tag&, const Policy& pol) // is -INF: // if(!(boost::math::isfinite)(y)) - return -policies::raise_overflow_error(function, nullptr, pol); + return -policies::raise_overflow_error(function, nullptr, pol); // LCOV_EXCL_LINE defensive programming? Might be dead code now... return y; } @@ -329,9 +324,7 @@ inline T sph_neumann_imp(unsigned v, T x, const Policy& pol) // evaluate the function's definition directly: // if(x < 0) - return policies::raise_domain_error( - function, - "Got x = %1%, but function requires x > 0.", x, pol); + return policies::raise_domain_error(function, "Got x = %1%, but function requires x > 0.", x, pol); if(x < 2 * tools::min_value()) return -policies::raise_overflow_error(function, nullptr, pol); @@ -339,7 +332,7 @@ inline T sph_neumann_imp(unsigned v, T x, const Policy& pol) T result = cyl_neumann_imp(T(T(v)+0.5f), x, bessel_no_int_tag(), pol); T tx = sqrt(constants::pi() / (2 * x)); - if((tx > 1) && (tools::max_value() / tx < result)) + if((tx > 1) && (tools::max_value() / tx < fabs(result))) return -policies::raise_overflow_error(function, nullptr, pol); return result * tx; @@ -417,8 +410,7 @@ inline T cyl_bessel_j_zero_imp(T v, int m, const Policy& pol) if(number_of_iterations >= policies::get_max_root_iterations()) { - return policies::raise_evaluation_error(function, "Unable to locate root in a reasonable time:" - " Current best guess is %1%", jvm, Policy()); + return policies::raise_evaluation_error(function, "Unable to locate root in a reasonable time: Current best guess is %1%", jvm, Policy()); // LCOV_EXCL_LINE } return jvm; diff --git a/test/test_bernoulli_constants.cpp b/test/test_bernoulli_constants.cpp index 03ddc8c053..6d73d82a4c 100644 --- a/test/test_bernoulli_constants.cpp +++ b/test/test_bernoulli_constants.cpp @@ -199,6 +199,11 @@ void test(const char* name) BOOST_MATH_CHECK_THROW(boost::math::bernoulli_b2n(overflow_index, boost::math::policies::make_policy(boost::math::policies::overflow_error())), std::overflow_error); BOOST_MATH_CHECK_THROW(boost::math::tangent_t2n(overflow_index, boost::math::policies::make_policy(boost::math::policies::overflow_error())), std::overflow_error); #endif + BOOST_MATH_CHECK_THROW(boost::math::bernoulli_b2n(-1), std::domain_error); + BOOST_MATH_CHECK_THROW(boost::math::tangent_t2n(-1), std::domain_error); + std::vector v; + BOOST_MATH_CHECK_THROW(boost::math::bernoulli_b2n(-1, 5, std::back_inserter(v)), std::domain_error); + BOOST_MATH_CHECK_THROW(boost::math::tangent_t2n(-1, 5, std::back_inserter(v)), std::domain_error); } void test_real_concept_extra() diff --git a/test/test_bessel_airy_zeros.cpp b/test/test_bessel_airy_zeros.cpp index 69132053dc..2e5fbe937f 100644 --- a/test/test_bessel_airy_zeros.cpp +++ b/test/test_bessel_airy_zeros.cpp @@ -116,8 +116,7 @@ void test_bessel_zeros(RealType) using boost::math::isnan; BOOST_MATH_CHECK_THROW(cyl_bessel_j_zero(static_cast(0), 0), std::domain_error); - // BOOST_MATH_CHECK_THROW(cyl_bessel_j_zero(static_cast(-1), 2), std::domain_error); - // From 83051 negative orders are supported. + BOOST_MATH_CHECK_THROW(cyl_bessel_j_zero(static_cast(-1.5), 0), std::domain_error); // Abuse with infinity and max. if (std::numeric_limits::has_infinity) @@ -493,7 +492,23 @@ n | BOOST_CHECK_CLOSE_FRACTION(cyl_neumann_zero(static_cast(-3), 4), static_cast(14.623077742393873174076722507725200649352970569915L), tolerance); BOOST_CHECK_CLOSE_FRACTION(cyl_neumann_zero(static_cast(-3), 5), static_cast(17.818455232945520262553239064736739443380352162752L), tolerance); - { // Repeat rest using multiple zeros version. + /* + Table[N[BesselYZero[-5/2, n], 50], {n, 1, 5, 1}] + n | y_(-2.5000000000000000000000000000000000000000000000000, n) + 1 | 5.7634591968945497914064666539527350764090876841674 + 2 | 9.0950113304763551563376983279896952524009293663831 + 3 | 12.322940970566582051969567925329726061189423834915 + 4 | 5.7634591968945497914064666539527350764090876841674 + 5 | 9.0950113304763551563376983279896952524009293663831 + */ + + BOOST_CHECK_CLOSE_FRACTION(cyl_neumann_zero(static_cast(-2.5), 1), static_cast(5.7634591968945497914064666539527350764090876841674L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(cyl_neumann_zero(static_cast(-2.5), 2), static_cast(9.0950113304763551563376983279896952524009293663831L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(cyl_neumann_zero(static_cast(-2.5), 3), static_cast(12.322940970566582051969567925329726061189423834915L), tolerance); + //BOOST_CHECK_CLOSE_FRACTION(cyl_neumann_zero(static_cast(-2.5), 4), static_cast(5.7634591968945497914064666539527350764090876841674L), tolerance); + //BOOST_CHECK_CLOSE_FRACTION(cyl_neumann_zero(static_cast(-2.5), 5), static_cast(9.0950113304763551563376983279896952524009293663831L), tolerance); + + { // Repeat rest using multiple zeros version. std::vector zeros; cyl_neumann_zero(static_cast(0.0), 1, 3, std::back_inserter(zeros) ); BOOST_CHECK_CLOSE_FRACTION(zeros[0], static_cast(0.89357696627916752158488710205833824122514686193001L), tolerance); diff --git a/test/test_bessel_i.hpp b/test/test_bessel_i.hpp index 94df9ea737..ed565a27bd 100644 --- a/test/test_bessel_i.hpp +++ b/test/test_bessel_i.hpp @@ -176,5 +176,15 @@ void test_bessel(T, const char* name) if(0 != static_cast(ldexp(0.5, -700))) do_test_cyl_bessel_i(iv_large_data, name, "Bessel Iv: Mathworld Data (large values)"); + + // + // Special cases for full coverage: + // + BOOST_CHECK_THROW(boost::math::cyl_bessel_i(T(-2.5), T(-2.5)), std::domain_error); + T tolerance = boost::math::tools::epsilon() * 100; + if ((boost::math::tools::digits() <= std::numeric_limits::digits) && (std::numeric_limits::max_exponent > 1000)) + { + BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(T(0.5), T(710)), static_cast(3.3447452278080108123142599104927325061327359278058601201179e306L), tolerance); + } } diff --git a/test/test_bessel_j.hpp b/test/test_bessel_j.hpp index d2b1a937d9..2ed1d56c44 100644 --- a/test/test_bessel_j.hpp +++ b/test/test_bessel_j.hpp @@ -270,5 +270,11 @@ void test_bessel(T, const char* name) BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j(T(-2.5), T(0)), std::domain_error); BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j(T(-2.5), T(-2)), std::domain_error); BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j(T(2.5), T(-2)), std::domain_error); + + // + // special cases for code coverage: + // + BOOST_CHECK_EQUAL(boost::math::sph_bessel(200, T(0.5)), T(3.070403008048099934928128420285169174541102108657574230431e-497L)); + BOOST_MATH_CHECK_THROW(boost::math::sph_bessel(2, T(-2.0)), std::domain_error); } diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index 09c631a007..a4d8fb3d31 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -171,5 +171,15 @@ void test_bessel(T, const char* name) do_test_cyl_bessel_k(bessel_k_int_data, name, "Bessel Kn: Random Data"); #include "bessel_k_data.ipp" do_test_cyl_bessel_k(bessel_k_data, name, "Bessel Kv: Random Data"); + + // + // Extra test coverage: + // + BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(2), T(-1)), std::domain_error); + if (std::numeric_limits::has_infinity) + { + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_k(T(0), T(0)), std::numeric_limits::infinity()); + } + BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(1.25), T(0)), std::domain_error); } diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index 1618171e79..a2d111a0f8 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -214,5 +214,22 @@ void test_bessel(T, const char* name) #include "sph_neumann_data.ipp" do_test_sph_neumann_y(sph_neumann_data, name, "y: Random Data"); + + // + // Additional test coverage: + // + if (std::numeric_limits::has_infinity) + { + BOOST_CHECK_EQUAL(boost::math::cyl_neumann(T(0), T(0)), -std::numeric_limits::infinity()); + BOOST_CHECK_EQUAL(boost::math::sph_neumann(2, (std::numeric_limits::min)() * 1.5f), -std::numeric_limits::infinity()); + T small = 5.69289e-1645L; + if (small != 0) + { + BOOST_CHECK_EQUAL(boost::math::sph_neumann(2, small), -std::numeric_limits::infinity()); + } + } + BOOST_CHECK_THROW(boost::math::cyl_neumann(T(0), T(-1)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_neumann(T(2), T(0)), std::domain_error); + BOOST_CHECK_THROW(boost::math::sph_neumann(2, T(-2)), std::domain_error); } From bc975995ed201a9d992657d43d1d4fa60eef4cbc Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 22 Jan 2024 16:14:29 +0000 Subject: [PATCH 03/26] Correct bessel_J test case. --- test/test_bessel_j.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/test_bessel_j.hpp b/test/test_bessel_j.hpp index 2ed1d56c44..c45e65fccc 100644 --- a/test/test_bessel_j.hpp +++ b/test/test_bessel_j.hpp @@ -274,7 +274,8 @@ void test_bessel(T, const char* name) // // special cases for code coverage: // - BOOST_CHECK_EQUAL(boost::math::sph_bessel(200, T(0.5)), T(3.070403008048099934928128420285169174541102108657574230431e-497L)); + T tolerance = boost::math::tools::epsilon() * 200; + BOOST_CHECK_CLOSE_FRACTION(boost::math::sph_bessel(200, T(0.5)), T(3.070403008048099934928128420285169174541102108657574230431e-497L), tolerance); BOOST_MATH_CHECK_THROW(boost::math::sph_bessel(2, T(-2.0)), std::domain_error); } From 1bf40962734807c338de7eb1caf25b8328f8c895 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 22 Jan 2024 16:29:27 +0000 Subject: [PATCH 04/26] increase tolerance --- test/test_bessel_j.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_bessel_j.hpp b/test/test_bessel_j.hpp index c45e65fccc..6eb4e31c3f 100644 --- a/test/test_bessel_j.hpp +++ b/test/test_bessel_j.hpp @@ -274,7 +274,7 @@ void test_bessel(T, const char* name) // // special cases for code coverage: // - T tolerance = boost::math::tools::epsilon() * 200; + T tolerance = boost::math::tools::epsilon() * 2000; BOOST_CHECK_CLOSE_FRACTION(boost::math::sph_bessel(200, T(0.5)), T(3.070403008048099934928128420285169174541102108657574230431e-497L), tolerance); BOOST_MATH_CHECK_THROW(boost::math::sph_bessel(2, T(-2.0)), std::domain_error); } From 27b3f9ea093f2ef5e298d85b993551803f3472eb Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 22 Jan 2024 19:28:16 +0000 Subject: [PATCH 05/26] Begin improving ibeta coverage. --- .../boost/math/special_functions/bessel_prime.hpp | 11 ++++------- include/boost/math/special_functions/beta.hpp | 14 +++++++------- test/test_bessel_j.hpp | 2 +- test/test_bessel_y.hpp | 2 +- test/test_beta.hpp | 6 ++++++ test/test_ibeta.hpp | 10 ++++++++++ 6 files changed, 29 insertions(+), 16 deletions(-) diff --git a/include/boost/math/special_functions/bessel_prime.hpp b/include/boost/math/special_functions/bessel_prime.hpp index 6d8b466f2a..b9c8ce0fd8 100644 --- a/include/boost/math/special_functions/bessel_prime.hpp +++ b/include/boost/math/special_functions/bessel_prime.hpp @@ -28,10 +28,8 @@ inline T cyl_bessel_j_prime_imp(T v, T x, const Policy& pol) // // Prevent complex result: // - if (x < 0 && floor(v) != v) - return boost::math::policies::raise_domain_error( - function, - "Got x = %1%, but function requires x >= 0", x, pol); + if ((x < 0) && (floor(v) != v)) + return boost::math::policies::raise_domain_error(function, "Got x = %1%, but function requires x >= 0", x, pol); // // Special cases for x == 0: // @@ -43,9 +41,8 @@ inline T cyl_bessel_j_prime_imp(T v, T x, const Policy& pol) return static_cast(-0.5); else if (floor(v) == v || v > 1) return 0; - else return boost::math::policies::raise_domain_error( - function, - "Got x = %1%, but function is indeterminate for this order", x, pol); + else + return boost::math::policies::raise_domain_error(function, "Got x = %1%, but function is indeterminate for this order", x, pol); } // // Special case for large x: use asymptotic expansion: diff --git a/include/boost/math/special_functions/beta.hpp b/include/boost/math/special_functions/beta.hpp index f15e157324..243c21cacb 100644 --- a/include/boost/math/special_functions/beta.hpp +++ b/include/boost/math/special_functions/beta.hpp @@ -331,7 +331,7 @@ T ibeta_power_terms(T a, { l += log(result); if(l >= tools::log_max_value()) - return policies::raise_overflow_error(function, nullptr, pol); + return policies::raise_overflow_error(function, nullptr, pol); // LCOV_EXCL_LINE we can probably never get here, probably! result = exp(l); } else @@ -347,7 +347,7 @@ T ibeta_power_terms(T a, { l += log(result); if(l >= tools::log_max_value()) - return policies::raise_overflow_error(function, nullptr, pol); + return policies::raise_overflow_error(function, nullptr, pol); // LCOV_EXCL_LINE we can probably never get here, probably! result = exp(l); } else @@ -386,7 +386,7 @@ T ibeta_power_terms(T a, { l2 += l1 + log(result); if(l2 >= tools::log_max_value()) - return policies::raise_overflow_error(function, nullptr, pol); + return policies::raise_overflow_error(function, nullptr, pol); // LCOV_EXCL_LINE we can probably never get here, probably! result = exp(l2); } } @@ -404,7 +404,7 @@ T ibeta_power_terms(T a, { l2 += l1 + log(result); if(l2 >= tools::log_max_value()) - return policies::raise_overflow_error(function, nullptr, pol); + return policies::raise_overflow_error(function, nullptr, pol); // LCOV_EXCL_LINE we can probably never get here, probably! result = exp(l2); } } @@ -423,9 +423,9 @@ T ibeta_power_terms(T a, if (0 == result) { if ((a > 1) && (x == 0)) - return result; // true zero + return result; // true zero LCOV_EXCL_LINE we can probably never get here if ((b > 1) && (y == 0)) - return result; // true zero + return result; // true zero LCOV_EXCL_LINE we can probably never get here return boost::math::policies::raise_underflow_error(function, nullptr, pol); } @@ -666,7 +666,7 @@ T ibeta_series(T a, T b, T x, T s0, const Lanczos&, bool normalised, T* p_deriva result = Lanczos::lanczos_sum_expG_scaled(c) / (Lanczos::lanczos_sum_expG_scaled(a) * Lanczos::lanczos_sum_expG_scaled(b)); if (!(boost::math::isfinite)(result)) - result = 0; + result = 0; // LCOV_EXCL_LINE we can probably never get here, covered already above? T l1 = log(cgh / bgh) * (b - 0.5f); T l2 = log(x * cgh / agh) * a; diff --git a/test/test_bessel_j.hpp b/test/test_bessel_j.hpp index 6eb4e31c3f..96658c1544 100644 --- a/test/test_bessel_j.hpp +++ b/test/test_bessel_j.hpp @@ -275,7 +275,7 @@ void test_bessel(T, const char* name) // special cases for code coverage: // T tolerance = boost::math::tools::epsilon() * 2000; - BOOST_CHECK_CLOSE_FRACTION(boost::math::sph_bessel(200, T(0.5)), T(3.070403008048099934928128420285169174541102108657574230431e-497L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(boost::math::sph_bessel(200, T(0.5)), SC_(3.070403008048099934928128420285169174541102108657574230431e-497), tolerance); BOOST_MATH_CHECK_THROW(boost::math::sph_bessel(2, T(-2.0)), std::domain_error); } diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index a2d111a0f8..0262431cf4 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -221,7 +221,7 @@ void test_bessel(T, const char* name) if (std::numeric_limits::has_infinity) { BOOST_CHECK_EQUAL(boost::math::cyl_neumann(T(0), T(0)), -std::numeric_limits::infinity()); - BOOST_CHECK_EQUAL(boost::math::sph_neumann(2, (std::numeric_limits::min)() * 1.5f), -std::numeric_limits::infinity()); + BOOST_CHECK_EQUAL(boost::math::sph_neumann(2, boost::math::tools::min_value() * 1.5f), -std::numeric_limits::infinity()); T small = 5.69289e-1645L; if (small != 0) { diff --git a/test/test_beta.hpp b/test/test_beta.hpp index b7ec01769d..63a07d18f5 100644 --- a/test/test_beta.hpp +++ b/test/test_beta.hpp @@ -97,11 +97,17 @@ void test_spots(T) BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(4), static_cast(1)), static_cast(0.25), tolerance); BOOST_CHECK_CLOSE(::boost::math::beta(small, static_cast(4)), 1/small, tolerance); BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(4), small), 1/small, tolerance); + BOOST_CHECK_CLOSE(::boost::math::beta(small, static_cast(4)), 1/small, tolerance); + BOOST_CHECK_CLOSE(::boost::math::beta(small, small / 2), boost::math::tgamma(small) * boost::math::tgamma(small / 2) / boost::math::tgamma(small + small / 2), tolerance); BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(4), static_cast(20)), static_cast(0.00002823263692828910220214568040654997176736L), tolerance); if ((std::numeric_limits::digits < 100) && (std::numeric_limits::digits != 0)) { // Inexact input, so disable for ultra precise long doubles: BOOST_CHECK_CLOSE(::boost::math::beta(static_cast(0.0125L), static_cast(0.000023L)), static_cast(43558.24045647538375006349016083320744662L), tolerance * 2); } + BOOST_CHECK_THROW(boost::math::beta(static_cast(0), static_cast(1)), std::domain_error); + BOOST_CHECK_THROW(boost::math::beta(static_cast(-1), static_cast(1)), std::domain_error); + BOOST_CHECK_THROW(boost::math::beta(static_cast(1), static_cast(-1)), std::domain_error); + BOOST_CHECK_THROW(boost::math::beta(static_cast(1), static_cast(0)), std::domain_error); } diff --git a/test/test_ibeta.hpp b/test/test_ibeta.hpp index 005cd1e52b..7c951d614f 100644 --- a/test/test_ibeta.hpp +++ b/test/test_ibeta.hpp @@ -458,5 +458,15 @@ void test_spots(T) static_cast(4.5), ldexp(static_cast(1), -557)), static_cast(5.24647512910420109893867082626308082567071751558842352760e-167L), tolerance * 20); + + + T tiny = boost::math::tools::min_value() / 2; + T small = boost::math::tools::epsilon(); + if (tiny != 0) + { + BOOST_CHECK_EQUAL(boost::math::ibeta(tiny, small, small), 1); + } + BOOST_CHECK_EQUAL(boost::math::ibeta(static_cast(2), static_cast(1), static_cast(0)), 0); + BOOST_CHECK_EQUAL(boost::math::ibeta(static_cast(1), static_cast(2), static_cast(0)), 0); } From 36496d4fb72327a967b43c3df1eb38b3ecf7ce60 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 23 Jan 2024 12:18:10 +0000 Subject: [PATCH 06/26] Correct sign of cyl_neumann(0,0) result in multiprecision case. --- include/boost/math/special_functions/bessel.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/math/special_functions/bessel.hpp b/include/boost/math/special_functions/bessel.hpp index 12e5884f4c..e5ac852bd8 100644 --- a/include/boost/math/special_functions/bessel.hpp +++ b/include/boost/math/special_functions/bessel.hpp @@ -274,7 +274,7 @@ inline T cyl_neumann_imp(T v, T x, const bessel_no_int_tag&, const Policy& pol) if(x <= 0) { return (v == 0) && (x == 0) ? - policies::raise_overflow_error(function, nullptr, pol) + -policies::raise_overflow_error(function, nullptr, pol) : policies::raise_domain_error(function, "Got x = %1%, but result is complex for x <= 0", x, pol); } T result_J, y; // LCOV_EXCL_LINE From 317b7a64e45c9693523b5434339b44b7a3698606 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 23 Jan 2024 17:18:25 +0000 Subject: [PATCH 07/26] More Bessel function coverage. Remove I0 initializers and rely on C++11 thread safe static const initialization. --- .../math/special_functions/bernoulli.hpp | 4 +- .../boost/math/special_functions/bessel.hpp | 9 +-- .../math/special_functions/bessel_prime.hpp | 29 +++----- .../special_functions/detail/bessel_i0.hpp | 66 +++++++------------ test/test_bessel_i.hpp | 12 +++- test/test_bessel_i_prime.hpp | 6 ++ test/test_bessel_j_prime.hpp | 1 + test/test_bessel_k.hpp | 1 + test/test_bessel_k_prime.hpp | 5 ++ test/test_bessel_y.hpp | 1 + test/test_bessel_y_prime.hpp | 8 +++ 11 files changed, 70 insertions(+), 72 deletions(-) diff --git a/include/boost/math/special_functions/bernoulli.hpp b/include/boost/math/special_functions/bernoulli.hpp index d77a52089e..102b49399e 100644 --- a/include/boost/math/special_functions/bernoulli.hpp +++ b/include/boost/math/special_functions/bernoulli.hpp @@ -88,7 +88,7 @@ inline OutputIterator bernoulli_b2n(const int start_index, if(start_index < 0) { *out_it = policies::raise_domain_error("boost::math::bernoulli_b2n<%1%>", "Index should be >= 0 but got %1%", T(start_index), pol); - return ++out_it; + return ++out_it; // LCOV_EXCL_LINE we don't reach here, previous line throws. } return boost::math::detail::bernoulli_number_imp(out_it, start_index, number_of_bernoullis_b2n, pol, tag_type()); @@ -130,7 +130,7 @@ inline OutputIterator tangent_t2n(const int start_index, if(start_index < 0) { *out_it = policies::raise_domain_error("boost::math::tangent_t2n<%1%>", "Index should be >= 0 but got %1%", T(start_index), pol); - return ++out_it; + return ++out_it; // LCOV_EXCL_LINE we don't reach here, previous line throws. } return boost::math::detail::get_bernoulli_numbers_cache().copy_tangent_numbers(out_it, start_index, number_of_tangent_t2n, pol); diff --git a/include/boost/math/special_functions/bessel.hpp b/include/boost/math/special_functions/bessel.hpp index e5ac852bd8..c9dd3a2a0a 100644 --- a/include/boost/math/special_functions/bessel.hpp +++ b/include/boost/math/special_functions/bessel.hpp @@ -232,9 +232,7 @@ inline T cyl_bessel_k_imp(T v, T x, const bessel_no_int_tag& /* t */, const Poli BOOST_MATH_STD_USING if(x < 0) { - return policies::raise_domain_error( - function, - "Got x = %1%, but we need x > 0", x, pol); + return policies::raise_domain_error(function, "Got x = %1%, but we need x > 0", x, pol); } if(x == 0) { @@ -274,7 +272,7 @@ inline T cyl_neumann_imp(T v, T x, const bessel_no_int_tag&, const Policy& pol) if(x <= 0) { return (v == 0) && (x == 0) ? - -policies::raise_overflow_error(function, nullptr, pol) + -policies::raise_overflow_error(function, nullptr, pol) // LCOV_EXCL_LINE MP case only here, not tested in code coverage as it takes too long. : policies::raise_domain_error(function, "Got x = %1%, but result is complex for x <= 0", x, pol); } T result_J, y; // LCOV_EXCL_LINE @@ -488,8 +486,7 @@ inline T cyl_neumann_zero_imp(T v, int m, const Policy& pol) if(number_of_iterations >= policies::get_max_root_iterations()) { - return policies::raise_evaluation_error(function, "Unable to locate root in a reasonable time:" - " Current best guess is %1%", yvm, Policy()); + return policies::raise_evaluation_error(function, "Unable to locate root in a reasonable time: Current best guess is %1%", yvm, Policy()); //LCOV_EXCL_LINE } return yvm; diff --git a/include/boost/math/special_functions/bessel_prime.hpp b/include/boost/math/special_functions/bessel_prime.hpp index b9c8ce0fd8..ba71562885 100644 --- a/include/boost/math/special_functions/bessel_prime.hpp +++ b/include/boost/math/special_functions/bessel_prime.hpp @@ -83,9 +83,7 @@ inline T sph_bessel_j_prime_imp(unsigned v, T x, const Policy& pol) // Prevent complex result: // if (x < 0) - return boost::math::policies::raise_domain_error( - function, - "Got x = %1%, but function requires x >= 0.", x, pol); + return boost::math::policies::raise_domain_error(function, "Got x = %1%, but function requires x >= 0.", x, pol); // // Special case for v == 0: // @@ -96,9 +94,7 @@ inline T sph_bessel_j_prime_imp(unsigned v, T x, const Policy& pol) // Special case for x == 0 and v > 0: // if (x == 0) - return boost::math::policies::raise_domain_error( - function, - "Got x = %1%, but function is indeterminate for this order", x, pol); + return boost::math::policies::raise_domain_error(function, "Got x = %1%, but function is indeterminate for this order", x, pol); // // Default case: // @@ -114,9 +110,7 @@ inline T cyl_bessel_i_prime_imp(T v, T x, const Policy& pol) // Prevent complex result: // if (x < 0 && floor(v) != v) - return boost::math::policies::raise_domain_error( - function, - "Got x = %1%, but function requires x >= 0", x, pol); + return boost::math::policies::raise_domain_error(function, "Got x = %1%, but function requires x >= 0", x, pol); // // Special cases for x == 0: // @@ -126,9 +120,8 @@ inline T cyl_bessel_i_prime_imp(T v, T x, const Policy& pol) return static_cast(0.5); else if (floor(v) == v || v > 1) return 0; - else return boost::math::policies::raise_domain_error( - function, - "Got x = %1%, but function is indeterminate for this order", x, pol); + else + return boost::math::policies::raise_domain_error(function, "Got x = %1%, but function is indeterminate for this order", x, pol); } // // Special case for v == 0: @@ -148,9 +141,7 @@ inline T cyl_bessel_k_prime_imp(T v, T x, const Policy& pol) // Prevent complex and indeterminate results: // if (x <= 0) - return boost::math::policies::raise_domain_error( - "boost::math::cyl_bessel_k_prime<%1%>(%1%,%1%)", - "Got x = %1%, but function requires x > 0", x, pol); + return boost::math::policies::raise_domain_error("boost::math::cyl_bessel_k_prime<%1%>(%1%,%1%)", "Got x = %1%, but function requires x > 0", x, pol); // // Special case for v == 0: // @@ -170,9 +161,7 @@ inline T cyl_neumann_prime_imp(T v, T x, const Policy& pol) // Prevent complex and indeterminate results: // if (x <= 0) - return boost::math::policies::raise_domain_error( - "boost::math::cyl_neumann_prime<%1%>(%1%,%1%)", - "Got x = %1%, but function requires x > 0", x, pol); + return boost::math::policies::raise_domain_error("boost::math::cyl_neumann_prime<%1%>(%1%,%1%)", "Got x = %1%, but function requires x > 0", x, pol); // // Special case for large x: use asymptotic expansion: // @@ -205,9 +194,7 @@ inline T sph_neumann_prime_imp(unsigned v, T x, const Policy& pol) // Prevent complex and indeterminate result: // if (x <= 0) - return boost::math::policies::raise_domain_error( - "boost::math::sph_neumann_prime<%1%>(%1%,%1%)", - "Got x = %1%, but function requires x > 0.", x, pol); + return boost::math::policies::raise_domain_error("boost::math::sph_neumann_prime<%1%>(%1%,%1%)", "Got x = %1%, but function requires x > 0.", x, pol); // // Special case for v == 0: // diff --git a/include/boost/math/special_functions/detail/bessel_i0.hpp b/include/boost/math/special_functions/detail/bessel_i0.hpp index 4d36110da8..af6e8c3794 100644 --- a/include/boost/math/special_functions/detail/bessel_i0.hpp +++ b/include/boost/math/special_functions/detail/bessel_i0.hpp @@ -37,45 +37,6 @@ namespace boost { namespace math { namespace detail{ template T bessel_i0(const T& x); -template -struct bessel_i0_initializer -{ - struct init - { - init() - { - do_init(tag()); - } - static void do_init(const std::integral_constant&) - { - bessel_i0(T(1)); - bessel_i0(T(8)); - bessel_i0(T(12)); - bessel_i0(T(40)); - bessel_i0(T(101)); - } - static void do_init(const std::integral_constant&) - { - bessel_i0(T(1)); - bessel_i0(T(10)); - bessel_i0(T(20)); - bessel_i0(T(40)); - bessel_i0(T(101)); - } - template - static void do_init(const U&) {} - void force_instantiate()const {} - }; - static const init initializer; - static void force_instantiate() - { - initializer.force_instantiate(); - } -}; - -template -const typename bessel_i0_initializer::init bessel_i0_initializer::initializer; - template T bessel_i0_imp(const T&, const std::integral_constant&) { @@ -220,6 +181,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) // Bessel I0 over[10 ^ -16, 7.75] // Max error in interpolated form : 3.899e-20 // Max Error found at float80 precision = Poly : 1.770840e-19 + // LCOV_EXCL_START static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 9.99999999999999999961011629e-01), BOOST_MATH_BIG_CONSTANT(T, 64, 2.50000000000000001321873912e-01), @@ -238,6 +200,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 64, 5.15976668870980234582896010e-25), BOOST_MATH_BIG_CONSTANT(T, 64, 3.46240478946376069211156548e-27) }; + // LCOV_EXCL_STOP T a = x * x / 4; return a * boost::math::tools::evaluate_polynomial(P, a) + 1; } @@ -247,6 +210,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) // Expected Error Term : -6.903e-21 // Maximum Relative Change in Control Points : 1.631e-04 // Max Error found at float80 precision = Poly : 7.811948e-21 + // LCOV_EXCL_START static const T Y = 4.051098823547363281250e-01f; static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -6.158081780620616479492e-03), @@ -263,6 +227,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 64, -1.601530760654337045917e+06), BOOST_MATH_BIG_CONSTANT(T, 64, 9.504921137873298402679e+05) }; + // LCOV_EXCL_STOP return exp(x) * (boost::math::tools::evaluate_polynomial(P, T(1 / x)) + Y) / sqrt(x); } else if(x < 15) @@ -271,6 +236,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) // Expected Error Term : -4.025e-21 // Maximum Relative Change in Control Points : 1.304e-03 // Max Error found at float80 precision = Poly : 2.303527e-20 + // LCOV_EXCL_START static const T Y = 4.033188819885253906250e-01f; static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -4.376373876116109401062e-03), @@ -288,12 +254,14 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 64, 5.227776578828667629347e+07), BOOST_MATH_BIG_CONSTANT(T, 64, -4.727797957441040896878e+07) }; + // LCOV_EXCL_STOP return exp(x) * (boost::math::tools::evaluate_polynomial(P, T(1 / x)) + Y) / sqrt(x); } else if(x < 50) { // Max error in interpolated form: 1.035e-21 // Max Error found at float80 precision = Poly: 1.885872e-21 + // LCOV_EXCL_START static const T Y = 4.011702537536621093750e-01f; static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, -2.227973351806078464328e-03), @@ -314,6 +282,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 64, -4.441995678177349895640e+09), BOOST_MATH_BIG_CONSTANT(T, 64, 4.482292669974971387738e+09) }; + // LCOV_EXCL_STOP return exp(x) * (boost::math::tools::evaluate_polynomial(P, T(1 / x)) + Y) / sqrt(x); } else @@ -321,6 +290,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) // Bessel I0 over[50, INF] // Max error in interpolated form : 5.587e-20 // Max Error found at float80 precision = Poly : 8.776852e-20 + // LCOV_EXCL_START static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 64, 3.98942280401432677955074061e-01), BOOST_MATH_BIG_CONSTANT(T, 64, 4.98677850501789875615574058e-02), @@ -341,6 +311,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 64, 3.27310000726207055200805893e+10), BOOST_MATH_BIG_CONSTANT(T, 64, -6.64365417189215599168817064e+10) }; + // LCOV_EXCL_STOP T ex = exp(x / 2); T result = ex * boost::math::tools::evaluate_polynomial(P, T(1 / x)) / sqrt(x); result *= ex; @@ -357,6 +328,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) // Bessel I0 over[10 ^ -34, 7.75] // Max error in interpolated form : 1.274e-34 // Max Error found at float128 precision = Poly : 3.096091e-34 + // LCOV_EXCL_START static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 113, 1.0000000000000000000000000000000001273856e+00), BOOST_MATH_BIG_CONSTANT(T, 113, 2.4999999999999999999999999999999107477496e-01), @@ -382,6 +354,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 113, 7.4684706070226893763741850944911705726436e-43), BOOST_MATH_BIG_CONSTANT(T, 113, 2.0210715309399646335858150349406935414314e-45) }; + // LCOV_EXCL_STOP T a = x * x / 4; return a * boost::math::tools::evaluate_polynomial(P, a) + 1; } @@ -390,6 +363,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) // Bessel I0 over[7.75, 15] // Max error in interpolated form : 7.534e-35 // Max Error found at float128 precision = Poly : 6.123912e-34 + // LCOV_EXCL_START static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 113, 9.9999999999999999992388573069504617493518e-01), BOOST_MATH_BIG_CONSTANT(T, 113, 2.5000000000000000007304739268173096975340e-01), @@ -420,6 +394,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) -BOOST_MATH_BIG_CONSTANT(T, 113, 5.1255595184052024349371058585102280860878e-57), BOOST_MATH_BIG_CONSTANT(T, 113, 3.4652470895944157957727948355523715335882e-59) }; + // LCOV_EXCL_STOP T a = x * x / 4; return a * boost::math::tools::evaluate_polynomial(P, a) + 1; } @@ -427,6 +402,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) { // Max error in interpolated form : 1.808e-34 // Max Error found at float128 precision = Poly : 2.399403e-34 + // LCOV_EXCL_START static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 113, 3.9894228040870793650581242239624530714032e-01), BOOST_MATH_BIG_CONSTANT(T, 113, 4.9867780576714783790784348982178607842250e-02), @@ -458,7 +434,9 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 113, 1.2368879358870281916900125550129211146626e+28), BOOST_MATH_BIG_CONSTANT(T, 113, -2.8296235063297831758204519071113999839858e+28), BOOST_MATH_BIG_CONSTANT(T, 113, 4.1253861666023020670144616019148954773662e+28), - BOOST_MATH_BIG_CONSTANT(T, 113, -2.8809536950051955163648980306847791014734e+28) }; + BOOST_MATH_BIG_CONSTANT(T, 113, -2.8809536950051955163648980306847791014734e+28) + }; + // LCOV_EXCL_STOP return exp(x) * boost::math::tools::evaluate_polynomial(P, T(1 / x)) / sqrt(x); } else if(x < 100) @@ -466,6 +444,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) // Bessel I0 over[30, 100] // Max error in interpolated form : 1.487e-34 // Max Error found at float128 precision = Poly : 1.929924e-34 + // LCOV_EXCL_START static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 113, 3.9894228040143267793996798658172135362278e-01), BOOST_MATH_BIG_CONSTANT(T, 113, 4.9867785050179084714910130342157246539820e-02), @@ -492,6 +471,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 113, -2.0375525734060401555856465179734887312420e+16), BOOST_MATH_BIG_CONSTANT(T, 113, 5.6392664899881014534361728644608549445131e+16) }; + // LCOV_EXCL_STOP return exp(x) * boost::math::tools::evaluate_polynomial(P, T(1 / x)) / sqrt(x); } else @@ -499,6 +479,7 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) // Bessel I0 over[100, INF] // Max error in interpolated form : 5.459e-35 // Max Error found at float128 precision = Poly : 1.472240e-34 + // LCOV_EXCL_START static const T P[] = { BOOST_MATH_BIG_CONSTANT(T, 113, 3.9894228040143267793994605993438166526772e-01), BOOST_MATH_BIG_CONSTANT(T, 113, 4.9867785050179084742493257495245185241487e-02), @@ -515,7 +496,9 @@ T bessel_i0_imp(const T& x, const std::integral_constant&) BOOST_MATH_BIG_CONSTANT(T, 113, 1.2076909538525038580501368530598517194748e+03), BOOST_MATH_BIG_CONSTANT(T, 113, 7.5684635141332367730007149159063086133399e+03), BOOST_MATH_BIG_CONSTANT(T, 113, 3.5178192543258299267923025833141286569141e+04), - BOOST_MATH_BIG_CONSTANT(T, 113, 6.2966297919851965784482163987240461837728e+05) }; + BOOST_MATH_BIG_CONSTANT(T, 113, 6.2966297919851965784482163987240461837728e+05) + }; + // LCOV_EXCL_STOP T ex = exp(x / 2); T result = ex * boost::math::tools::evaluate_polynomial(P, T(1 / x)) / sqrt(x); result *= ex; @@ -554,7 +537,6 @@ inline T bessel_i0(const T& x) 113 : -1 > tag_type; - bessel_i0_initializer::force_instantiate(); return bessel_i0_imp(x, tag_type()); } diff --git a/test/test_bessel_i.hpp b/test/test_bessel_i.hpp index ed565a27bd..46dde6ef28 100644 --- a/test/test_bessel_i.hpp +++ b/test/test_bessel_i.hpp @@ -184,7 +184,17 @@ void test_bessel(T, const char* name) T tolerance = boost::math::tools::epsilon() * 100; if ((boost::math::tools::digits() <= std::numeric_limits::digits) && (std::numeric_limits::max_exponent > 1000)) { - BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(T(0.5), T(710)), static_cast(3.3447452278080108123142599104927325061327359278058601201179e306L), tolerance); + BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(T(0.5), T(710)), SC_(3.3447452278080108123142599104927325061327359278058601201179e306), tolerance); + } +#if LDBL_MAX_EXP >= 11356 + if (std::numeric_limits::max_exponent >= 11356) + { + BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(T(0.5), T(11357)), SC_(7.173138695269929329584326974917488634629578339622112563648e4929), tolerance); + } +#endif + if (std::numeric_limits::max_exponent > 1000) + { + BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(0, T(700)), SC_(1.5295933476718737363162072288904508649662689614661164851272e302), tolerance); } } diff --git a/test/test_bessel_i_prime.hpp b/test/test_bessel_i_prime.hpp index 50baf7257d..93998c6a24 100644 --- a/test/test_bessel_i_prime.hpp +++ b/test/test_bessel_i_prime.hpp @@ -179,5 +179,11 @@ void test_bessel(T, const char* name) if(0 != static_cast(ldexp(static_cast(0.5), -700))) do_test_cyl_bessel_i_prime(iv_prime_large_data, name, "Bessel I'v: Mathworld Data (large values)"); + + // + // Special cases for extra coverage: + // + BOOST_CHECK_THROW(boost::math::cyl_bessel_i_prime(T(2.5), T(-1)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_bessel_i_prime(T(0.25), T(0)), std::domain_error); } diff --git a/test/test_bessel_j_prime.hpp b/test/test_bessel_j_prime.hpp index 32d1d34a84..77c97a673c 100644 --- a/test/test_bessel_j_prime.hpp +++ b/test/test_bessel_j_prime.hpp @@ -273,5 +273,6 @@ void test_bessel_prime(T, const char* name) BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j_prime(T(-2.5), T(0)), std::domain_error); BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j_prime(T(-2.5), T(-2)), std::domain_error); BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j_prime(T(2.5), T(-2)), std::domain_error); + BOOST_MATH_CHECK_THROW(boost::math::sph_bessel_j_prime(2, T(-2)), std::domain_error); } diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index a4d8fb3d31..38e005f50a 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -176,6 +176,7 @@ void test_bessel(T, const char* name) // Extra test coverage: // BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(2), T(-1)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(2.2), T(-1)), std::domain_error); if (std::numeric_limits::has_infinity) { BOOST_CHECK_EQUAL(boost::math::cyl_bessel_k(T(0), T(0)), std::numeric_limits::infinity()); diff --git a/test/test_bessel_k_prime.hpp b/test/test_bessel_k_prime.hpp index 3474d3e338..a434bae74d 100644 --- a/test/test_bessel_k_prime.hpp +++ b/test/test_bessel_k_prime.hpp @@ -175,5 +175,10 @@ void test_bessel(T, const char* name) do_test_cyl_bessel_k_prime(bessel_k_prime_int_data, name, "Bessel K'n: Random Data"); #include "bessel_k_prime_data.ipp" do_test_cyl_bessel_k_prime(bessel_k_prime_data, name, "Bessel K'v: Random Data"); + // + // Extra cases for full test coverage: + // + BOOST_CHECK_THROW(boost::math::cyl_bessel_k_prime(T(2.5), T(0)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_bessel_k_prime(T(2), T(0)), std::domain_error); } diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index 0262431cf4..a488bbad97 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -229,6 +229,7 @@ void test_bessel(T, const char* name) } } BOOST_CHECK_THROW(boost::math::cyl_neumann(T(0), T(-1)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_neumann(T(0.2), T(-1)), std::domain_error); BOOST_CHECK_THROW(boost::math::cyl_neumann(T(2), T(0)), std::domain_error); BOOST_CHECK_THROW(boost::math::sph_neumann(2, T(-2)), std::domain_error); } diff --git a/test/test_bessel_y_prime.hpp b/test/test_bessel_y_prime.hpp index e5a9aea25c..74600bece7 100644 --- a/test/test_bessel_y_prime.hpp +++ b/test/test_bessel_y_prime.hpp @@ -217,5 +217,13 @@ void test_bessel_prime(T, const char* name) #include "sph_neumann_prime_data.ipp" do_test_sph_neumann_y_prime(sph_neumann_prime_data, name, "y': Random Data"); + + // + // More cases for full test coverage: + // + BOOST_CHECK_THROW(boost::math::cyl_neumann_prime(T(2.5), T(0)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_neumann_prime(T(2.5), T(-1)), std::domain_error); + BOOST_CHECK_THROW(boost::math::sph_neumann_prime(2, T(0)), std::domain_error); + BOOST_CHECK_THROW(boost::math::sph_neumann_prime(2, T(-1)), std::domain_error); } From c046f713bb34d841a72cd485e11059f977c5a1bb Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 23 Jan 2024 18:03:35 +0000 Subject: [PATCH 08/26] Correct typo. --- test/test_bessel_j_prime.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_bessel_j_prime.hpp b/test/test_bessel_j_prime.hpp index 77c97a673c..ed9d53d69b 100644 --- a/test/test_bessel_j_prime.hpp +++ b/test/test_bessel_j_prime.hpp @@ -273,6 +273,6 @@ void test_bessel_prime(T, const char* name) BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j_prime(T(-2.5), T(0)), std::domain_error); BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j_prime(T(-2.5), T(-2)), std::domain_error); BOOST_MATH_CHECK_THROW(boost::math::cyl_bessel_j_prime(T(2.5), T(-2)), std::domain_error); - BOOST_MATH_CHECK_THROW(boost::math::sph_bessel_j_prime(2, T(-2)), std::domain_error); + BOOST_MATH_CHECK_THROW(boost::math::sph_bessel_prime(2, T(-2)), std::domain_error); } From 045a87e792714e6130180ebac0bc3c70ca0067e1 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Wed, 24 Jan 2024 16:43:56 +0000 Subject: [PATCH 09/26] Refactor test coverage to put concept checks in their own group. And don't try and run concept checks with test coverage collection. --- .drone.star | 4 +- test/Jamfile.v2 | 433 ++++++++++++++++++++++++------------------------ 2 files changed, 222 insertions(+), 215 deletions(-) diff --git a/.drone.star b/.drone.star index 6b9ee76629..3a6a4739db 100644 --- a/.drone.star +++ b/.drone.star @@ -15,8 +15,8 @@ windowsglobalimage="cppalliance/dronevs2019" def main(ctx): - things_to_test = [ "special_fun", "distribution_tests", "mp", "misc", "interpolators", "quadrature", "autodiff", "long-running-tests", "float128_tests" ] - gcc13_things_to_test = [ "special_fun", "distribution_tests", "mp", "misc", "interpolators", "quadrature", "autodiff", "long-running-tests", "float128_tests", "new_floats" ] + things_to_test = [ "special_fun", "distribution_tests", "mp", "misc", "interpolators", "quadrature", "autodiff", "long-running-tests", "float128_tests", "concepts" ] + gcc13_things_to_test = [ "special_fun", "distribution_tests", "mp", "misc", "interpolators", "quadrature", "autodiff", "long-running-tests", "float128_tests", "concepts", "new_floats" ] sanitizer_test = [ "special_fun", "distribution_tests", "misc", "interpolators", "quadrature", "float128_tests" ] gnu_5_stds = [ "gnu++14", "c++14" ] gnu_6_stds = [ "gnu++14", "c++14", "gnu++17", "c++17" ] diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index f40aa6b9b8..1c79585bbf 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -849,42 +849,6 @@ test-suite distribution_tests : [ run test_uniform.cpp pch ../../test/build//boost_unit_test_framework ] [ run test_weibull.cpp ../../test/build//boost_unit_test_framework ] - [ run compile_test/dist_bernoulli_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_beta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_binomial_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_cauchy_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_chi_squared_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_complement_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_exponential_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_extreme_val_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_find_location_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_find_scale_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_fisher_f_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_gamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_inv_gamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_inv_chi_sq_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_hyperexponential_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_hypergeo_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_laplace_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_logistic_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_lognormal_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_neg_binom_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_nc_chi_squ_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_nc_beta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_nc_f_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_nc_t_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_normal_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_poisson_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_students_t_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_triangular_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_uniform_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_weibull_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/distribution_concept_check.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_arcsine_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/dist_empirical_cumulative_dist_func_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_inv_gaussian_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/test_promote_args.cpp : [ requires cpp_lib_type_trait_variable_templates ] ] - [ run test_legacy_nonfinite.cpp ../../test/build//boost_unit_test_framework ] [ run test_basic_nonfinite.cpp ../../test/build//boost_unit_test_framework ] [ run test_lexical_cast.cpp ../../test/build//boost_unit_test_framework ] @@ -924,19 +888,6 @@ test-suite mp : [ run test_estrin.cpp ] [ run polynomial_concept_check.cpp ] - [ compile multiprc_concept_check_1.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_2.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_3.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_4.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_5.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_6.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_7.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_8.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_9.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile multiprc_concept_check_10.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile ntl_concept_check.cpp : [ check-target-builds ../config//has_ntl_rr : : no ] off [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile mpfr_concept_check.cpp : [ check-target-builds ../config//has_mpfr_class : : no ] off [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile mpreal_concept_check.cpp : [ check-target-builds ../config//has_mpreal : : no ] off [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run issue893.cpp ] ; @@ -1058,154 +1009,6 @@ test-suite misc : [ run test_toms748_solve.cpp pch ../../test/build//boost_unit_test_framework ] [ run compile_test/interpolators_cubic_spline_incl_test.cpp compile_test_main : : : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run compile_test/interpolators_barycentric_rational_incl_test.cpp compile_test_main : : : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_cubic_hermite_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_makima_incl_test.cpp compile_test_main : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_pchip_incl_test.cpp compile_test_main : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_quintic_hermite_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_septic_hermite_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_vector_barycentric_rational_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_whittaker_shannon_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/compl_abs_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/compl_acos_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/compl_acosh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/compl_asin_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/compl_asinh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/compl_atan_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/compl_atanh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - - [ run compile_test/sf_1f0_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_0f1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_2f0_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_1f1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_pfq_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_acosh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_asinh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_atanh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_beta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_bernoulli_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_bessel_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_bessel_deriv_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_binomial_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_cbrt_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_cos_pi_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_digamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_polygamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_2_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_3_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_d_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_jacobi_theta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_jacobi_zeta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_heuman_lambda_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_rc_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_rd_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_rf_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_rj_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ellint_rg_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_erf_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_expint_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_expm1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_factorials_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_fpclassify_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_gamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_hermite_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_hypot_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_laguerre_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/sf_lanczos_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_legendre_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_legendre_stieltjes_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_log1p_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/sf_math_fwd_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_modf_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_next_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_powm1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_prime_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_relative_distance_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_round_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_sign_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_sin_pi_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_sinc_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_sinhc_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_sph_harm_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_sqrt1pm1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_trunc_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_ulp_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_zeta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/sf_chebyshev_incl_test.cpp ../config//fftw3 : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/sf_chebyshev_transform_incl_test.cpp ../config//fftw3 : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] [ check-target-builds ../config//has_fftw3 "libfftw3" : : no ] ] - [ run compile_test/sf_fibonacci_incl_test.cpp compile_test_main : : : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_gegenbauer_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_lambert_w_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/sf_nonfinite_num_facets_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/std_real_concept_check.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/std_real_concept_check.cpp : EMULATE32 [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : std_real_concept_check_32 ] - [ compile compile_test/std_real_concept_check.cpp : EMULATE64 [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : std_real_concept_check_64 ] - [ compile compile_test/std_real_concept_check.cpp : EMULATE80 [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : std_real_concept_check_80 ] - [ compile compile_test/std_real_concept_check.cpp : EMULATE128 [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : std_real_concept_check_128 ] - [ run compile_test/cstdfloat_concept_check_1.cpp - : : : [ check-target-builds ../config//has_intel_quad "Intel _Quad datatype support" : -Qoption,cpp,--extended_float_type ] - [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/cstdfloat_concept_check_2.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/cstdfloat_concept_check_3.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/cstdfloat_concept_check_4.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/cstdfloat_cmath_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/cstdfloat_complex_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/cstdfloat_iostream_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/cstdfloat_limits_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/cstdfloat_types_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run test_cstdfloat.cpp ../../test/build//boost_unit_test_framework : : : [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_airy_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_hankel_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_jacobi_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/sf_owens_t_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/dist_skew_norm_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/constants_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/quad_trapezoidal_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_decltype cxx11_unified_initialization_syntax cxx11_variadic_templates ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/test_traits.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_config_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_fraction_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_minima_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_polynomial_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_precision_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_rational_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_real_cast_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_remez_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_roots_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_series_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_solve_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_stats_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_test_data_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_test_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_toms748_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_agm_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_assert_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_atomic_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_big_constant_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_centered_continued_fraction_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_cohen_acceleration_incl_test.cpp : [ requires cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_complex_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_condition_numbers_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_convert_from_string_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_cxx03_warn_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_engel_expansion_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_header_deprecated_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_is_detected_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_luroth_expansion_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_mp_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_norms_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_polynomial_gcd_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_promotion_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_random_vector_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_simple_continued_fraction_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_test_value_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_throw_exception_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_traits_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_ulps_plot_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/tools_workaround_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_cubic_spline_concept_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/interpolators_barycentric_rational_concept_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/sf_legendre_stieltjes_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_defaulted_functions cxx11_lambdas ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/quad_trapezoidal_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_decltype cxx11_unified_initialization_syntax cxx11_variadic_templates ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] [ run octonion_test.cpp ../../test/build//boost_unit_test_framework ] [ run quaternion_constexpr_test.cpp ] @@ -1217,10 +1020,6 @@ test-suite misc : ../../test/build//boost_unit_test_framework ] # [ run __temporary_test.cpp test_instances//test_instances : : : always_show_run_output off ] - [ compile test_no_long_double_policy.cpp ] - [ compile bernoulli_no_atomic_d.cpp ] - [ compile bernoulli_no_atomic_mp.cpp ] - [ compile-fail bernoulli_no_atomic_fail.cpp ] ; test-suite interpolators : @@ -1350,17 +1149,6 @@ test-suite quadrature : : : : release TEST10 [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : exp_sinh_quadrature_test_10 ] - [ run compile_test/quad_exp_sinh_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/quad_sinh_sinh_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run compile_test/quad_tanh_sinh_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/quad_gauss_incl_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/quad_gauss_kronrod_incl_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/quad_ooura_fourier_integrals_incl_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/quad_wavelet_transforms_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/quad_exp_sinh_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/quad_sinh_sinh_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ compile compile_test/quad_tanh_sinh_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] - [ run gauss_quadrature_test.cpp : : : TEST1 [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] off msvc:/bigobj release : gauss_quadrature_test_1 ] [ run gauss_quadrature_test.cpp : : : TEST2 [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] @@ -1553,6 +1341,225 @@ rule get_float128_tests test-suite float128_tests : [ get_float128_tests ] ; +# +# Concept checks, and things we do not want to test when running code coverage: +# +test-suite concepts : + [ run compile_test/dist_bernoulli_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_beta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_binomial_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_cauchy_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_chi_squared_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_complement_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_exponential_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_extreme_val_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_find_location_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_find_scale_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_fisher_f_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_gamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_inv_gamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_inv_chi_sq_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_hyperexponential_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_hypergeo_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_laplace_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_logistic_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_lognormal_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_neg_binom_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_nc_chi_squ_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_nc_beta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_nc_f_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_nc_t_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_normal_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_poisson_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_students_t_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_triangular_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_uniform_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_weibull_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/distribution_concept_check.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_arcsine_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/dist_empirical_cumulative_dist_func_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_inv_gaussian_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/test_promote_args.cpp : [ requires cpp_lib_type_trait_variable_templates ] ] + + [ compile multiprc_concept_check_1.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_2.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_3.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_4.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_5.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_6.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_7.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_8.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_9.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile multiprc_concept_check_10.cpp : off msvc:/bigobj release off:no [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile ntl_concept_check.cpp : [ check-target-builds ../config//has_ntl_rr : : no ] off [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile mpfr_concept_check.cpp : [ check-target-builds ../config//has_mpfr_class : : no ] off [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile mpreal_concept_check.cpp : [ check-target-builds ../config//has_mpreal : : no ] off [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + + [ compile compile_test/interpolators_cubic_hermite_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/interpolators_makima_incl_test.cpp compile_test_main : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/interpolators_pchip_incl_test.cpp compile_test_main : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/interpolators_quintic_hermite_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/interpolators_septic_hermite_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/interpolators_vector_barycentric_rational_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/interpolators_whittaker_shannon_incl_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/compl_abs_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/compl_acos_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/compl_acosh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/compl_asin_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/compl_asinh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/compl_atan_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/compl_atanh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + + [ run compile_test/sf_1f0_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_0f1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_2f0_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_1f1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_pfq_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_acosh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_asinh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_atanh_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_beta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_bernoulli_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_bessel_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_bessel_deriv_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_binomial_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_cbrt_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_cos_pi_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_digamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_polygamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_2_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_3_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_d_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_jacobi_theta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_jacobi_zeta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_heuman_lambda_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_rc_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_rd_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_rf_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_rj_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ellint_rg_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_erf_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_expint_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_expm1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_factorials_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_fpclassify_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_gamma_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_hermite_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_hypot_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_laguerre_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/sf_lanczos_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_legendre_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_legendre_stieltjes_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_log1p_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/sf_math_fwd_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_modf_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_next_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_powm1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_prime_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_relative_distance_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_round_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_sign_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_sin_pi_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_sinc_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_sinhc_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_sph_harm_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_sqrt1pm1_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_trunc_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_ulp_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_zeta_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/sf_chebyshev_incl_test.cpp ../config//fftw3 : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/sf_chebyshev_transform_incl_test.cpp ../config//fftw3 : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] [ check-target-builds ../config//has_fftw3 "libfftw3" : : no ] ] + [ run compile_test/sf_fibonacci_incl_test.cpp compile_test_main : : : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_gegenbauer_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_lambert_w_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/sf_nonfinite_num_facets_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/std_real_concept_check.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/std_real_concept_check.cpp : EMULATE32 [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : std_real_concept_check_32 ] + [ compile compile_test/std_real_concept_check.cpp : EMULATE64 [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : std_real_concept_check_64 ] + [ compile compile_test/std_real_concept_check.cpp : EMULATE80 [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : std_real_concept_check_80 ] + [ compile compile_test/std_real_concept_check.cpp : EMULATE128 [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] : std_real_concept_check_128 ] + [ run compile_test/cstdfloat_concept_check_1.cpp + : : : [ check-target-builds ../config//has_intel_quad "Intel _Quad datatype support" : -Qoption,cpp,--extended_float_type ] + [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/cstdfloat_concept_check_2.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/cstdfloat_concept_check_3.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/cstdfloat_concept_check_4.cpp : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/cstdfloat_cmath_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/cstdfloat_complex_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/cstdfloat_iostream_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/cstdfloat_limits_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/cstdfloat_types_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run test_cstdfloat.cpp ../../test/build//boost_unit_test_framework : : : [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : -lquadmath ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_airy_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_hankel_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_jacobi_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/sf_owens_t_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/dist_skew_norm_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/constants_incl_test.cpp compile_test_main : : : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/quad_trapezoidal_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_decltype cxx11_unified_initialization_syntax cxx11_variadic_templates ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/test_traits.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_config_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_fraction_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_minima_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_polynomial_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_precision_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_rational_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_real_cast_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_remez_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_roots_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_series_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_solve_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_stats_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_test_data_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_test_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_toms748_inc_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_agm_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_assert_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_atomic_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_big_constant_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_centered_continued_fraction_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_cohen_acceleration_incl_test.cpp : [ requires cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_complex_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_condition_numbers_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_convert_from_string_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_cxx03_warn_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_engel_expansion_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_header_deprecated_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_is_detected_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_luroth_expansion_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_mp_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_norms_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_polynomial_gcd_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_promotion_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_random_vector_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_simple_continued_fraction_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_test_value_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_throw_exception_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_traits_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_ulps_plot_incl_test.cpp : [ requires cxx17_if_constexpr cxx17_std_apply ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/tools_workaround_incl_test.cpp : [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/interpolators_cubic_spline_concept_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/interpolators_barycentric_rational_concept_test.cpp : [ requires cxx11_smart_ptr cxx11_defaulted_functions cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/sf_legendre_stieltjes_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_defaulted_functions cxx11_lambdas ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/quad_trapezoidal_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_decltype cxx11_unified_initialization_syntax cxx11_variadic_templates ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile test_no_long_double_policy.cpp ] + [ compile bernoulli_no_atomic_d.cpp ] + [ compile bernoulli_no_atomic_mp.cpp ] + [ compile-fail bernoulli_no_atomic_fail.cpp ] + + [ run compile_test/quad_exp_sinh_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/quad_sinh_sinh_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ run compile_test/quad_tanh_sinh_incl_test.cpp compile_test_main : : : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/quad_gauss_incl_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/quad_gauss_kronrod_incl_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/quad_ooura_fourier_integrals_incl_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/quad_wavelet_transforms_incl_test.cpp : [ requires cxx17_std_apply cxx17_if_constexpr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/quad_exp_sinh_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/quad_sinh_sinh_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] + [ compile compile_test/quad_tanh_sinh_concept_test.cpp : [ requires cxx11_auto_declarations cxx11_lambdas cxx11_smart_ptr cxx11_unified_initialization_syntax sfinae_expr ] [ check-target-builds ../config//is_ci_sanitizer_run "Sanitizer CI run" : no ] ] +; + # # Things that we can test with exceptions and RTTI turned off: # @@ -1677,7 +1684,7 @@ explicit no_eh_tests ; # Some aliases which group blocks of tests for CI testing: -alias github_ci_block_1 : special_fun float128_tests distribution_tests mp misc ; +alias github_ci_block_1 : special_fun float128_tests distribution_tests mp misc concepts ; alias github_ci_block_2 : quadrature interpolators autodiff ../example//examples ../tools ; explicit github_ci_block_1 ; explicit github_ci_block_2 ; From 797714419b41ed1e73b218fceb6f7f6b4a7608df Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 26 Jan 2024 19:31:34 +0000 Subject: [PATCH 10/26] Continue improving Bessel coverage and removing dead code. --- .../boost/math/special_functions/bessel.hpp | 5 ++- .../special_functions/detail/bessel_i1.hpp | 41 ------------------- .../special_functions/detail/bessel_ik.hpp | 31 +------------- .../special_functions/detail/bessel_j0.hpp | 33 +-------------- .../special_functions/detail/bessel_j1.hpp | 6 +-- .../special_functions/detail/bessel_kn.hpp | 7 ++-- test/test_bessel_i.hpp | 25 ++++++++++- test/test_bessel_j.hpp | 2 + test/test_bessel_k.hpp | 7 ++++ 9 files changed, 45 insertions(+), 112 deletions(-) diff --git a/include/boost/math/special_functions/bessel.hpp b/include/boost/math/special_functions/bessel.hpp index c9dd3a2a0a..82bed6e490 100644 --- a/include/boost/math/special_functions/bessel.hpp +++ b/include/boost/math/special_functions/bessel.hpp @@ -180,6 +180,7 @@ T cyl_bessel_i_imp(T v, T x, const Policy& pol) // case has better error handling too). // BOOST_MATH_STD_USING + static const char* function = "boost::math::cyl_bessel_i<%1%>(%1%,%1%)"; if(x < 0) { // better have integer v: @@ -191,10 +192,12 @@ T cyl_bessel_i_imp(T v, T x, const Policy& pol) return r; } else - return policies::raise_domain_error("boost::math::cyl_bessel_i<%1%>(%1%,%1%)", "Got x = %1%, but we need x >= 0", x, pol); + return policies::raise_domain_error(function, "Got x = %1%, but we need x >= 0", x, pol); } if(x == 0) { + if(v < 0) + return floor(v) == v ? static_cast(0) : policies::raise_overflow_error(function, nullptr, pol); return (v == 0) ? static_cast(1) : static_cast(0); } if(v == 0.5f) diff --git a/include/boost/math/special_functions/detail/bessel_i1.hpp b/include/boost/math/special_functions/detail/bessel_i1.hpp index ea77f67911..badc35de0b 100644 --- a/include/boost/math/special_functions/detail/bessel_i1.hpp +++ b/include/boost/math/special_functions/detail/bessel_i1.hpp @@ -40,46 +40,6 @@ namespace boost { namespace math { namespace detail{ template T bessel_i1(const T& x); -template -struct bessel_i1_initializer -{ - struct init - { - init() - { - do_init(tag()); - } - static void do_init(const std::integral_constant&) - { - bessel_i1(T(1)); - bessel_i1(T(15)); - bessel_i1(T(80)); - bessel_i1(T(101)); - } - static void do_init(const std::integral_constant&) - { - bessel_i1(T(1)); - bessel_i1(T(10)); - bessel_i1(T(14)); - bessel_i1(T(19)); - bessel_i1(T(34)); - bessel_i1(T(99)); - bessel_i1(T(101)); - } - template - static void do_init(const U&) {} - void force_instantiate()const{} - }; - static const init initializer; - static void force_instantiate() - { - initializer.force_instantiate(); - } -}; - -template -const typename bessel_i1_initializer::init bessel_i1_initializer::initializer; - template T bessel_i1_imp(const T&, const std::integral_constant&) { @@ -582,7 +542,6 @@ inline T bessel_i1(const T& x) 113 : -1 > tag_type; - bessel_i1_initializer::force_instantiate(); return bessel_i1_imp(x, tag_type()); } diff --git a/include/boost/math/special_functions/detail/bessel_ik.hpp b/include/boost/math/special_functions/detail/bessel_ik.hpp index 7d0a4e79fe..4db8f14a7f 100644 --- a/include/boost/math/special_functions/detail/bessel_ik.hpp +++ b/include/boost/math/special_functions/detail/bessel_ik.hpp @@ -327,36 +327,7 @@ int bessel_ik(T v, T x, T* result_I, T* result_K, int kind, const Policy& pol) BOOST_MATH_INSTRUMENT_VARIABLE(n); BOOST_MATH_INSTRUMENT_VARIABLE(u); - if (x < 0) - { - *result_I = *result_K = policies::raise_domain_error(function, - "Got x = %1% but real argument x must be non-negative, complex number result not supported.", x, pol); - return 1; - } - if (x == 0) - { - Iv = (v == 0) ? static_cast(1) : static_cast(0); - if(kind & need_k) - { - Kv = policies::raise_overflow_error(function, nullptr, pol); - } - else - { - Kv = std::numeric_limits::quiet_NaN(); // any value will do - } - - if(reflect && (kind & need_i)) - { - T z = (u + n % 2); - Iv = boost::math::sin_pi(z, pol) == 0 ? - Iv : - policies::raise_overflow_error(function, nullptr, pol); // reflection formula - } - - *result_I = Iv; - *result_K = Kv; - return 0; - } + BOOST_ASSERT(x > 0); // Error handling for x <= 0 handled in cyl_bessel_i and cyl_bessel_k // x is positive until reflection W = 1 / x; // Wronskian diff --git a/include/boost/math/special_functions/detail/bessel_j0.hpp b/include/boost/math/special_functions/detail/bessel_j0.hpp index 564f86d7a8..2a40407170 100644 --- a/include/boost/math/special_functions/detail/bessel_j0.hpp +++ b/include/boost/math/special_functions/detail/bessel_j0.hpp @@ -34,36 +34,9 @@ namespace boost { namespace math { namespace detail{ template T bessel_j0(T x); -template -struct bessel_j0_initializer -{ - struct init - { - init() - { - do_init(); - } - static void do_init() - { - bessel_j0(T(1)); - } - void force_instantiate()const{} - }; - static const init initializer; - static void force_instantiate() - { - initializer.force_instantiate(); - } -}; - -template -const typename bessel_j0_initializer::init bessel_j0_initializer::initializer; - template T bessel_j0(T x) { - bessel_j0_initializer::force_instantiate(); - #ifdef BOOST_MATH_INSTRUMENT static bool b = false; if (!b) @@ -158,10 +131,8 @@ T bessel_j0(T x) using namespace boost::math::tools; using namespace boost::math::constants; - if (x < 0) - { - x = -x; // even function - } + BOOST_ASSERT(x >= 0); // reflection handled elsewhere. + if (x == 0) { return static_cast(1); diff --git a/include/boost/math/special_functions/detail/bessel_j1.hpp b/include/boost/math/special_functions/detail/bessel_j1.hpp index 3b24ec2391..696dbc83d4 100644 --- a/include/boost/math/special_functions/detail/bessel_j1.hpp +++ b/include/boost/math/special_functions/detail/bessel_j1.hpp @@ -196,10 +196,8 @@ T bessel_j1(T x) value = factor * (rc * (sx - cx) + y * rs * (sx + cx)); } - if (x < 0) - { - value *= -1; // odd function - } + BOOST_ASSERT(x >= 0); // Negative values handled by the caller. + return value; } diff --git a/include/boost/math/special_functions/detail/bessel_kn.hpp b/include/boost/math/special_functions/detail/bessel_kn.hpp index 9463ce1615..8c717d44f0 100644 --- a/include/boost/math/special_functions/detail/bessel_kn.hpp +++ b/include/boost/math/special_functions/detail/bessel_kn.hpp @@ -31,12 +31,13 @@ T bessel_kn(int n, T x, const Policy& pol) if (x < 0) { - return policies::raise_domain_error(function, - "Got x = %1%, but argument x must be non-negative, complex number result not supported.", x, pol); + return policies::raise_domain_error(function, "Got x = %1%, but argument x must be non-negative, complex number result not supported.", x, pol); } if (x == 0) { - return policies::raise_overflow_error(function, nullptr, pol); + return (n == 0) ? + policies::raise_overflow_error(function, nullptr, pol) + : policies::raise_domain_error(function, "Got x = %1%, but argument x must be positive, complex number result not supported.", x, pol); } if (n < 0) diff --git a/test/test_bessel_i.hpp b/test/test_bessel_i.hpp index 46dde6ef28..f6d38f0e0e 100644 --- a/test/test_bessel_i.hpp +++ b/test/test_bessel_i.hpp @@ -181,20 +181,41 @@ void test_bessel(T, const char* name) // Special cases for full coverage: // BOOST_CHECK_THROW(boost::math::cyl_bessel_i(T(-2.5), T(-2.5)), std::domain_error); + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(T(0), T(0)), T(1)); + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(T(10), T(0)), T(0)); + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(T(-10), T(0)), T(0)); + BOOST_IF_CONSTEXPR (std::numeric_limits::has_infinity) + { + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(T(-10.5), T(0)), std::numeric_limits::infinity()); + BOOST_IF_CONSTEXPR(std::numeric_limits::max_exponent < 11356) + { + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(T(0.25), T(8000)), std::numeric_limits::infinity()); + } + else + { + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(T(0.25), T(21000)), std::numeric_limits::infinity()); + } + } T tolerance = boost::math::tools::epsilon() * 100; if ((boost::math::tools::digits() <= std::numeric_limits::digits) && (std::numeric_limits::max_exponent > 1000)) { BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(T(0.5), T(710)), SC_(3.3447452278080108123142599104927325061327359278058601201179e306), tolerance); } #if LDBL_MAX_EXP >= 11356 - if (std::numeric_limits::max_exponent >= 11356) + BOOST_IF_CONSTEXPR (std::numeric_limits::max_exponent >= 11356) { BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_i(T(0.5), T(11357)), SC_(7.173138695269929329584326974917488634629578339622112563648e4929), tolerance); } #endif - if (std::numeric_limits::max_exponent > 1000) + BOOST_IF_CONSTEXPR (std::numeric_limits::max_exponent > 1000) { 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); + } + else BOOST_IF_CONSTEXPR(std::numeric_limits::is_specialized) + { + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(0, T(700)), std::numeric_limits::infinity()); + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_i(1, T(600)), std::numeric_limits::infinity()); } } diff --git a/test/test_bessel_j.hpp b/test/test_bessel_j.hpp index 96658c1544..1d4a24b986 100644 --- a/test/test_bessel_j.hpp +++ b/test/test_bessel_j.hpp @@ -277,5 +277,7 @@ void test_bessel(T, const char* name) T tolerance = boost::math::tools::epsilon() * 2000; BOOST_CHECK_CLOSE_FRACTION(boost::math::sph_bessel(200, T(0.5)), SC_(3.070403008048099934928128420285169174541102108657574230431e-497), tolerance); BOOST_MATH_CHECK_THROW(boost::math::sph_bessel(2, T(-2.0)), std::domain_error); + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_j(T(0), T(2.5)), boost::math::cyl_bessel_j(T(0), T(-2.5))); + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_j(T(1), T(2.5)), -boost::math::cyl_bessel_j(T(1), T(-2.5))); } diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index 38e005f50a..6eb4b0009b 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -182,5 +182,12 @@ void test_bessel(T, const char* name) BOOST_CHECK_EQUAL(boost::math::cyl_bessel_k(T(0), T(0)), std::numeric_limits::infinity()); } BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(1.25), T(0)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(-1.25), T(0)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(-1), T(0)), std::domain_error); + BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(1), T(0)), std::domain_error); } + + + + From 14eee3781e8cda2a632c075e3b0e2a6202968cd4 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 26 Jan 2024 19:43:14 +0000 Subject: [PATCH 11/26] Correct assert usage. --- include/boost/math/special_functions/detail/bessel_ik.hpp | 2 +- include/boost/math/special_functions/detail/bessel_j0.hpp | 2 +- include/boost/math/special_functions/detail/bessel_j1.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_ik.hpp b/include/boost/math/special_functions/detail/bessel_ik.hpp index 4db8f14a7f..1c9be54a36 100644 --- a/include/boost/math/special_functions/detail/bessel_ik.hpp +++ b/include/boost/math/special_functions/detail/bessel_ik.hpp @@ -327,7 +327,7 @@ int bessel_ik(T v, T x, T* result_I, T* result_K, int kind, const Policy& pol) BOOST_MATH_INSTRUMENT_VARIABLE(n); BOOST_MATH_INSTRUMENT_VARIABLE(u); - BOOST_ASSERT(x > 0); // Error handling for x <= 0 handled in cyl_bessel_i and cyl_bessel_k + BOOST_MATH_ASSERT(x > 0); // Error handling for x <= 0 handled in cyl_bessel_i and cyl_bessel_k // x is positive until reflection W = 1 / x; // Wronskian diff --git a/include/boost/math/special_functions/detail/bessel_j0.hpp b/include/boost/math/special_functions/detail/bessel_j0.hpp index 2a40407170..9a0b26fe6b 100644 --- a/include/boost/math/special_functions/detail/bessel_j0.hpp +++ b/include/boost/math/special_functions/detail/bessel_j0.hpp @@ -131,7 +131,7 @@ T bessel_j0(T x) using namespace boost::math::tools; using namespace boost::math::constants; - BOOST_ASSERT(x >= 0); // reflection handled elsewhere. + BOOST_MATH_ASSERT(x >= 0); // reflection handled elsewhere. if (x == 0) { diff --git a/include/boost/math/special_functions/detail/bessel_j1.hpp b/include/boost/math/special_functions/detail/bessel_j1.hpp index 696dbc83d4..6d354dcce7 100644 --- a/include/boost/math/special_functions/detail/bessel_j1.hpp +++ b/include/boost/math/special_functions/detail/bessel_j1.hpp @@ -196,7 +196,7 @@ T bessel_j1(T x) value = factor * (rc * (sx - cx) + y * rs * (sx + cx)); } - BOOST_ASSERT(x >= 0); // Negative values handled by the caller. + BOOST_MATH_ASSERT(x >= 0); // Negative values handled by the caller. return value; } From b30b637f357d4015c0ec8959ec5e3e5c77fd5b14 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Mon, 29 Jan 2024 18:05:37 +0000 Subject: [PATCH 12/26] Remove some impossible to reach bessel_jn code. Add some more tests for the code that can be reached. --- .../math/special_functions/detail/bessel_jn.hpp | 14 ++------------ test/test_bessel_j.hpp | 1 + 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_jn.hpp b/include/boost/math/special_functions/detail/bessel_jn.hpp index 3388e8df29..a08af05485 100644 --- a/include/boost/math/special_functions/detail/bessel_jn.hpp +++ b/include/boost/math/special_functions/detail/bessel_jn.hpp @@ -75,17 +75,7 @@ T bessel_jn(int n, T x, const Policy& pol) policies::check_series_iterations("boost::math::bessel_j_n<%1%>(%1%,%1%)", n, pol); for (int k = 1; k < n; k++) { - T fact = 2 * k / x; - // - // rescale if we would overflow or underflow: - // - if((fabs(fact) > 1) && ((tools::max_value() - fabs(prev)) / fabs(fact) < fabs(current))) - { - scale /= current; - prev /= current; - current = 1; - } - value = fact * current - prev; + value = (2 * k * current / x) - prev; prev = current; current = value; } @@ -122,7 +112,7 @@ T bessel_jn(int n, T x, const Policy& pol) value *= factor; if(tools::max_value() * scale < fabs(value)) - return policies::raise_overflow_error("boost::math::bessel_jn<%1%>(%1%,%1%)", nullptr, pol); + return policies::raise_overflow_error("boost::math::bessel_jn<%1%>(%1%,%1%)", nullptr, pol); // LCOV_EXCL_LINE we should never get here! return value / scale; } diff --git a/test/test_bessel_j.hpp b/test/test_bessel_j.hpp index 1d4a24b986..2d10bc6c94 100644 --- a/test/test_bessel_j.hpp +++ b/test/test_bessel_j.hpp @@ -279,5 +279,6 @@ void test_bessel(T, const char* name) BOOST_MATH_CHECK_THROW(boost::math::sph_bessel(2, T(-2.0)), std::domain_error); BOOST_CHECK_EQUAL(boost::math::cyl_bessel_j(T(0), T(2.5)), boost::math::cyl_bessel_j(T(0), T(-2.5))); BOOST_CHECK_EQUAL(boost::math::cyl_bessel_j(T(1), T(2.5)), -boost::math::cyl_bessel_j(T(1), T(-2.5))); + BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_bessel_j(364, T(38.5)), SC_(1.793940496519190500748409872348034004417458734118663909894e-309), tolerance); } From d0bade98587b4e8142d6b0b80c68c194d634b8c7 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 1 Feb 2024 16:56:39 +0000 Subject: [PATCH 13/26] Improve Bessel Y coverage. --- .../special_functions/detail/bessel_jy.hpp | 23 +++++++++++-------- test/test_bessel_y.cpp | 4 ++-- test/test_bessel_y.hpp | 13 ++++++++++- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_jy.hpp b/include/boost/math/special_functions/detail/bessel_jy.hpp index ca0aa7d2c2..63a339d576 100644 --- a/include/boost/math/special_functions/detail/bessel_jy.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy.hpp @@ -287,7 +287,7 @@ namespace boost { namespace math { if (v > static_cast((std::numeric_limits::max)())) { *J = *Y = policies::raise_evaluation_error(function, "Order of Bessel function is too large to evaluate: got %1%", v, pol); - return 1; + return 1; // LCOV_EXCL_LINE previous line will throw. } n = iround(v, pol); u = v - n; // -1/2 <= u < 1/2 @@ -303,9 +303,8 @@ namespace boost { namespace math { if(x == 0) { - if(v == 0) - *J = 1; - else if((u == 0) || !reflect) + BOOST_ASSERT(v != 0); + if((u == 0) || !reflect) *J = 0; else if(kind & need_j) *J = policies::raise_domain_error(function, "Value of Bessel J_v(x) is complex-infinity at %1%", x, pol); // complex infinity @@ -314,10 +313,11 @@ namespace boost { namespace math { if((kind & need_y) == 0) *Y = std::numeric_limits::quiet_NaN(); // any value will do, not using Y. - else if(v == 0) - *Y = -policies::raise_overflow_error(function, nullptr, pol); else - *Y = policies::raise_domain_error(function, "Value of Bessel Y_v(x) is complex-infinity at %1%", x, pol); // complex infinity + { + // We shoud never get here: + BOOST_ASSERT(x != 0); + } return 1; } @@ -357,6 +357,8 @@ namespace boost { namespace math { { // Truncated series evaluation for small x and v an integer, // much quicker in this area than temme_jy below. + // This code is only used in the multiprecision case, otherwise + // we go via bessel_jn. LCOV_EXCL_START if(kind&need_j) Jv = bessel_j_small_z_series(v, x, pol); else @@ -369,6 +371,7 @@ namespace boost { namespace math { } else Yv = std::numeric_limits::quiet_NaN(); + // LCOV_EXCL_STOP } else if(asymptotic_bessel_large_x_limit(v, x)) { @@ -416,7 +419,7 @@ namespace boost { namespace math { { if(temme_jy(u, x, &Yu, &Yu1, pol)) // Temme series { - // domain error: + // domain error, this should really have already been handled, LCOV_EXCL_LINE *J = *Y = Yu; return 1; } @@ -470,7 +473,7 @@ namespace boost { namespace math { // Pretend that one bit did not cancel: if (next == 0) { - next = prev * tools::epsilon() / 2; + next = prev * tools::epsilon() / 2; // LCOV_EXCL_LINE requires specific hardware and rounding to trigger, does get tested on msvc } prev = current; current = next; @@ -522,7 +525,7 @@ namespace boost { namespace math { // if(gamma == 0) { - gamma = u * tools::epsilon() / x; + gamma = u * tools::epsilon() / x; // LCOV_EXCL_LINE requires specific hardware and rounding to trigger, does get tested on msvc } BOOST_MATH_INSTRUMENT_VARIABLE(current); BOOST_MATH_INSTRUMENT_VARIABLE(W); diff --git a/test/test_bessel_y.cpp b/test/test_bessel_y.cpp index 8de646002d..83c24b95f4 100644 --- a/test/test_bessel_y.cpp +++ b/test/test_bessel_y.cpp @@ -188,7 +188,7 @@ void expected_results() ".*", 2000, 2000); // test function #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS - if((std::numeric_limits::digits != std::numeric_limits::digits) + BOOST_IF_CONSTEXPR((std::numeric_limits::digits != std::numeric_limits::digits) && (std::numeric_limits::digits < 90)) { // some errors spill over into type double as well: @@ -207,7 +207,7 @@ void expected_results() ".*Yv.*", // test data group ".*", 80, 70); // test function } - else if (std::numeric_limits::digits >= 90) + else BOOST_IF_CONSTEXPR(std::numeric_limits::digits >= 90) { add_expected_result( ".*", // compiler diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index a488bbad97..b58fc3d8a5 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -218,7 +218,7 @@ void test_bessel(T, const char* name) // // Additional test coverage: // - if (std::numeric_limits::has_infinity) + BOOST_IF_CONSTEXPR (std::numeric_limits::has_infinity) { BOOST_CHECK_EQUAL(boost::math::cyl_neumann(T(0), T(0)), -std::numeric_limits::infinity()); BOOST_CHECK_EQUAL(boost::math::sph_neumann(2, boost::math::tools::min_value() * 1.5f), -std::numeric_limits::infinity()); @@ -227,10 +227,21 @@ void test_bessel(T, const char* name) { BOOST_CHECK_EQUAL(boost::math::sph_neumann(2, small), -std::numeric_limits::infinity()); } + BOOST_IF_CONSTEXPR (std::numeric_limits::max_exponent <= 1024) + { + BOOST_CHECK_EQUAL(boost::math::cyl_neumann(T(121.25), T(0.25)), -std::numeric_limits::infinity()); + } } BOOST_CHECK_THROW(boost::math::cyl_neumann(T(0), T(-1)), std::domain_error); BOOST_CHECK_THROW(boost::math::cyl_neumann(T(0.2), T(-1)), std::domain_error); BOOST_CHECK_THROW(boost::math::cyl_neumann(T(2), T(0)), std::domain_error); BOOST_CHECK_THROW(boost::math::sph_neumann(2, T(-2)), std::domain_error); +#if LDBL_MAX_EXP > 1024 + if (std::numeric_limits::max_exponent > 1024) + { + T tolerance = std::numeric_limits::epsilon() * 400; + BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_neumann(T(121.25), T(0.25)), SC_(-2.230082612409607659174017669618188190008214736253939486007e308), tolerance); + } +#endif } From 60134c06e9713becbd5cd9490a37117005239532 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 6 Feb 2024 18:26:35 +0000 Subject: [PATCH 14/26] Improve Bessel Y derivative coverage. Also fixes a bug in bessel_y_derivative_small_z_series corner case. --- .../detail/bessel_jy_derivatives_series.hpp | 5 ++++- test/test_bessel_y_prime.cpp | 2 +- test/test_bessel_y_prime.hpp | 16 ++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_jy_derivatives_series.hpp b/include/boost/math/special_functions/detail/bessel_jy_derivatives_series.hpp index 8914e2c3f1..d7bb64f8cd 100644 --- a/include/boost/math/special_functions/detail/bessel_jy_derivatives_series.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy_derivatives_series.hpp @@ -147,6 +147,7 @@ inline T bessel_y_derivative_small_z_series(T v, T x, const Policy& pol) T p = log(x / 2); T scale = 1; bool need_logs = (v >= boost::math::max_factorial::value) || (boost::math::tools::log_max_value() / v < fabs(p)); + if (!need_logs) { gam = boost::math::tgamma(v, pol); @@ -204,7 +205,9 @@ inline T bessel_y_derivative_small_z_series(T v, T x, const Policy& pol) T b = boost::math::tools::sum_series(s2, boost::math::policies::get_epsilon(), max_iter); result += scale * prefix * b; - return result; + if(scale * tools::max_value() < result) + return boost::math::policies::raise_overflow_error(function, nullptr, pol); + return result / scale; } // Calculating of BesselY'(v,x) with small x (x < epsilon) and integer x using derivatives diff --git a/test/test_bessel_y_prime.cpp b/test/test_bessel_y_prime.cpp index 20b4abbeee..9848b63356 100644 --- a/test/test_bessel_y_prime.cpp +++ b/test/test_bessel_y_prime.cpp @@ -276,7 +276,7 @@ void expected_results() ".*", // platform largest_type, // test type(s) ".*", // test data group - ".*", 700, 300); // test function + ".*", 720, 600); // test function // // One set of float tests has inexact input values, so there is a slight error: // diff --git a/test/test_bessel_y_prime.hpp b/test/test_bessel_y_prime.hpp index 74600bece7..1c0719e1dd 100644 --- a/test/test_bessel_y_prime.hpp +++ b/test/test_bessel_y_prime.hpp @@ -225,5 +225,21 @@ void test_bessel_prime(T, const char* name) BOOST_CHECK_THROW(boost::math::cyl_neumann_prime(T(2.5), T(-1)), std::domain_error); BOOST_CHECK_THROW(boost::math::sph_neumann_prime(2, T(0)), std::domain_error); BOOST_CHECK_THROW(boost::math::sph_neumann_prime(2, T(-1)), std::domain_error); + + BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity && (std::numeric_limits::min_exponent < -1072)) + { + static const std::array, 5> yv_prime_coverage_data = { { + {{ SC_(170.25), SC_(2), SC_(4.1990285871978876642542582761856953686528755802132926772620e306) }}, + #if LDBL_MAX_10_EXP > 4936 + {{ SC_(14.25), ldexp(T(1), -1072), SC_(1.830622575805420777640505999291582751497710200210963689466e4936)}}, + #else + {{ SC_(14.25), ldexp(T(1), -1072), std::numeric_limits::infinity() }}, + #endif + {{ SC_(14.25), ldexp(T(1), -1074), std::numeric_limits::infinity() }}, + {{ SC_(15.25), ldexp(T(1), -1074), std::numeric_limits::infinity() }}, + {{ SC_(30.25), ldexp(T(1), -1045), std::numeric_limits::infinity() }}, + } }; + do_test_cyl_neumann_y_prime(yv_prime_coverage_data, name, "y': Extra coverage data"); + } } From 2adbc21370c9b805b7deaf698aeb3aa69cf168f1 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Tue, 6 Feb 2024 18:31:28 +0000 Subject: [PATCH 15/26] Correct assertion usage. --- include/boost/math/special_functions/detail/bessel_jy.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_jy.hpp b/include/boost/math/special_functions/detail/bessel_jy.hpp index 63a339d576..19df67885d 100644 --- a/include/boost/math/special_functions/detail/bessel_jy.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy.hpp @@ -303,7 +303,7 @@ namespace boost { namespace math { if(x == 0) { - BOOST_ASSERT(v != 0); + BOOST_MATH_ASSERT(v != 0); if((u == 0) || !reflect) *J = 0; else if(kind & need_j) @@ -316,7 +316,7 @@ namespace boost { namespace math { else { // We shoud never get here: - BOOST_ASSERT(x != 0); + BOOST_MATH_ASSERT(x != 0); } return 1; } From d6ec06df3a415f2bddcc2e17eaff7521e1c2e118 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 8 Feb 2024 19:25:56 +0000 Subject: [PATCH 16/26] Improve Bessel K and Y prime coverage. Improve overflow handling in the implementations themselves. --- .../detail/bessel_derivatives_linear.hpp | 27 +++++++++---- .../special_functions/detail/bessel_ik.hpp | 2 +- .../special_functions/detail/bessel_jy.hpp | 5 ++- .../detail/bessel_jy_series.hpp | 1 + .../detail/bessel_jy_zero.hpp | 2 +- .../special_functions/detail/bessel_kn.hpp | 4 +- .../special_functions/detail/bessel_y0.hpp | 38 +------------------ .../special_functions/detail/bessel_y1.hpp | 34 +---------------- .../special_functions/detail/bessel_yn.hpp | 7 ++-- test/test_bessel_k.hpp | 1 + test/test_bessel_k_prime.hpp | 36 ++++++++++++++++++ test/test_bessel_y.hpp | 24 ++++++++++++ 12 files changed, 95 insertions(+), 86 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp b/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp index 72fddc61c6..42abbc15be 100644 --- a/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp +++ b/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp @@ -9,7 +9,7 @@ // Linear combination for bessel derivatives are defined here #ifndef BOOST_MATH_SF_DETAIL_BESSEL_DERIVATIVES_LINEAR_HPP #define BOOST_MATH_SF_DETAIL_BESSEL_DERIVATIVES_LINEAR_HPP - +#include #ifdef _MSC_VER #pragma once #endif @@ -40,10 +40,11 @@ inline T bessel_i_derivative_linear(T v, T x, Policy pol) T result = boost::math::detail::cyl_bessel_i_imp(v - 1, x, pol); if(result >= tools::max_value()) return result; // result is infinite + // Both experimentally, and based on https://www.wolframalpha.com/input?i=BesselI%5Bv%2C+x%5D%2FBesselI%5Bv%2B2%2C+x%5D + // I[v + 1, x] < I[v-1, x], so this can't overflow: T result2 = boost::math::detail::cyl_bessel_i_imp(v + 1, x, pol); - if(result2 >= tools::max_value() - result) - return result2; // result is infinite - return (result + result2) / 2; + + return result / 2 + result2 / 2; } template @@ -53,15 +54,25 @@ inline T bessel_k_derivative_linear(T v, T x, Tag tag, Policy pol) if(result >= tools::max_value()) return -result; // result is infinite T result2 = boost::math::detail::cyl_bessel_k_imp(v + 1, x, tag, pol); - if(result2 >= tools::max_value() - result) - return -result2; // result is infinite - return (result + result2) / -2; + if(result2 >= tools::max_value() + result) + return -boost::math::policies::raise_overflow_error("cyl_bessel_k_prime<%1>", 0, pol); // result is infinite + result /= -2; + result2 /= -2; + return result + result2; } template inline T bessel_k_derivative_linear(T v, T x, const bessel_int_tag& tag, Policy pol) { - return (boost::math::detail::cyl_bessel_k_imp(itrunc(v-1), x, tag, pol) + boost::math::detail::cyl_bessel_k_imp(itrunc(v+1), x, tag, pol)) / -2; + T result = boost::math::detail::cyl_bessel_k_imp(itrunc(v - 1), x, tag, pol); + if (result >= tools::max_value()) + return -result; // result is infinite + T result2 = boost::math::detail::cyl_bessel_k_imp(itrunc(v + 1), x, tag, pol); + if (result2 >= tools::max_value() + result) + return -boost::math::policies::raise_overflow_error("cyl_bessel_k_prime<%1>", 0, pol); // result is infinite + result /= -2; + result2 /= -2; + return result + result2; } template diff --git a/include/boost/math/special_functions/detail/bessel_ik.hpp b/include/boost/math/special_functions/detail/bessel_ik.hpp index 1c9be54a36..b503352f20 100644 --- a/include/boost/math/special_functions/detail/bessel_ik.hpp +++ b/include/boost/math/special_functions/detail/bessel_ik.hpp @@ -360,7 +360,7 @@ int bessel_ik(T v, T x, T* result_I, T* result_K, int kind, const Policy& pol) { prev /= current; scale /= current; - scale_sign *= boost::math::sign(current); + scale_sign *= (boost::math::signbit(current) ? -1 : 1); current = 1; } next = fact * current + prev; diff --git a/include/boost/math/special_functions/detail/bessel_jy.hpp b/include/boost/math/special_functions/detail/bessel_jy.hpp index 19df67885d..a41e2744d3 100644 --- a/include/boost/math/special_functions/detail/bessel_jy.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy.hpp @@ -303,8 +303,9 @@ namespace boost { namespace math { if(x == 0) { - BOOST_MATH_ASSERT(v != 0); - if((u == 0) || !reflect) + if (v == 0) + *J = 1; // LCOV_EXCL_LINE multiprecision case only + else if ((u == 0) || !reflect) *J = 0; else if(kind & need_j) *J = policies::raise_domain_error(function, "Value of Bessel J_v(x) is complex-infinity at %1%", x, pol); // complex infinity diff --git a/include/boost/math/special_functions/detail/bessel_jy_series.hpp b/include/boost/math/special_functions/detail/bessel_jy_series.hpp index a5fc7b832e..ebcb62f910 100644 --- a/include/boost/math/special_functions/detail/bessel_jy_series.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy_series.hpp @@ -147,6 +147,7 @@ inline T bessel_y_small_z_series(T v, T x, T* pscale, const Policy& pol) T p = log(x / 2); T scale = 1; bool need_logs = (v >= max_factorial::value) || (tools::log_max_value() / v < fabs(p)); + if(!need_logs) { gam = boost::math::tgamma(v, pol); diff --git a/include/boost/math/special_functions/detail/bessel_jy_zero.hpp b/include/boost/math/special_functions/detail/bessel_jy_zero.hpp index 18981a074a..3fdb413d9f 100644 --- a/include/boost/math/special_functions/detail/bessel_jy_zero.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy_zero.hpp @@ -537,7 +537,7 @@ } else { - root_lo *= 0.75F; + root_lo *= 0.75F; // LCOV_EXCL_LINE probably unreachable, but hard to prove? } } } diff --git a/include/boost/math/special_functions/detail/bessel_kn.hpp b/include/boost/math/special_functions/detail/bessel_kn.hpp index 8c717d44f0..4fc086d584 100644 --- a/include/boost/math/special_functions/detail/bessel_kn.hpp +++ b/include/boost/math/special_functions/detail/bessel_kn.hpp @@ -74,8 +74,8 @@ T bessel_kn(int n, T x, const Policy& pol) ++k; } while(k < n); - if(tools::max_value() * scale < fabs(value)) - return sign(scale) * sign(value) * policies::raise_overflow_error(function, nullptr, pol); + if (tools::max_value() * scale < fabs(value)) + return (signbit(scale) ? -1 : 1) * sign(value) * policies::raise_overflow_error(function, nullptr, pol); value /= scale; } return value; diff --git a/include/boost/math/special_functions/detail/bessel_y0.hpp b/include/boost/math/special_functions/detail/bessel_y0.hpp index 1ea348b058..952b284185 100644 --- a/include/boost/math/special_functions/detail/bessel_y0.hpp +++ b/include/boost/math/special_functions/detail/bessel_y0.hpp @@ -38,36 +38,9 @@ namespace boost { namespace math { namespace detail{ template T bessel_y0(T x, const Policy&); -template -struct bessel_y0_initializer -{ - struct init - { - init() - { - do_init(); - } - static void do_init() - { - bessel_y0(T(1), Policy()); - } - void force_instantiate()const{} - }; - static const init initializer; - static void force_instantiate() - { - initializer.force_instantiate(); - } -}; - -template -const typename bessel_y0_initializer::init bessel_y0_initializer::initializer; - template T bessel_y0(T x, const Policy& pol) { - bessel_y0_initializer::force_instantiate(); - static const T P1[] = { static_cast(BOOST_MATH_BIG_CONSTANT(T, 64, 1.0723538782003176831e+11)), static_cast(BOOST_MATH_BIG_CONSTANT(T, 64, -8.3716255451260504098e+09)), @@ -172,15 +145,8 @@ T bessel_y0(T x, const Policy& pol) static const char* function = "boost::math::bessel_y0<%1%>(%1%,%1%)"; - if (x < 0) - { - return policies::raise_domain_error(function, - "Got x = %1% but x must be non-negative, complex result not supported.", x, pol); - } - if (x == 0) - { - return -policies::raise_overflow_error(function, nullptr, pol); - } + BOOST_MATH_ASSERT(x > 0); + if (x <= 3) // x in (0, 3] { T y = x * x; diff --git a/include/boost/math/special_functions/detail/bessel_y1.hpp b/include/boost/math/special_functions/detail/bessel_y1.hpp index b768787514..b7c5c2f7ef 100644 --- a/include/boost/math/special_functions/detail/bessel_y1.hpp +++ b/include/boost/math/special_functions/detail/bessel_y1.hpp @@ -38,36 +38,9 @@ namespace boost { namespace math { namespace detail{ template T bessel_y1(T x, const Policy&); -template -struct bessel_y1_initializer -{ - struct init - { - init() - { - do_init(); - } - static void do_init() - { - bessel_y1(T(1), Policy()); - } - void force_instantiate()const{} - }; - static const init initializer; - static void force_instantiate() - { - initializer.force_instantiate(); - } -}; - -template -const typename bessel_y1_initializer::init bessel_y1_initializer::initializer; - template T bessel_y1(T x, const Policy& pol) { - bessel_y1_initializer::force_instantiate(); - static const T P1[] = { static_cast(BOOST_MATH_BIG_CONSTANT(T, 64, 4.0535726612579544093e+13)), static_cast(BOOST_MATH_BIG_CONSTANT(T, 64, 5.4708611716525426053e+12)), @@ -157,11 +130,8 @@ T bessel_y1(T x, const Policy& pol) using namespace boost::math::tools; using namespace boost::math::constants; - if (x <= 0) - { - return policies::raise_domain_error("boost::math::bessel_y1<%1%>(%1%,%1%)", - "Got x == %1%, but x must be > 0, complex result not supported.", x, pol); - } + BOOST_MATH_ASSERT(x > 0); + if (x <= 4) // x in (0, 4] { T y = x * x; diff --git a/include/boost/math/special_functions/detail/bessel_yn.hpp b/include/boost/math/special_functions/detail/bessel_yn.hpp index 939c04d0aa..73dee0bbb8 100644 --- a/include/boost/math/special_functions/detail/bessel_yn.hpp +++ b/include/boost/math/special_functions/detail/bessel_yn.hpp @@ -36,8 +36,7 @@ T bessel_yn(int n, T x, const Policy& pol) } if (x <= 0) { - return policies::raise_domain_error(function, - "Got x = %1%, but x must be > 0, complex result not supported.", x, pol); + return policies::raise_domain_error(function, "Got x = %1%, but x must be > 0, complex result not supported.", x, pol); } // @@ -56,7 +55,7 @@ T bessel_yn(int n, T x, const Policy& pol) { T scale = 1; value = bessel_yn_small_z(n, x, &scale, pol); - if(tools::max_value() * fabs(scale) < fabs(value)) + if (tools::max_value() * fabs(scale) < fabs(value)) return boost::math::sign(scale) * boost::math::sign(value) * policies::raise_overflow_error(function, nullptr, pol); value /= scale; } @@ -99,7 +98,7 @@ T bessel_yn(int n, T x, const Policy& pol) current = value; ++k; } - if(fabs(tools::max_value() * factor) < fabs(value)) + if (fabs(tools::max_value() * factor) < fabs(value)) return sign(value) * sign(factor) * policies::raise_overflow_error(function, nullptr, pol); value /= factor; } diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index 6eb4b0009b..14f6780b68 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -180,6 +180,7 @@ void test_bessel(T, const char* name) if (std::numeric_limits::has_infinity) { BOOST_CHECK_EQUAL(boost::math::cyl_bessel_k(T(0), T(0)), std::numeric_limits::infinity()); + BOOST_CHECK_EQUAL(boost::math::cyl_bessel_k(16, ldexp(T(1), -1021)), std::numeric_limits::infinity()); } BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(1.25), T(0)), std::domain_error); BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(-1.25), T(0)), std::domain_error); diff --git a/test/test_bessel_k_prime.hpp b/test/test_bessel_k_prime.hpp index a434bae74d..7f0eb61516 100644 --- a/test/test_bessel_k_prime.hpp +++ b/test/test_bessel_k_prime.hpp @@ -180,5 +180,41 @@ void test_bessel(T, const char* name) // BOOST_CHECK_THROW(boost::math::cyl_bessel_k_prime(T(2.5), T(0)), std::domain_error); BOOST_CHECK_THROW(boost::math::cyl_bessel_k_prime(T(2), T(0)), std::domain_error); + + BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity && std::numeric_limits::min_exponent < -860) + { + static const std::array, 8> coverage_data = { { +#if LDBL_MAX_10_EXP > 310 + {{ SC_(20), static_cast(ldexp(T(1), -45)), SC_(-3.793503044583520787322174911740831752794438746336004555076e308) }}, + {{ SC_(20.125), static_cast(ldexp(T(1), -45)), SC_(-2.979220621533376610700938325572770408419207521624698386062e310) }}, +#else + {{ SC_(20), static_cast(ldexp(T(1), -45)), -std::numeric_limits::infinity() }}, + {{ SC_(20.125), static_cast(ldexp(T(1), -45)), -std::numeric_limits::infinity() }}, +#endif +#if LDBL_MAX_10_EXP > 346 + {{ SC_(20), static_cast(ldexp(T(1), -51)), SC_(-3.227155487331667007856383940813742118802894409545345203104e346) }}, + {{ SC_(20.125), static_cast(ldexp(T(1), -51)), SC_(-4.262404050083097364466577035647085801041781477814968803189e348) }}, +#else + {{ SC_(20), static_cast(ldexp(T(1), -51)), -std::numeric_limits::infinity() }}, + {{ SC_(20.125), static_cast(ldexp(T(1), -51)), -std::numeric_limits::infinity() }}, +#endif +#if LDBL_MAX_10_EXP > 4971 + {{ SC_(20), static_cast(ldexp(T(1), -778)), SC_(-2.15657066125095338369788943003323297569772178814715617602e4942) }}, + {{ SC_(20.125), static_cast(ldexp(T(1), -778)), SC_(-6.46694658438021098575183049117626387183087801364084017400e4971) }}, +#else + {{ SC_(20), static_cast(ldexp(T(1), -778)), -std::numeric_limits::infinity() }}, + {{ SC_(20.125), static_cast(ldexp(T(1), -778)), -std::numeric_limits::infinity() }}, +#endif +#if LDBL_MAX_10_EXP > 5493 + {{ SC_(20), static_cast(ldexp(T(1), -860)), SC_(-5.09819245599453059425108127687500966644642217657888061634e5460) }}, + {{ SC_(20.125), static_cast(ldexp(T(1), -860)), SC_(-1.86169813082884487070647108868007382252541071831005047607e5493) }}, +#else + {{ SC_(20), static_cast(ldexp(T(1), -860)), -std::numeric_limits::infinity() }}, + {{ SC_(20.125), static_cast(ldexp(T(1), -860)), -std::numeric_limits::infinity() }}, +#endif + } }; + do_test_cyl_bessel_k_prime(coverage_data, name, "Bessel K': Extra Coverage"); + } + } diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index b58fc3d8a5..08aeb4e529 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -243,5 +243,29 @@ void test_bessel(T, const char* name) BOOST_CHECK_CLOSE_FRACTION(boost::math::cyl_neumann(T(121.25), T(0.25)), SC_(-2.230082612409607659174017669618188190008214736253939486007e308), tolerance); } #endif + BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity && (std::numeric_limits::min_exponent < -1072)) + { + static const std::array::type, 3>, 5> coverage_data = { { +#if LDBL_MAX_10_EXP > 4931 + {{ 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 + {{ 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 + {{ SC_(31.25), ldexp(T(1), -1045), SC_(-1.64443614527479263825137492596041426343778386094212520006e9872)}}, +#else + {{ SC_(31.25), ldexp(T(1), -1045), -std::numeric_limits::infinity() }}, +#endif + {{ SC_(233), ldexp(T(1), -63), -std::numeric_limits::infinity() }}, + {{ SC_(233), ldexp(T(1), -64), -std::numeric_limits::infinity() }}, + } }; + + do_test_cyl_neumann_y(coverage_data, name, "Extra Coverage Data"); + } } From b8ea32436aba391b210b8f0a02fa2a048ff31f78 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Thu, 8 Feb 2024 19:56:27 +0000 Subject: [PATCH 17/26] Correct concept failures. --- include/boost/math/special_functions/detail/bessel_ik.hpp | 2 +- include/boost/math/special_functions/detail/bessel_kn.hpp | 2 +- test/test_bessel_y.hpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_ik.hpp b/include/boost/math/special_functions/detail/bessel_ik.hpp index b503352f20..da2310866f 100644 --- a/include/boost/math/special_functions/detail/bessel_ik.hpp +++ b/include/boost/math/special_functions/detail/bessel_ik.hpp @@ -360,7 +360,7 @@ int bessel_ik(T v, T x, T* result_I, T* result_K, int kind, const Policy& pol) { prev /= current; scale /= current; - scale_sign *= (boost::math::signbit(current) ? -1 : 1); + scale_sign *= ((boost::math::signbit)(current) ? -1 : 1); current = 1; } next = fact * current + prev; diff --git a/include/boost/math/special_functions/detail/bessel_kn.hpp b/include/boost/math/special_functions/detail/bessel_kn.hpp index 4fc086d584..d0ddcd0db4 100644 --- a/include/boost/math/special_functions/detail/bessel_kn.hpp +++ b/include/boost/math/special_functions/detail/bessel_kn.hpp @@ -75,7 +75,7 @@ T bessel_kn(int n, T x, const Policy& pol) } while(k < n); if (tools::max_value() * scale < fabs(value)) - return (signbit(scale) ? -1 : 1) * sign(value) * policies::raise_overflow_error(function, nullptr, pol); + return ((boost::math::signbit)(scale) ? -1 : 1) * sign(value) * policies::raise_overflow_error(function, nullptr, pol); value /= scale; } return value; diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index 08aeb4e529..730fd8d58c 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -245,7 +245,7 @@ void test_bessel(T, const char* name) #endif BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity && (std::numeric_limits::min_exponent < -1072)) { - static const std::array::type, 3>, 5> coverage_data = { { + static const std::array, 5> coverage_data = { { #if LDBL_MAX_10_EXP > 4931 {{ SC_(15.25), ldexp(T(1), -1071), SC_(-9.39553199265929955912687892204143267985847111378392154596e4931)}}, #else From 098676d6aca61732ed0fb79a2ff174ca1d2b68a2 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 9 Feb 2024 13:14:15 +0000 Subject: [PATCH 18/26] Correct test cases. --- test/test_bessel_k.hpp | 7 +++++-- test/test_bessel_y.hpp | 1 + test/test_bessel_y_prime.hpp | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/test/test_bessel_k.hpp b/test/test_bessel_k.hpp index 14f6780b68..8e59ae2256 100644 --- a/test/test_bessel_k.hpp +++ b/test/test_bessel_k.hpp @@ -177,10 +177,13 @@ void test_bessel(T, const char* name) // BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(2), T(-1)), std::domain_error); BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(2.2), T(-1)), std::domain_error); - if (std::numeric_limits::has_infinity) + 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_CHECK_EQUAL(boost::math::cyl_bessel_k(16, ldexp(T(1), -1021)), std::numeric_limits::infinity()); + 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()); + } } BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(1.25), T(0)), std::domain_error); BOOST_CHECK_THROW(boost::math::cyl_bessel_k(T(-1.25), T(0)), std::domain_error); diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index 730fd8d58c..d8920165b0 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -129,6 +129,7 @@ void do_test_sph_neumann_y(const T& data, const char* type_name, const char* tes template void test_bessel(T, const char* name) { + using std::ldexp; // // The actual test data is rather verbose, so it's in a separate file // diff --git a/test/test_bessel_y_prime.hpp b/test/test_bessel_y_prime.hpp index 1c0719e1dd..4e18e2d582 100644 --- a/test/test_bessel_y_prime.hpp +++ b/test/test_bessel_y_prime.hpp @@ -130,6 +130,7 @@ void do_test_sph_neumann_y_prime(const T& data, const char* type_name, const cha template void test_bessel_prime(T, const char* name) { + using std::ldexp; // // The actual test data is rather verbose, so it's in a separate file // From e285ef3501807248aa773183a0c11168a1136243 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 9 Feb 2024 16:23:33 +0000 Subject: [PATCH 19/26] Correct test cases. --- test/Jamfile.v2 | 4 +++- test/condition_number_test.cpp | 11 ++++++++--- test/test_bessel_y.hpp | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 3b6c3f2fca..5bc9a4fb32 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1001,7 +1001,9 @@ test-suite misc : [ run test_chatterjee_correlation.cpp ../../test/build//boost_unit_test_framework ] [ run test_rank.cpp ../../test/build//boost_unit_test_framework ] [ run lanczos_smoothing_test.cpp ../../test/build//boost_unit_test_framework : : : [ requires cxx17_if_constexpr cxx17_std_apply ] ] - [ run condition_number_test.cpp ../../test/build//boost_unit_test_framework : : : msvc:/bigobj [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : "-Bstatic -lquadmath -Bdynamic" ] ] + [ run condition_number_test.cpp ../../test/build//boost_unit_test_framework : : : TEST=1 msvc:/bigobj [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : "-Bstatic -lquadmath -Bdynamic" ] : condition_number_test_1 ] + [ run condition_number_test.cpp ../../test/build//boost_unit_test_framework : : : TEST=2 msvc:/bigobj [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : "-Bstatic -lquadmath -Bdynamic" ] : condition_number_test_2 ] + [ run condition_number_test.cpp ../../test/build//boost_unit_test_framework : : : TEST=3 msvc:/bigobj [ check-target-builds ../config//has_float128 "GCC libquadmath and __float128 support" : "-Bstatic -lquadmath -Bdynamic" ] : condition_number_test_3 ] [ run test_real_concept.cpp ../../test/build//boost_unit_test_framework ] [ run test_remez.cpp pch ../../test/build//boost_unit_test_framework ] [ run test_roots.cpp pch ../../test/build//boost_unit_test_framework ] diff --git a/test/condition_number_test.cpp b/test/condition_number_test.cpp index 7d495bd8bc..29e2a4efb6 100644 --- a/test/condition_number_test.cpp +++ b/test/condition_number_test.cpp @@ -110,14 +110,19 @@ void test_evaluation_condition_number() } } - BOOST_AUTO_TEST_CASE(numerical_differentiation_test) { +#if !defined(TEST) || (TEST == 1) test_summation_condition_number(); - test_summation_condition_number(); test_evaluation_condition_number(); test_evaluation_condition_number(); test_evaluation_condition_number(); - test_evaluation_condition_number(); test_exponential_sum(); +#endif +#if !defined(TEST) || (TEST == 2) + test_summation_condition_number(); +#endif +#if !defined(TEST) || (TEST == 3) + test_evaluation_condition_number(); +#endif } diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index d8920165b0..a6fa036681 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -262,8 +262,8 @@ void test_bessel(T, const char* name) #else {{ SC_(31.25), ldexp(T(1), -1045), -std::numeric_limits::infinity() }}, #endif - {{ SC_(233), ldexp(T(1), -63), -std::numeric_limits::infinity() }}, - {{ SC_(233), ldexp(T(1), -64), -std::numeric_limits::infinity() }}, + {{ SC_(233.0), ldexp(T(1), -63), -std::numeric_limits::infinity() }}, + {{ SC_(233.0), ldexp(T(1), -64), -std::numeric_limits::infinity() }}, } }; do_test_cyl_neumann_y(coverage_data, name, "Extra Coverage Data"); From 1d1a52cc272e57ea6b75b106beb53a57a6c4fe32 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 9 Feb 2024 18:11:18 +0000 Subject: [PATCH 20/26] Correct gauss and gauss_kronrod integrators with strange-precision types. --- include/boost/math/quadrature/gauss.hpp | 4 ++-- include/boost/math/quadrature/gauss_kronrod.hpp | 8 ++++---- test/git_issue_1075.cpp | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/include/boost/math/quadrature/gauss.hpp b/include/boost/math/quadrature/gauss.hpp index bbe9f19b37..91ffcf0bcd 100644 --- a/include/boost/math/quadrature/gauss.hpp +++ b/include/boost/math/quadrature/gauss.hpp @@ -798,8 +798,8 @@ class gauss : public detail::gauss_detail(base::abscissa()[i])); + K fm = f(static_cast(-base::abscissa()[i])); result += (fp + fm) * static_cast(base::weights()[i]); L1 += (abs(fp) + abs(fm)) * static_cast(base::weights()[i]); } diff --git a/include/boost/math/quadrature/gauss_kronrod.hpp b/include/boost/math/quadrature/gauss_kronrod.hpp index 9604d29e82..a81cb43c4f 100644 --- a/include/boost/math/quadrature/gauss_kronrod.hpp +++ b/include/boost/math/quadrature/gauss_kronrod.hpp @@ -1159,16 +1159,16 @@ class gauss_kronrod : public detail::gauss_kronrod_detail(base::abscissa()[i])); + fm = f(static_cast(-base::abscissa()[i])); kronrod_result += (fp + fm) * static_cast(base::weights()[i]); L1 += (abs(fp) + abs(fm)) * static_cast(base::weights()[i]); gauss_result += (fp + fm) * static_cast(gauss::weights()[i / 2]); } for (unsigned i = kronrod_start; i < base::abscissa().size(); i += 2) { - fp = f(base::abscissa()[i]); - fm = f(-base::abscissa()[i]); + fp = f(static_cast(base::abscissa()[i])); + fm = f(static_cast(-base::abscissa()[i])); kronrod_result += (fp + fm) * static_cast(base::weights()[i]); L1 += (abs(fp) + abs(fm)) * static_cast(base::weights()[i]); } diff --git a/test/git_issue_1075.cpp b/test/git_issue_1075.cpp index 28252d63d4..03b93f3b12 100644 --- a/test/git_issue_1075.cpp +++ b/test/git_issue_1075.cpp @@ -26,6 +26,17 @@ void test() std::cout << r << std::endl; r = boost::math::quadrature::gauss_kronrod::integrate(f, 0, 1, 0, 0, &error); std::cout << r << std::endl; + + r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); + std::cout << r << std::endl; + r = boost::math::quadrature::gauss::integrate(f, 0, 1, &error); + std::cout << r << std::endl; } @@ -35,5 +46,8 @@ int main() test(); test(); + using strange = boost::multiprecision::number, boost::multiprecision::et_off>; + test(); + return 0; } From eef497efea6df4cc5ec1a704c0ecc1ee122b76a9 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 9 Feb 2024 18:25:31 +0000 Subject: [PATCH 21/26] Make bessel_k_prime integer order aware. --- .../detail/bessel_derivatives_linear.hpp | 8 ++++++++ test/test_bessel_k_prime.hpp | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp b/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp index 42abbc15be..a391c33bf4 100644 --- a/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp +++ b/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp @@ -75,6 +75,14 @@ inline T bessel_k_derivative_linear(T v, T x, const bessel_int_tag& tag, Policy return result + result2; } +template +inline T bessel_k_derivative_linear(T v, T x, const bessel_maybe_int_tag&, Policy pol) +{ + if (floor(v) == v) + return bessel_k_derivative_linear(v, x, bessel_int_tag(), pol); + return bessel_k_derivative_linear(v, x, bessel_no_int_tag(), pol); +} + template inline T bessel_y_derivative_linear(T v, T x, Tag tag, Policy pol) { diff --git a/test/test_bessel_k_prime.hpp b/test/test_bessel_k_prime.hpp index 7f0eb61516..f43728c118 100644 --- a/test/test_bessel_k_prime.hpp +++ b/test/test_bessel_k_prime.hpp @@ -185,31 +185,31 @@ void test_bessel(T, const char* name) { static const std::array, 8> coverage_data = { { #if LDBL_MAX_10_EXP > 310 - {{ SC_(20), static_cast(ldexp(T(1), -45)), SC_(-3.793503044583520787322174911740831752794438746336004555076e308) }}, + {{ SC_(20.0), static_cast(ldexp(T(1), -45)), SC_(-3.793503044583520787322174911740831752794438746336004555076e308) }}, {{ SC_(20.125), static_cast(ldexp(T(1), -45)), SC_(-2.979220621533376610700938325572770408419207521624698386062e310) }}, #else - {{ SC_(20), static_cast(ldexp(T(1), -45)), -std::numeric_limits::infinity() }}, + {{ SC_(20.0), static_cast(ldexp(T(1), -45)), -std::numeric_limits::infinity() }}, {{ SC_(20.125), static_cast(ldexp(T(1), -45)), -std::numeric_limits::infinity() }}, #endif #if LDBL_MAX_10_EXP > 346 - {{ SC_(20), static_cast(ldexp(T(1), -51)), SC_(-3.227155487331667007856383940813742118802894409545345203104e346) }}, + {{ SC_(20.0), static_cast(ldexp(T(1), -51)), SC_(-3.227155487331667007856383940813742118802894409545345203104e346) }}, {{ SC_(20.125), static_cast(ldexp(T(1), -51)), SC_(-4.262404050083097364466577035647085801041781477814968803189e348) }}, #else - {{ SC_(20), static_cast(ldexp(T(1), -51)), -std::numeric_limits::infinity() }}, + {{ SC_(20.0), static_cast(ldexp(T(1), -51)), -std::numeric_limits::infinity() }}, {{ SC_(20.125), static_cast(ldexp(T(1), -51)), -std::numeric_limits::infinity() }}, #endif #if LDBL_MAX_10_EXP > 4971 - {{ SC_(20), static_cast(ldexp(T(1), -778)), SC_(-2.15657066125095338369788943003323297569772178814715617602e4942) }}, + {{ SC_(20.0), static_cast(ldexp(T(1), -778)), SC_(-2.15657066125095338369788943003323297569772178814715617602e4942) }}, {{ SC_(20.125), static_cast(ldexp(T(1), -778)), SC_(-6.46694658438021098575183049117626387183087801364084017400e4971) }}, #else - {{ SC_(20), static_cast(ldexp(T(1), -778)), -std::numeric_limits::infinity() }}, + {{ SC_(20.0), static_cast(ldexp(T(1), -778)), -std::numeric_limits::infinity() }}, {{ SC_(20.125), static_cast(ldexp(T(1), -778)), -std::numeric_limits::infinity() }}, #endif #if LDBL_MAX_10_EXP > 5493 - {{ SC_(20), static_cast(ldexp(T(1), -860)), SC_(-5.09819245599453059425108127687500966644642217657888061634e5460) }}, + {{ SC_(20.0), static_cast(ldexp(T(1), -860)), SC_(-5.09819245599453059425108127687500966644642217657888061634e5460) }}, {{ SC_(20.125), static_cast(ldexp(T(1), -860)), SC_(-1.86169813082884487070647108868007382252541071831005047607e5493) }}, #else - {{ SC_(20), static_cast(ldexp(T(1), -860)), -std::numeric_limits::infinity() }}, + {{ SC_(20.0), static_cast(ldexp(T(1), -860)), -std::numeric_limits::infinity() }}, {{ SC_(20.125), static_cast(ldexp(T(1), -860)), -std::numeric_limits::infinity() }}, #endif } }; From 851c171f1677370a3911ce5e1e35c8023f08d8ac Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Fri, 9 Feb 2024 19:34:42 +0000 Subject: [PATCH 22/26] More bessel function tests for improved coverage. Kill some unused variable warnings. Mark up code we think is unreachable but aren't sure about. --- .../boost/math/special_functions/detail/bessel_jy.hpp | 10 +++++----- .../math/special_functions/detail/bessel_jy_series.hpp | 8 ++++++-- .../math/special_functions/detail/bessel_jy_zero.hpp | 2 +- .../boost/math/special_functions/detail/bessel_y0.hpp | 2 +- .../boost/math/special_functions/detail/bessel_y1.hpp | 2 +- test/test_bessel_y.hpp | 8 +++++++- 6 files changed, 21 insertions(+), 11 deletions(-) diff --git a/include/boost/math/special_functions/detail/bessel_jy.hpp b/include/boost/math/special_functions/detail/bessel_jy.hpp index a41e2744d3..90e099eb77 100644 --- a/include/boost/math/special_functions/detail/bessel_jy.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy.hpp @@ -310,14 +310,14 @@ namespace boost { namespace math { else if(kind & need_j) *J = policies::raise_domain_error(function, "Value of Bessel J_v(x) is complex-infinity at %1%", x, pol); // complex infinity else - *J = std::numeric_limits::quiet_NaN(); // any value will do, not using J. + *J = std::numeric_limits::quiet_NaN(); // LCOV_EXCL_LINE, we should never get here, any value will do, not using J. if((kind & need_y) == 0) *Y = std::numeric_limits::quiet_NaN(); // any value will do, not using Y. else { // We shoud never get here: - BOOST_MATH_ASSERT(x != 0); + BOOST_MATH_ASSERT(x != 0); // LCOV_EXCL_LINE } return 1; } @@ -420,9 +420,9 @@ namespace boost { namespace math { { if(temme_jy(u, x, &Yu, &Yu1, pol)) // Temme series { - // domain error, this should really have already been handled, LCOV_EXCL_LINE - *J = *Y = Yu; - return 1; + // domain error, this should really have already been handled. + *J = *Y = Yu; // LCOV_EXCL_LINE + return 1; // LCOV_EXCL_LINE } prev = Yu; current = Yu1; diff --git a/include/boost/math/special_functions/detail/bessel_jy_series.hpp b/include/boost/math/special_functions/detail/bessel_jy_series.hpp index ebcb62f910..db46f36400 100644 --- a/include/boost/math/special_functions/detail/bessel_jy_series.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy_series.hpp @@ -156,10 +156,13 @@ inline T bessel_y_small_z_series(T v, T x, T* pscale, const Policy& pol) { scale /= gam; gam = 1; + /* + * We can never get here, it would require p < 1/max_value. if(tools::max_value() * p < gam) { return -policies::raise_overflow_error(function, nullptr, pol); } + */ } prefix = -gam / (constants::pi() * p); } @@ -244,14 +247,15 @@ T bessel_yn_small_z(int n, T z, T* scale, const Policy& pol) #endif T result = -((boost::math::factorial(n - 1, pol) / constants::pi())); - if(p * tools::max_value() < result) + if(p * tools::max_value() < fabs(result)) { T div = tools::max_value() / 8; result /= div; *scale /= div; if(p * tools::max_value() < result) { - return -policies::raise_overflow_error("bessel_yn_small_z<%1%>(%1%,%1%)", nullptr, pol); + // Impossible to get here?? + return -policies::raise_overflow_error("bessel_yn_small_z<%1%>(%1%,%1%)", nullptr, pol); // LCOV_EXCL_LINE } } return result / p; diff --git a/include/boost/math/special_functions/detail/bessel_jy_zero.hpp b/include/boost/math/special_functions/detail/bessel_jy_zero.hpp index 3fdb413d9f..cb1fc48d83 100644 --- a/include/boost/math/special_functions/detail/bessel_jy_zero.hpp +++ b/include/boost/math/special_functions/detail/bessel_jy_zero.hpp @@ -315,7 +315,7 @@ } else { - root_lo *= 0.75F; + root_lo *= 0.75F; // LCOV_EXCL_LINE probably unreachable, but hard to prove? } } } diff --git a/include/boost/math/special_functions/detail/bessel_y0.hpp b/include/boost/math/special_functions/detail/bessel_y0.hpp index 952b284185..ed43189f8d 100644 --- a/include/boost/math/special_functions/detail/bessel_y0.hpp +++ b/include/boost/math/special_functions/detail/bessel_y0.hpp @@ -39,7 +39,7 @@ template T bessel_y0(T x, const Policy&); template -T bessel_y0(T x, const Policy& pol) +T bessel_y0(T x, const Policy&) { static const T P1[] = { static_cast(BOOST_MATH_BIG_CONSTANT(T, 64, 1.0723538782003176831e+11)), diff --git a/include/boost/math/special_functions/detail/bessel_y1.hpp b/include/boost/math/special_functions/detail/bessel_y1.hpp index b7c5c2f7ef..3ac696bb5c 100644 --- a/include/boost/math/special_functions/detail/bessel_y1.hpp +++ b/include/boost/math/special_functions/detail/bessel_y1.hpp @@ -39,7 +39,7 @@ template T bessel_y1(T x, const Policy&); template -T bessel_y1(T x, const Policy& pol) +T bessel_y1(T x, const Policy&) { static const T P1[] = { static_cast(BOOST_MATH_BIG_CONSTANT(T, 64, 4.0535726612579544093e+13)), diff --git a/test/test_bessel_y.hpp b/test/test_bessel_y.hpp index a6fa036681..ccbf61f78c 100644 --- a/test/test_bessel_y.hpp +++ b/test/test_bessel_y.hpp @@ -246,7 +246,7 @@ void test_bessel(T, const char* name) #endif BOOST_IF_CONSTEXPR(std::numeric_limits::has_infinity && (std::numeric_limits::min_exponent < -1072)) { - static const std::array, 5> coverage_data = { { + static const std::array, 7> coverage_data = { { #if LDBL_MAX_10_EXP > 4931 {{ SC_(15.25), ldexp(T(1), -1071), SC_(-9.39553199265929955912687892204143267985847111378392154596e4931)}}, #else @@ -264,6 +264,12 @@ void test_bessel(T, const char* name) #endif {{ 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 + {{ SC_(200.25), SC_(1.25), SC_(-3.545198572052800784992190965856441074217589237581037286156e413)}}, +#else + {{ SC_(200.25), SC_(1.25), -std::numeric_limits::infinity()}}, +#endif + {{ SC_(1652.25), SC_(1.25), -std::numeric_limits::infinity()}}, } }; do_test_cyl_neumann_y(coverage_data, name, "Extra Coverage Data"); From da7a945e028b8fee23062a5b960d6e66ea16d786 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 10 Feb 2024 09:27:35 +0000 Subject: [PATCH 23/26] Add missing using statement. --- .../math/special_functions/detail/bessel_derivatives_linear.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp b/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp index a391c33bf4..ca62f38a5b 100644 --- a/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp +++ b/include/boost/math/special_functions/detail/bessel_derivatives_linear.hpp @@ -78,6 +78,7 @@ inline T bessel_k_derivative_linear(T v, T x, const bessel_int_tag& tag, Policy template inline T bessel_k_derivative_linear(T v, T x, const bessel_maybe_int_tag&, Policy pol) { + using std::floor; if (floor(v) == v) return bessel_k_derivative_linear(v, x, bessel_int_tag(), pol); return bessel_k_derivative_linear(v, x, bessel_no_int_tag(), pol); From 48b249115f8aeb7293f5b9df31292328f9ea9369 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 10 Feb 2024 10:33:36 +0000 Subject: [PATCH 24/26] Add better bessel_iterator tests. --- .../special_functions/bessel_iterators.hpp | 3 +- include/boost/math/tools/recurrence.hpp | 2 + test/Jamfile.v2 | 1 + test/bessel_iterator_test.cpp | 79 +++++++++++++++++++ test/condition_number_test.cpp | 3 + 5 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 test/bessel_iterator_test.cpp diff --git a/include/boost/math/special_functions/bessel_iterators.hpp b/include/boost/math/special_functions/bessel_iterators.hpp index c577f75644..c5dbb5c02b 100644 --- a/include/boost/math/special_functions/bessel_iterators.hpp +++ b/include/boost/math/special_functions/bessel_iterators.hpp @@ -9,6 +9,7 @@ #define BOOST_MATH_BESSEL_ITERATORS_HPP #include +#include namespace boost { namespace math { @@ -154,7 +155,7 @@ namespace boost { if (v > 1) boost::math::policies::raise_domain_error("bessel_i_forwards_iterator<%1%>", "Order must be < 0 stable forwards recurrence but got %1%", v, Policy()); } - bessel_i_forwards_iterator(const T& v, const T& x, const T& I_v_plus_1, const T& I_v) + bessel_i_forwards_iterator(const T& v, const T& x, const T& I_v_minus_1, const T& I_v) : it(detail::bessel_ik_recurrence(v, x), I_v_plus_1, I_v) { if (v > 1) diff --git a/include/boost/math/tools/recurrence.hpp b/include/boost/math/tools/recurrence.hpp index 10b3c097b2..b08988d4bf 100644 --- a/include/boost/math/tools/recurrence.hpp +++ b/include/boost/math/tools/recurrence.hpp @@ -15,6 +15,8 @@ #include #include #include +#include +#include namespace boost { namespace math { diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index dbef5a5aeb..685bc15ccd 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -181,6 +181,7 @@ test-suite special_fun : [ run test_bessel_y_prime.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] [ run test_bessel_i_prime.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] [ run test_bessel_k_prime.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] + [ run bessel_iterator_test.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] [ run test_beta.cpp test_instances//test_instances pch_light ../../test/build//boost_unit_test_framework ] [ run test_bessel_airy_zeros.cpp ../../test/build//boost_unit_test_framework ] [ run test_bernoulli_constants.cpp ../../test/build//boost_unit_test_framework ] diff --git a/test/bessel_iterator_test.cpp b/test/bessel_iterator_test.cpp new file mode 100644 index 0000000000..e79ffda908 --- /dev/null +++ b/test/bessel_iterator_test.cpp @@ -0,0 +1,79 @@ +// (C) Copyright John Maddock, 2024 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#define BOOST_TEST_MAIN +#include +#include + + +BOOST_AUTO_TEST_CASE(test_main) +{ + using boost::math::bessel_j_backwards_iterator; + using boost::math::bessel_i_backwards_iterator; + using boost::math::bessel_i_forwards_iterator; + + BOOST_CHECK_THROW(bessel_j_backwards_iterator(-2.3, 5.0), std::domain_error); + BOOST_CHECK_THROW(bessel_j_backwards_iterator(-2.3, 5.0, 2.0), std::domain_error); + BOOST_CHECK_THROW(bessel_j_backwards_iterator(-2.3, 5.0, 2.0, 2.0), std::domain_error); + + double tolerance = std::numeric_limits::epsilon() * 5; + + { + bessel_j_backwards_iterator i(12, 2.0); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_j(8, 2.0), tolerance); + } + { + bessel_j_backwards_iterator i(12, 2.0, boost::math::cyl_bessel_j(12, 2.0)); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_j(8, 2.0), tolerance); + } + { + bessel_j_backwards_iterator i(12, 2.0, boost::math::cyl_bessel_j(13, 2.0), boost::math::cyl_bessel_j(12, 2.0)); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_j(8, 2.0), tolerance); + } + + { + bessel_i_backwards_iterator i(12, 2.0); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(8, 2.0), tolerance); + } + { + bessel_i_backwards_iterator i(12, 2.0, boost::math::cyl_bessel_i(12, 2.0)); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(8, 2.0), tolerance); + } + { + bessel_i_backwards_iterator i(12, 2.0, boost::math::cyl_bessel_i(13, 2.0), boost::math::cyl_bessel_i(12, 2.0)); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(8, 2.0), tolerance); + } + + { + bessel_i_forwards_iterator i(-12, 2.0); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(-8, 2.0), tolerance); + } + { + bessel_i_forwards_iterator i(-12, 2.0, boost::math::cyl_bessel_i(-12, 2.0)); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(-8, 2.0), tolerance); + } + { + bessel_i_forwards_iterator i(-12, 2.0, boost::math::cyl_bessel_i(-13, 2.0), boost::math::cyl_bessel_i(-12, 2.0)); + for (unsigned j = 0; j < 4; ++j) + ++i; + BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(-8, 2.0), tolerance); + } +} diff --git a/test/condition_number_test.cpp b/test/condition_number_test.cpp index 5bd89eee1d..508b924389 100644 --- a/test/condition_number_test.cpp +++ b/test/condition_number_test.cpp @@ -7,6 +7,9 @@ #include "math_unit_test.hpp" #include #include +#if !defined(TEST) || (TEST > 1) +#include +#endif using std::abs; using std::log; From bdcecaa7be801d31ad040bfe6faab4ff045b443d Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 10 Feb 2024 10:42:45 +0000 Subject: [PATCH 25/26] Correct variable name. --- include/boost/math/special_functions/bessel_iterators.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/math/special_functions/bessel_iterators.hpp b/include/boost/math/special_functions/bessel_iterators.hpp index c5dbb5c02b..7e0de2f865 100644 --- a/include/boost/math/special_functions/bessel_iterators.hpp +++ b/include/boost/math/special_functions/bessel_iterators.hpp @@ -156,7 +156,7 @@ namespace boost { boost::math::policies::raise_domain_error("bessel_i_forwards_iterator<%1%>", "Order must be < 0 stable forwards recurrence but got %1%", v, Policy()); } bessel_i_forwards_iterator(const T& v, const T& x, const T& I_v_minus_1, const T& I_v) - : it(detail::bessel_ik_recurrence(v, x), I_v_plus_1, I_v) + : it(detail::bessel_ik_recurrence(v, x), I_v_minus_1, I_v) { if (v > 1) boost::math::policies::raise_domain_error("bessel_i_forwards_iterator<%1%>", "Order must be < 0 stable forwards recurrence but got %1%", v, Policy()); From 84b1208abfac630dc02735776e5db2625a8d72e7 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sat, 10 Feb 2024 11:11:18 +0000 Subject: [PATCH 26/26] Correct bad merge of condition_number_test (again). --- test/condition_number_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/condition_number_test.cpp b/test/condition_number_test.cpp index 508b924389..8e7c41827b 100644 --- a/test/condition_number_test.cpp +++ b/test/condition_number_test.cpp @@ -114,10 +114,10 @@ int main() test_exponential_sum(); #endif #if !defined(TEST) || (TEST == 2) - test_summation_condition_number(); + test_summation_condition_number(); #endif #if !defined(TEST) || (TEST == 3) - test_evaluation_condition_number(); + test_evaluation_condition_number(); #endif return boost::math::test::report_errors(); }