Last few Bessel function coverage tests.

This commit is contained in:
jzmaddock 2024-02-10 16:17:40 +00:00
parent 84b1208abf
commit 2d11c5392b
2 changed files with 22 additions and 0 deletions

View File

@ -25,6 +25,9 @@ BOOST_AUTO_TEST_CASE(test_main)
for (unsigned j = 0; j < 4; ++j)
++i;
BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_j(8, 2.0), tolerance);
double v = *i++;
BOOST_CHECK_CLOSE_FRACTION(v, boost::math::cyl_bessel_j(8, 2.0), tolerance);
BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_j(7, 2.0), tolerance);
}
{
bessel_j_backwards_iterator<double> i(12, 2.0, boost::math::cyl_bessel_j(12, 2.0));
@ -44,6 +47,13 @@ BOOST_AUTO_TEST_CASE(test_main)
for (unsigned j = 0; j < 4; ++j)
++i;
BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(8, 2.0), tolerance);
double v = *i++;
BOOST_CHECK_CLOSE_FRACTION(v, boost::math::cyl_bessel_i(8, 2.0), tolerance);
BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(7, 2.0), tolerance);
BOOST_CHECK_THROW(bessel_i_backwards_iterator<double>(-1.1, 2.0), std::domain_error);
BOOST_CHECK_THROW(bessel_i_backwards_iterator<double>(-1.1, 2.0, 1.0), std::domain_error);
BOOST_CHECK_THROW(bessel_i_backwards_iterator<double>(-1.1, 2.0, 1.0, 1.0), std::domain_error);
}
{
bessel_i_backwards_iterator<double> i(12, 2.0, boost::math::cyl_bessel_i(12, 2.0));
@ -63,6 +73,13 @@ BOOST_AUTO_TEST_CASE(test_main)
for (unsigned j = 0; j < 4; ++j)
++i;
BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(-8, 2.0), tolerance);
double v = *i++;
BOOST_CHECK_CLOSE_FRACTION(v, boost::math::cyl_bessel_i(-8, 2.0), tolerance);
BOOST_CHECK_CLOSE_FRACTION(*i, boost::math::cyl_bessel_i(-7, 2.0), tolerance);
BOOST_CHECK_THROW(bessel_i_forwards_iterator<double>(1.1, 2.0), std::domain_error);
BOOST_CHECK_THROW(bessel_i_forwards_iterator<double>(1.1, 2.0, 1.0), std::domain_error);
BOOST_CHECK_THROW(bessel_i_forwards_iterator<double>(1.1, 2.0, 1.0, 1.0), std::domain_error);
}
{
bessel_i_forwards_iterator<double> i(-12, 2.0, boost::math::cyl_bessel_i(-12, 2.0));

View File

@ -242,5 +242,10 @@ void test_bessel_prime(T, const char* name)
} };
do_test_cyl_neumann_y_prime<T>(yv_prime_coverage_data, name, "y': Extra coverage data");
}
static const std::array<std::array<T, 3>, 1> sph_prime_coverage_data = { {
// (SphericalBesselY[-1, 5/2] - (SphericalBesselY(0, 5/2)+5/2 * SphericalBesselY[1, 5/2])/(5/2))/2
{{ SC_(0.0), SC_(2.5), SC_(0.1112058791540732032473814343996886423728680128280382077091151343) }},
} };
do_test_sph_neumann_y_prime<T>(sph_prime_coverage_data, name, "y': Extra coverage data");
}