]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/test_1F1_log.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / math / test / test_1F1_log.hpp
1 // Copyright John Maddock 2006.
2 // Copyright Paul A. Bristow 2007, 2009
3 // Use, modification and distribution are subject to the
4 // Boost Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6
7 #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
8
9 #include <boost/math/concepts/real_concept.hpp>
10 #include <boost/math/special_functions/math_fwd.hpp>
11 #define BOOST_TEST_MAIN
12 #include <boost/test/unit_test.hpp>
13 #include <boost/test/tools/floating_point_comparison.hpp>
14 #include <boost/math/tools/stats.hpp>
15 #include <boost/math/tools/test.hpp>
16 #include <boost/math/tools/big_constant.hpp>
17 #include <boost/math/constants/constants.hpp>
18 #include <boost/type_traits/is_floating_point.hpp>
19 #include <boost/array.hpp>
20 #include "functor.hpp"
21
22 #include "handle_test_result.hpp"
23 #include "table_type.hpp"
24
25 #include <boost/math/special_functions/hypergeometric_1F1.hpp>
26 #include <boost/math/quadrature/exp_sinh.hpp>
27
28 #ifdef _MSC_VER
29 #pragma warning(disable:4127)
30 #endif
31
32 template <class Real, class T>
33 void do_test_1F1(const T& data, const char* type_name, const char* test_name)
34 {
35 typedef Real value_type;
36
37 typedef value_type(*pg)(value_type, value_type, value_type);
38 #if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
39 pg funcp = boost::math::log_hypergeometric_1F1<value_type, value_type>;
40 #else
41 pg funcp = boost::math::log_hypergeometric_1F1;
42 #endif
43
44 boost::math::tools::test_result<value_type> result;
45
46 std::cout << "Testing " << test_name << " with type " << type_name
47 << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
48
49 //
50 // test hypergeometric_2F0 against data:
51 //
52 result = boost::math::tools::test_hetero<Real>(
53 data,
54 bind_func<Real>(funcp, 0, 1, 2),
55 extract_result<Real>(3));
56 handle_test_result(result, data[result.worst()], result.worst(), type_name, "log_hypergeometric_1F1", test_name);
57 std::cout << std::endl;
58 }
59
60 #ifndef SC_
61 #define SC_(x) BOOST_MATH_BIG_CONSTANT(T, 1000000, x)
62 #endif
63
64 template <class T>
65 void test_spots1(T, const char* type_name)
66 {
67 #include "hypergeometric_1f1_log_large.ipp"
68
69 do_test_1F1<T>(hypergeometric_1f1_log_large, type_name, "Large random values - log");
70 }
71
72 template <class T>
73 void test_spots2(T, const char* type_name)
74 {
75 #include "hypergeometric_1f1_log_large_unsolved.ipp"
76
77 do_test_1F1<T>(hypergeometric_1f1_log_large_unsolved, type_name, "Large random values - log - unsolved");
78 }
79
80 template <class T>
81 void test_spots(T z, const char* type_name)
82 {
83 test_spots1(z, type_name);
84 #ifdef TEST_UNSOLVED
85 test_spots2(z, type_name);
86 #endif
87 }
88