]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/test_jacobi_zeta.cpp
1 // Copyright John Maddock 2015
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 #include <pch_light.hpp>
8 #include "test_jacobi_zeta.hpp"
14 // This file tests the Elliptic Integral D[phi|k].
15 // There are two sets of tests, spot
16 // tests which compare our results with selected values computed
17 // using the online special function calculator at
18 // functions.wolfram.com, while the bulk of the accuracy tests
19 // use values generated with NTL::RR at 1000-bit precision
20 // and our generic versions of these functions.
22 // Note that when this file is first run on a new platform many of
23 // these tests will fail: the default accuracy is 1 epsilon which
24 // is too tight for most platforms. In this situation you will
25 // need to cast a human eye over the error rates reported and make
26 // a judgement as to whether they are acceptable. Either way please
27 // report the results to the Boost mailing list. Acceptable rates of
28 // error are marked up below as a series of regular expressions that
29 // identify the compiler/stdlib/platform/data-type/test-data/test-function
30 // along with the maximum expected peek and RMS mean errors for that
34 void expected_results()
37 // Define the max and mean errors expected for
38 // various compilers and platforms.
40 const char* largest_type
;
41 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
42 if(boost::math::policies::digits
<double, boost::math::policies::policy
<> >() == boost::math::policies::digits
<long double, boost::math::policies::policy
<> >())
44 largest_type
= "(long\\s+)?double";
48 largest_type
= "long double";
51 largest_type
= "(long\\s+)?double";
55 // Catch all cases come last:
61 largest_type
, // test type(s)
62 ".*", // test data group
63 ".*", 15, 6); // test function
68 "real_concept", // test type(s)
69 ".*", // test data group
70 ".*", 15, 6); // 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
;
80 BOOST_AUTO_TEST_CASE( test_main
)
83 BOOST_MATH_CONTROL_FP
;
84 #ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
85 test_spots(0.0F
, "float");
87 test_spots(0.0, "double");
88 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
89 test_spots(0.0L, "long double");
90 #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
91 test_spots(boost::math::concepts::real_concept(0), "real_concept");
94 std::cout
<< "<note>The long double tests have been disabled on this platform "
95 "either because the long double overloads of the usual math functions are "
96 "not available at all, or because they are too inaccurate for these tests "
97 "to pass.</note>" << std::endl
;