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)
7 #define BOOST_MATH_OVERFLOW_ERROR_POLICY ignore_error
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"
22 #include "handle_test_result.hpp"
23 #include "table_type.hpp"
25 #include <boost/math/special_functions/hypergeometric_1F1.hpp>
26 #include <boost/math/quadrature/exp_sinh.hpp>
29 #pragma warning(disable:4127)
32 template <class Real, class T>
33 void do_test_1F1(const T& data, const char* type_name, const char* test_name)
35 typedef Real value_type;
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>;
41 pg funcp = boost::math::log_hypergeometric_1F1;
44 boost::math::tools::test_result<value_type> result;
46 std::cout << "Testing " << test_name << " with type " << type_name
47 << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
50 // test hypergeometric_2F0 against data:
52 result = boost::math::tools::test_hetero<Real>(
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;
61 #define SC_(x) BOOST_MATH_BIG_CONSTANT(T, 1000000, x)
65 void test_spots1(T, const char* type_name)
67 #include "hypergeometric_1f1_log_large.ipp"
69 do_test_1F1<T>(hypergeometric_1f1_log_large, type_name, "Large random values - log");
73 void test_spots2(T, const char* type_name)
75 #include "hypergeometric_1f1_log_large_unsolved.ipp"
77 do_test_1F1<T>(hypergeometric_1f1_log_large_unsolved, type_name, "Large random values - log - unsolved");
81 void test_spots(T z, const char* type_name)
83 test_spots1(z, type_name);
85 test_spots2(z, type_name);