#include <iostream>
#include <boost/type_index.hpp>
#include <boost/test/included/unit_test.hpp>
-#include <boost/test/floating_point_comparison.hpp>
-#include <boost/multiprecision/cpp_bin_float.hpp>
-#include <boost/multiprecision/cpp_dec_float.hpp>
+#include <boost/test/tools/floating_point_comparison.hpp>
#include <boost/math/special_functions/bessel.hpp>
#include <boost/math/special_functions/bessel_prime.hpp>
#include <boost/math/special_functions/next.hpp>
-#include <boost/math/tools/numerical_differentiation.hpp>
+#include <boost/math/differentiation/finite_difference.hpp>
using std::abs;
using std::pow;
-using boost::math::tools::finite_difference_derivative;
-using boost::math::tools::complex_step_derivative;
+using boost::math::differentiation::finite_difference_derivative;
+using boost::math::differentiation::complex_step_derivative;
using boost::math::cyl_bessel_j;
using boost::math::cyl_bessel_j_prime;
using boost::math::constants::half;
-using boost::multiprecision::cpp_dec_float_100;
-using boost::multiprecision::cpp_bin_float_50;
-using boost::multiprecision::cpp_bin_float_100;
-using boost::multiprecision::cpp_bin_float_quad;
-
template<class Real, size_t order>
void test_order(size_t points_to_test)
std::cout << "Testing order " << order << " derivative error estimate on type " << boost::typeindex::type_id<Real>().pretty_name() << "\n";
std::cout << std::setprecision(std::numeric_limits<Real>::digits10);
//std::cout << std::fixed << std::scientific;
- auto f = [](Real t) { return cyl_bessel_j<Real>(1, t); };
+ auto f = [](Real t) { return boost::math::cyl_bessel_j<Real>(1, t); };
Real min = -100000.0;
Real max = -min;
Real x = min;
Real eps = std::numeric_limits<Real>::epsilon();
Real x = static_cast<Real>(25.1);
- auto f = [](Real t) { return cyl_bessel_j(12, t); };
+ auto f = [](Real t) { return boost::math::cyl_bessel_j(12, t); };
Real computed = finite_difference_derivative<decltype(f), Real, 1>(f, x);
Real expected = cyl_bessel_j_prime(12, x);
{
test_complex_step<float>();
test_complex_step<double>();
-#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- test_complex_step<long double>();
-#endif
+
test_bessel<float>();
test_bessel<double>();
-#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- test_bessel<long double>();
-#endif
- test_bessel<cpp_bin_float_50>();
+
size_t points_to_test = 1000;
test_order<float, 1>(points_to_test);
test_order<double, 1>(points_to_test);
-#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- test_order<long double, 1>(points_to_test);
-#endif
- test_order<cpp_bin_float_50, 1>(points_to_test);
+
test_order<float, 2>(points_to_test);
test_order<double, 2>(points_to_test);
-#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- test_order<long double, 2>(points_to_test);
-#endif
- test_order<cpp_bin_float_50, 2>(points_to_test);
test_order<float, 4>(points_to_test);
test_order<double, 4>(points_to_test);
-#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- test_order<long double, 4>(points_to_test);
-#endif
test_order<float, 6>(points_to_test);
test_order<double, 6>(points_to_test);
-#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- test_order<long double, 6>(points_to_test);
-#endif
test_order<float, 8>(points_to_test);
test_order<double, 8>(points_to_test);
-#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
- test_order<long double, 8>(points_to_test);
-#endif
+
}