]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/test_ellint_3.cpp
1 // Copyright Xiaogang Zhang 2006
2 // Copyright John Maddock 2006, 2007
3 // Copyright Paul A. Bristow 2007
5 // Use, modification and distribution are subject to the
6 // Boost Software License, Version 1.0. (See accompanying file
7 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 #include <pch_light.hpp>
10 #include "test_ellint_3.hpp"
16 // This file tests the Elliptic Integrals of the third kind.
17 // There are two sets of tests, spot
18 // tests which compare our results with selected values computed
19 // using the online special function calculator at
20 // functions.wolfram.com, while the bulk of the accuracy tests
21 // use values generated with NTL::RR at 1000-bit precision
22 // and our generic versions of these functions.
24 // Note that when this file is first run on a new platform many of
25 // these tests will fail: the default accuracy is 1 epsilon which
26 // is too tight for most platforms. In this situation you will
27 // need to cast a human eye over the error rates reported and make
28 // a judgement as to whether they are acceptable. Either way please
29 // report the results to the Boost mailing list. Acceptable rates of
30 // error are marked up below as a series of regular expressions that
31 // identify the compiler/stdlib/platform/data-type/test-data/test-function
32 // along with the maximum expected peek and RMS mean errors for that
36 void expected_results()
39 // Define the max and mean errors expected for
40 // various compilers and platforms.
42 const char* largest_type
;
43 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
44 if(boost::math::policies::digits
<double, boost::math::policies::policy
<> >() == boost::math::policies::digits
<long double, boost::math::policies::policy
<> >())
46 largest_type
= "(long\\s+)?double|real_concept";
50 largest_type
= "long double|real_concept";
53 largest_type
= "(long\\s+)?double";
57 // Catch all cases come last:
63 largest_type
, // test type(s)
64 ".*Large.*", // test data group
65 ".*", 50, 20); // test function
70 largest_type
, // test type(s)
71 ".*Mathworld.*", // test data group
72 ".*", 600, 200); // test function
77 largest_type
, // test type(s)
78 ".*", // test data group
79 ".*", 15, 8); // test function
81 // Finish off by printing out the compiler/stdlib/platform names,
82 // we do this to make it easier to mark up expected error rates.
84 std::cout
<< "Tests run with " << BOOST_COMPILER
<< ", "
85 << BOOST_STDLIB
<< ", " << BOOST_PLATFORM
<< std::endl
;
88 BOOST_AUTO_TEST_CASE( test_main
)
91 BOOST_MATH_CONTROL_FP
;
92 test_spots(0.0F
, "float");
93 test_spots(0.0, "double");
94 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
95 test_spots(0.0L, "long double");
96 #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
97 test_spots(boost::math::concepts::real_concept(0), "real_concept");
100 std::cout
<< "<note>The long double tests have been disabled on this platform "
101 "either because the long double overloads of the usual math functions are "
102 "not available at all, or because they are too inaccurate for these tests "
103 "to pass.</note>" << std::endl
;