1 ///////////////////////////////////////////////////////////////
2 // Copyright Christopher Kormanyos 2002 - 2011.
3 // Copyright 2011 John Maddock. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_
7 // This work is based on an earlier work:
8 // "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
9 // in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
12 #include "table_type.hpp"
14 #include <boost/math/special_functions/math_fwd.hpp>
15 #include "libs/math/test/test_bessel_j.hpp"
17 void expected_results()
20 // Define the max and mean errors expected for
21 // various compilers and platforms.
28 ".*mpfr_float_backend<18>.*", // test type(s)
29 ".*J0.*Tricky.*", // test data group
30 ".*", 10000000000L, 5000000000L); // test function
36 ".*J0.*Tricky.*", // test data group
37 ".*", 400000000, 400000000); // test function
42 ".*mpfr_float_backend<18>.*", // test type(s)
43 ".*J1.*Tricky.*", // test data group
44 ".*", 1000000000L, 500000000L); // test function
50 ".*J1.*Tricky.*", // test data group
51 ".*", 10000000, 5000000); // test function
56 ".*cpp_bin_float.*", // test type(s)
57 ".*JN.*Integer.*", // test data group
58 ".*", 500000, 150000); // test function
64 ".*JN.*Integer.*", // test data group
65 ".*", 50000, 15000); // test function
70 ".*mpfr_float_backend<18>.*", // test type(s)
71 ".*(JN|j).*|.*Tricky.*", // test data group
72 ".*", 70000, 7000); // test function
77 ".*cpp_bin_float.*", // test type(s)
78 ".*(JN|j).*|.*Tricky.*", // test data group
79 ".*", 500000, 200000); // test function
85 ".*(JN|j).*|.*Tricky.*", // test data group
86 ".*", 7000, 3000); // test function
92 ".*", // test data group
93 ".*", 40, 20); // test function
95 // Finish off by printing out the compiler/stdlib/platform names,
96 // we do this to make it easier to mark up expected error rates.
98 std::cout << "Tests run with " << BOOST_COMPILER << ", "
99 << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
103 void test(T t, const char* p)
109 BOOST_AUTO_TEST_CASE( test_main )
111 using namespace boost::multiprecision;
115 // 18 decimal digits: tests 80-bit long double approximations
116 // 30 decimal digits: tests 128-bit long double approximations
117 // 35 decimal digits: tests arbitrary precision code