]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/multiprecision/test/math/high_prec/test_gamma.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / multiprecision / test / math / high_prec / test_gamma.cpp
CommitLineData
1e59de90 1// (C) Copyright John Maddock 2006, 2021.
7c673cae
FG
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)
5
6#include "test_gamma.hpp"
7#ifdef TEST_MPFR
8#include <boost/multiprecision/mpfr.hpp>
1e59de90
TL
9#endif
10#ifdef TEST_MPF
11#include <boost/multiprecision/gmp.hpp>
12#endif
13#ifdef TEST_CPP_BIN_FLOAT
7c673cae
FG
14#include <boost/multiprecision/cpp_bin_float.hpp>
15#endif
1e59de90
TL
16#ifdef TEST_CPP_DEC_FLOAT
17#include <boost/multiprecision/cpp_dec_float.hpp>
18#endif
7c673cae 19
7c673cae
FG
20void expected_results()
21{
22 //
23 // Define the max and mean errors expected for
24 // various compilers and platforms.
25 //
7c673cae 26 add_expected_result(
92f5a8d4
TL
27 ".*", // compiler
28 ".*", // stdlib
29 ".*", // platform
30 ".*", // test type(s)
31 ".*near 1.*", // test data group
32 ".*lgamma.*", 100000000000LL, 100000000000LL); // test function
7c673cae 33 add_expected_result(
92f5a8d4
TL
34 ".*", // compiler
35 ".*", // stdlib
36 ".*", // platform
37 ".*", // test type(s)
38 ".*near 0.*", // test data group
39 ".*lgamma.*", 300000, 100000); // test function
7c673cae 40 add_expected_result(
92f5a8d4
TL
41 ".*", // compiler
42 ".*", // stdlib
43 ".*", // platform
44 ".*", // test type(s)
45 ".*", // test data group
46 ".*", 110000, 50000); // test function
7c673cae
FG
47
48 //
49 // Finish off by printing out the compiler/stdlib/platform names,
50 // we do this to make it easier to mark up expected error rates.
51 //
92f5a8d4
TL
52 std::cout << "Tests run with " << BOOST_COMPILER << ", "
53 << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
7c673cae
FG
54}
55
1e59de90
TL
56#ifndef TEST_PRECISION
57#define TEST_PRECISION 450
58#endif
59
92f5a8d4 60BOOST_AUTO_TEST_CASE(test_main)
7c673cae
FG
61{
62 expected_results();
63 BOOST_MATH_CONTROL_FP;
64
65#ifdef TEST_MPFR
1e59de90
TL
66 typedef boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<TEST_PRECISION> > mp_type;
67 const char* name = "number<mpfr_float_backend<" BOOST_STRINGIZE(TEST_PRECISION) "> >";
68#endif
69#ifdef TEST_MPF
70 typedef boost::multiprecision::number<boost::multiprecision::gmp_float<TEST_PRECISION> > mp_type;
71 const char* name = "number<gmp_float<" BOOST_STRINGIZE(TEST_PRECISION) "> >";
72#endif
73#ifdef TEST_CPP_BIN_FLOAT
74 typedef boost::multiprecision::number<boost::multiprecision::cpp_bin_float<TEST_PRECISION> > mp_type;
75 const char* name = "number<cpp_bin_float<" BOOST_STRINGIZE(TEST_PRECISION) "> >";
76#endif
77#ifdef TEST_CPP_DEC_FLOAT
78 typedef boost::multiprecision::number<boost::multiprecision::cpp_dec_float<TEST_PRECISION> > mp_type;
79 const char* name = "number<cpp_dec_float<" BOOST_STRINGIZE(TEST_PRECISION) "> >";
7c673cae
FG
80#endif
81
82 test_gamma(mp_type(0), name);
83}