]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/test_ibeta_inv_ab.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 <pch_light.hpp>
7 #include "test_ibeta_inv_ab.hpp"
9 #if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT)
13 # define TEST_REAL_CONCEPT
19 // This file tests the incomplete beta function inverses
20 // ibeta_inva and ibetac_inva. There are three sets of tests:
21 // 1) TODO!!!! Accuracy tests use values generated with NTL::RR at
22 // 1000-bit precision and our generic versions of these functions.
23 // 2) Round trip sanity checks, use the test data for the forward
24 // functions, and verify that we can get (approximately) back
27 // Note that when this file is first run on a new platform many of
28 // these tests will fail: the default accuracy is 1 epsilon which
29 // is too tight for most platforms. In this situation you will
30 // need to cast a human eye over the error rates reported and make
31 // a judgement as to whether they are acceptable. Either way please
32 // report the results to the Boost mailing list. Acceptable rates of
33 // error are marked up below as a series of regular expressions that
34 // identify the compiler/stdlib/platform/data-type/test-data/test-function
35 // along with the maximum expected peek and RMS mean errors for that
39 void expected_results()
42 // Define the max and mean errors expected for
43 // various compilers and platforms.
45 const char* largest_type
;
46 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
47 if(boost::math::policies::digits
<double, boost::math::policies::policy
<> >() == boost::math::policies::digits
<long double, boost::math::policies::policy
<> >())
49 largest_type
= "(long\\s+)?double";
53 largest_type
= "long double";
56 largest_type
= "(long\\s+)?double";
65 largest_type
, // test type(s)
66 ".*", // test data group
67 ".*", 3000, 500); // test function
69 // Catch all cases come last:
75 largest_type
, // test type(s)
76 ".*", // test data group
77 ".*", 500, 500); // test function
82 "float|double", // test type(s)
83 ".*", // test data group
84 ".*", 5, 3); // test function
89 "real_concept", // test type(s)
90 ".*", // test data group
91 ".*", 1000000, 500000); // test function
94 // Finish off by printing out the compiler/stdlib/platform names,
95 // we do this to make it easier to mark up expected error rates.
97 std::cout
<< "Tests run with " << BOOST_COMPILER
<< ", "
98 << BOOST_STDLIB
<< ", " << BOOST_PLATFORM
<< std::endl
;
101 BOOST_AUTO_TEST_CASE( test_main
)
105 gsl_set_error_handler_off();
109 test_beta(0.1F
, "float");
112 test_beta(0.1, "double");
114 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
116 test_beta(0.1L, "long double");
118 #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
119 #ifdef TEST_REAL_CONCEPT
120 test_beta(boost::math::concepts::real_concept(0.1), "real_concept");
124 std::cout
<< "<note>The long double tests have been disabled on this platform "
125 "either because the long double overloads of the usual math functions are "
126 "not available at all, or because they are too inaccurate for these tests "
127 "to pass.</note>" << std::endl
;