]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/multiprecision/test/math/high_prec/test_gamma.cpp
1 // (C) Copyright John Maddock 2006.
2 // Use, modification and distribution are subject to the
3 // Boost Software License, Version 1.0. (See accompanying file
4 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 #include "test_gamma.hpp"
8 #include <boost/multiprecision/mpfr.hpp>
10 #include <boost/multiprecision/cpp_bin_float.hpp>
13 void expected_results()
16 // Define the max and mean errors expected for
17 // various compilers and platforms.
19 const char* largest_type
;
20 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
21 if (boost::math::policies::digits
<double, boost::math::policies::policy
<> >() == boost::math::policies::digits
<long double, boost::math::policies::policy
<> >())
23 largest_type
= "(long\\s+)?double";
27 largest_type
= "long double";
30 largest_type
= "(long\\s+)?double";
37 ".*near 1.*", // test data group
38 ".*lgamma.*", 100000000000LL, 100000000000LL); // test function
44 ".*near 0.*", // test data group
45 ".*lgamma.*", 300000, 100000); // test function
51 ".*", // test data group
52 ".*", 110000, 50000); // test function
55 // Finish off by printing out the compiler/stdlib/platform names,
56 // we do this to make it easier to mark up expected error rates.
58 std::cout
<< "Tests run with " << BOOST_COMPILER
<< ", "
59 << BOOST_STDLIB
<< ", " << BOOST_PLATFORM
<< std::endl
;
62 BOOST_AUTO_TEST_CASE(test_main
)
65 BOOST_MATH_CONTROL_FP
;
68 typedef boost::multiprecision::number
<boost::multiprecision::mpfr_float_backend
<450> > mp_type
;
69 const char* name
= "number<mpfr_float_backend<450> >";
71 typedef boost::multiprecision::number
<boost::multiprecision::cpp_bin_float
<450> > mp_type
;
72 const char* name
= "number<cpp_bin_float<450> >";
75 test_gamma(mp_type(0), name
);