]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/math/test/test_1F1_regularized.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / libs / math / test / test_1F1_regularized.cpp
CommitLineData
92f5a8d4
TL
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)
1e59de90
TL
5#if !defined(TEST) || (TEST == 7)
6#define TEST_MP
7#endif
92f5a8d4
TL
8#include "test_1F1_regularized.hpp"
9
10#include <boost/multiprecision/cpp_bin_float.hpp>
11
12void expected_results()
13{
14 //
15 // Define the max and mean errors expected for
16 // various compilers and platforms.
17 //
18 const char* largest_type;
19#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
20 if(boost::math::policies::digits<double, boost::math::policies::policy<> >() == boost::math::policies::digits<long double, boost::math::policies::policy<> >())
21 {
22 largest_type = "(long\\s+)?double|real_concept|cpp_bin_float_quad|dec_40|cpp_bin_float_double_extended";
23 }
24 else
25 {
26 largest_type = "long double|real_concept|cpp_bin_float_quad|dec_40|cpp_bin_float_double_extended";
27 }
28#else
29 largest_type = "(long\\s+)?double";
30#endif
31
32 add_expected_result(
33 ".*", // compiler
34 ".*", // stdlib
35 ".*", // platform
36 "cpp_bin_float_quad|cpp_bin_float_double_extended", // test type(s)
37 "Integer a values", // test data group
38 ".*", 25000, 800); // test function
39 add_expected_result(
40 ".*", // compiler
41 ".*", // stdlib
42 ".*", // platform
43 "cpp_bin_float_quad|cpp_bin_float_double_extended", // test type(s)
44 "Large.*", // test data group
45 ".*", 500000, 20000); // test function
46 add_expected_result(
47 ".*", // compiler
48 ".*", // stdlib
49 ".*", // platform
50 "cpp_bin_float_quad|cpp_bin_float_double_extended", // test type(s)
51 "Small.*", // test data group
52 ".*", 2000, 200); // test function
53
54 add_expected_result(
55 ".*", // compiler
56 ".*", // stdlib
57 ".*", // platform
58 "dec_40", // test type(s)
59 "Integer a values", // test data group
60 ".*", 12000, 800); // test function
61 add_expected_result(
62 ".*", // compiler
63 ".*", // stdlib
64 ".*", // platform
65 "dec_40", // test type(s)
66 "Large.*", // test data group
67 ".*", 200000000L, 20000000L); // test function
68 add_expected_result(
69 ".*", // compiler
70 ".*", // stdlib
71 ".*", // platform
72 "dec_40", // test type(s)
73 "Small.*", // test data group
74 ".*", 1000, 300); // test function
75
76#if (LDBL_MANT_DIG < DBL_MANT_DIG * 2) && (LDBL_MANT_DIG != DBL_MANT_DIG)
77 //
78 // long double has only a little extra precision and errors may creep
79 // into the double results:
80 //
81 add_expected_result(
82 ".*", // compiler
83 ".*", // stdlib
84 ".*", // platform
85 "double", // test type(s)
86 "Integer a values", // test data group
87 ".*", 5, 3); // test function
88
89 add_expected_result(
90 ".*", // compiler
91 ".*", // stdlib
92 ".*", // platform
93 "double", // test type(s)
94 "Small.*", // test data group
95 ".*", 5, 3); // test function
96
97 add_expected_result(
98 ".*", // compiler
99 ".*", // stdlib
100 ".*", // platform
101 "double", // test type(s)
102 "Large.*", // test data group
103 ".*", 100, 20); // test function
104 add_expected_result(
105 ".*", // compiler
106 ".*", // stdlib
107 ".*", // platform
108 "double", // test type(s)
109 "Bug.*", // test data group
110 ".*", 300, 50); // test function
111
112#endif
113
114 add_expected_result(
115 ".*", // compiler
116 ".*", // stdlib
117 ".*", // platform
118 largest_type, // test type(s)
119 "Integer a values", // test data group
120 ".*", 16000, 600); // test function
121
122 add_expected_result(
123 ".*", // compiler
124 ".*", // stdlib
125 ".*", // platform
126 largest_type, // test type(s)
127 "Small.*", // test data group
128 ".*", 2000, 200); // test function
129
130 add_expected_result(
131 ".*", // compiler
132 ".*", // stdlib
133 ".*", // platform
134 largest_type, // test type(s)
135 "Large.*", // test data group
136 ".*", 400000, 8000); // test function
137 add_expected_result(
138 ".*", // compiler
139 ".*", // stdlib
140 ".*", // platform
141 "dec_40", // test type(s)
142 "Bug cases.*", // test data group
143 ".*", 2200000, 400000); // test function
144 add_expected_result(
145 ".*", // compiler
146 ".*", // stdlib
147 ".*", // platform
148 largest_type, // test type(s)
149 "Bug cases.*", // test data group
150 ".*", 1500000, 400000); // test function
151
152 //
153 // Finish off by printing out the compiler/stdlib/platform names,
154 // we do this to make it easier to mark up expected error rates.
155 //
156 std::cout << "Tests run with " << BOOST_COMPILER << ", "
157 << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
158}
159
160BOOST_AUTO_TEST_CASE( test_main )
161{
162 expected_results();
163 BOOST_MATH_CONTROL_FP;
164
165#if !defined(TEST) || (TEST == 1)
166 test_hypergeometric_mellin_transform<double>();
167 test_hypergeometric_laplace_transform<double>();
168#endif
169
170#ifndef BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
171#if !defined(TEST) || (TEST == 2)
172 test_spots(0.0F, "float");
173#endif
174#endif
175#if !defined(TEST) || (TEST == 3)
176 test_spots(0.0, "double");
177#endif
178#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
179#if (!defined(TEST) || (TEST == 4)) && (DBL_MAX_EXP != LDBL_MAX_EXP)
180 test_spots(0.0L, "long double");
181#endif
182#ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
183#if !defined(TEST) || (TEST == 5)
184 test_spots(boost::math::concepts::real_concept(0.1), "real_concept");
185#endif
186#endif
187#endif
1e59de90 188#if (!defined(TEST) || (TEST == 6)) && !defined(__clang__)
92f5a8d4
TL
189 test_spots(boost::multiprecision::cpp_bin_float_quad(), "cpp_bin_float_quad");
190#endif
1e59de90 191#if (!defined(TEST) || (TEST == 7)) && !defined(__clang__)
92f5a8d4
TL
192 typedef boost::multiprecision::number<boost::multiprecision::cpp_bin_float<40> > dec_40;
193 test_spots(dec_40(), "dec_40");
194#endif
195}
196