]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/test_polygamma.cpp
1 // (C) Copyright John Maddock 2014.
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 <pch_light.hpp>
7 #include "test_polygamma.hpp"
8 //#include <boost/cstdfloat.hpp>
10 void expected_results()
13 // Define the max and mean errors expected for
14 // various compilers and platforms.
16 const char* largest_type
;
17 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
18 if(boost::math::policies::digits
<double, boost::math::policies::policy
<> >() == boost::math::policies::digits
<long double, boost::math::policies::policy
<> >())
20 largest_type
= "(long\\s+)?double|real_concept";
24 largest_type
= "long double|real_concept";
27 largest_type
= "(long\\s+)?double|real_concept";
34 largest_type
, // test type(s)
35 ".*large arguments", // test data group
36 ".*", 400, 200); // test function
41 largest_type
, // test type(s)
42 ".*negative.*", // test data group
43 ".*", 800, 500); // test function
44 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
45 if((std::numeric_limits
<long double>::digits
> std::numeric_limits
<double>::digits
)
46 && (std::numeric_limits
<long double>::digits
- std::numeric_limits
<double>::digits
< 20))
52 "double", // test type(s)
53 ".*bug cases.*", // test data group
54 ".*", 100, 30); // test function
61 largest_type
, // test type(s)
62 ".*bug cases.*", // test data group
63 ".*", 100000, 50000); // test function
68 largest_type
, // test type(s)
69 ".*", // test data group
70 ".*", 40, 10); // test function
72 // Finish off by printing out the compiler/stdlib/platform names,
73 // we do this to make it easier to mark up expected error rates.
75 std::cout
<< "Tests run with " << BOOST_COMPILER
<< ", "
76 << BOOST_STDLIB
<< ", " << BOOST_PLATFORM
<< std::endl
;
79 BOOST_AUTO_TEST_CASE( test_main
)
82 BOOST_MATH_CONTROL_FP
;
84 test_polygamma(0.0F
, "float");
85 test_polygamma(0.0, "double");
86 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
87 test_polygamma(0.0L, "long double");
88 #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
89 test_polygamma(boost::math::concepts::real_concept(0.1), "real_concept");
92 #ifdef BOOST_FLOAT128_C
93 //test_polygamma(BOOST_FLOAT128_C(0.0), "float128_t");