]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/math/test/test_skew_normal.cpp
1 // Copyright Paul A. Bristow 2012.
2 // Copyright John Maddock 2012.
3 // Copyright Benjamin Sobotta 2012
5 // Use, modification and distribution are subject to the
6 // Boost Software License, Version 1.0.
7 // (See accompanying file LICENSE_1_0.txt
8 // or copy at http://www.boost.org/LICENSE_1_0.txt)
11 # pragma warning (disable : 4127) // conditional expression is constant.
12 # pragma warning (disable : 4305) // 'initializing' : truncation from 'double' to 'const float'.
13 # pragma warning (disable : 4310) // cast truncates constant value.
14 # pragma warning (disable : 4512) // assignment operator could not be generated.
17 //#include <pch.hpp> // include directory libs/math/src/tr1/ is needed.
19 #include <boost/math/concepts/real_concept.hpp> // for real_concept
20 #define BOOST_TEST_MAIN
21 #include <boost/test/unit_test.hpp> // Boost.Test
22 #include <boost/test/tools/floating_point_comparison.hpp>
24 #include <boost/math/distributions/skew_normal.hpp>
25 using boost :: math :: skew_normal_distribution
;
26 using boost :: math :: skew_normal
;
27 #include <boost/math/tools/test.hpp>
33 using std :: setprecision
;
35 using std :: numeric_limits
;
36 #include "test_out_of_range.hpp"
38 template < class RealType
>
39 void check_skew_normal ( RealType mean
, RealType scale
, RealType shape
, RealType x
, RealType p
, RealType q
, RealType tol
)
41 using boost :: math :: skew_normal_distribution
;
43 BOOST_CHECK_CLOSE_FRACTION (
44 :: boost :: math :: cdf ( // Check cdf
45 skew_normal_distribution
< RealType
>( mean
, scale
, shape
), // distribution.
46 x
), // random variable.
49 BOOST_CHECK_CLOSE_FRACTION (
50 :: boost :: math :: cdf ( // Check cdf complement
52 skew_normal_distribution
< RealType
>( mean
, scale
, shape
), // distribution.
53 x
)), // random variable.
54 q
, // probability complement.
56 BOOST_CHECK_CLOSE_FRACTION (
57 :: boost :: math :: quantile ( // Check quantile
58 skew_normal_distribution
< RealType
>( mean
, scale
, shape
), // distribution.
60 x
, // random variable.
62 BOOST_CHECK_CLOSE_FRACTION (
63 :: boost :: math :: quantile ( // Check quantile complement
65 skew_normal_distribution
< RealType
>( mean
, scale
, shape
), // distribution.
66 q
)), // probability complement.
67 x
, // random variable.
70 skew_normal_distribution
< RealType
> dist ( mean
, scale
, shape
);
72 if (( p
< 0.999 ) && ( q
< 0.999 ))
73 { // We can only check this if P is not too close to 1,
74 // so that we can guarantee Q is accurate:
75 BOOST_CHECK_CLOSE_FRACTION (
76 cdf ( complement ( dist
, x
)), q
, tol
); // 1 - cdf
77 BOOST_CHECK_CLOSE_FRACTION (
78 quantile ( dist
, p
), x
, tol
); // quantile(cdf) = x
79 BOOST_CHECK_CLOSE_FRACTION (
80 quantile ( complement ( dist
, q
)), x
, tol
); // quantile(complement(1 - cdf)) = x
82 } // template <class RealType>void check_skew_normal()
85 template < class RealType
>
86 void test_spots ( RealType
)
88 // Basic sanity checks
89 RealType tolerance
= 1e-4 f
; // 1e-4 (as %)
91 // Check some bad parameters to the distribution,
92 #ifndef BOOST_NO_EXCEPTIONS
93 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
> nbad1 ( 0 , 0 ), std :: domain_error
); // zero sd
94 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
> nbad1 ( 0 , - 1 ), std :: domain_error
); // negative sd
96 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
>( 0 , 0 ), std :: domain_error
); // zero sd
97 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
>( 0 , - 1 ), std :: domain_error
); // negative sd
99 // Tests on extreme values of random variate x, if has numeric_limit infinity etc.
100 skew_normal_distribution
< RealType
> N01
;
101 if ( std :: numeric_limits
< RealType
>:: has_infinity
)
103 BOOST_CHECK_EQUAL ( pdf ( N01
, + std :: numeric_limits
< RealType
>:: infinity ()), 0 ); // x = + infinity, pdf = 0
104 BOOST_CHECK_EQUAL ( pdf ( N01
, - std :: numeric_limits
< RealType
>:: infinity ()), 0 ); // x = - infinity, pdf = 0
105 BOOST_CHECK_EQUAL ( cdf ( N01
, + std :: numeric_limits
< RealType
>:: infinity ()), 1 ); // x = + infinity, cdf = 1
106 BOOST_CHECK_EQUAL ( cdf ( N01
, - std :: numeric_limits
< RealType
>:: infinity ()), 0 ); // x = - infinity, cdf = 0
107 BOOST_CHECK_EQUAL ( cdf ( complement ( N01
, + std :: numeric_limits
< RealType
>:: infinity ())), 0 ); // x = + infinity, c cdf = 0
108 BOOST_CHECK_EQUAL ( cdf ( complement ( N01
, - std :: numeric_limits
< RealType
>:: infinity ())), 1 ); // x = - infinity, c cdf = 1
109 #ifndef BOOST_NO_EXCEPTIONS
110 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
> nbad1 ( std :: numeric_limits
< RealType
>:: infinity (), static_cast < RealType
>( 1 )), std :: domain_error
); // +infinite mean
111 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
> nbad1 (- std :: numeric_limits
< RealType
>:: infinity (), static_cast < RealType
>( 1 )), std :: domain_error
); // -infinite mean
112 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
> nbad1 ( static_cast < RealType
>( 0 ), std :: numeric_limits
< RealType
>:: infinity ()), std :: domain_error
); // infinite sd
114 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
>( std :: numeric_limits
< RealType
>:: infinity (), static_cast < RealType
>( 1 )), std :: domain_error
); // +infinite mean
115 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
>(- std :: numeric_limits
< RealType
>:: infinity (), static_cast < RealType
>( 1 )), std :: domain_error
); // -infinite mean
116 BOOST_MATH_CHECK_THROW ( boost :: math :: skew_normal_distribution
< RealType
>( static_cast < RealType
>( 0 ), std :: numeric_limits
< RealType
>:: infinity ()), std :: domain_error
); // infinite sd
120 if ( std :: numeric_limits
< RealType
>:: has_quiet_NaN
)
122 // No longer allow x to be NaN, then these tests should throw.
123 BOOST_MATH_CHECK_THROW ( pdf ( N01
, + std :: numeric_limits
< RealType
>:: quiet_NaN ()), std :: domain_error
); // x = NaN
124 BOOST_MATH_CHECK_THROW ( cdf ( N01
, + std :: numeric_limits
< RealType
>:: quiet_NaN ()), std :: domain_error
); // x = NaN
125 BOOST_MATH_CHECK_THROW ( cdf ( complement ( N01
, + std :: numeric_limits
< RealType
>:: quiet_NaN ())), std :: domain_error
); // x = + infinity
126 BOOST_MATH_CHECK_THROW ( quantile ( N01
, + std :: numeric_limits
< RealType
>:: quiet_NaN ()), std :: domain_error
); // p = + infinity
127 BOOST_MATH_CHECK_THROW ( quantile ( complement ( N01
, + std :: numeric_limits
< RealType
>:: quiet_NaN ())), std :: domain_error
); // p = + infinity
130 BOOST_CHECK_EQUAL ( mean ( N01
), 0 );
131 BOOST_CHECK_EQUAL ( mode ( N01
), 0 );
132 BOOST_CHECK_EQUAL ( variance ( N01
), 1 );
133 BOOST_CHECK_EQUAL ( skewness ( N01
), 0 );
134 BOOST_CHECK_EQUAL ( kurtosis_excess ( N01
), 0 );
136 cout
<< "Tolerance for type " << typeid ( RealType
). name () << " is " << tolerance
<< " %" << endl
;
138 // Tests where shape = 0, so same as normal tests.
139 // (These might be removed later).
141 static_cast < RealType
>( 5 ),
142 static_cast < RealType
>( 2 ),
143 static_cast < RealType
>( 0 ),
144 static_cast < RealType
>( 4.8 ),
145 static_cast < RealType
>( 0.46017 ),
146 static_cast < RealType
>( 1 - 0.46017 ),
150 static_cast < RealType
>( 5 ),
151 static_cast < RealType
>( 2 ),
152 static_cast < RealType
>( 0 ),
153 static_cast < RealType
>( 5.2 ),
154 static_cast < RealType
>( 1 - 0.46017 ),
155 static_cast < RealType
>( 0.46017 ),
159 static_cast < RealType
>( 5 ),
160 static_cast < RealType
>( 2 ),
161 static_cast < RealType
>( 0 ),
162 static_cast < RealType
>( 2.2 ),
163 static_cast < RealType
>( 0.08076 ),
164 static_cast < RealType
>( 1 - 0.08076 ),
168 static_cast < RealType
>( 5 ),
169 static_cast < RealType
>( 2 ),
170 static_cast < RealType
>( 0 ),
171 static_cast < RealType
>( 7.8 ),
172 static_cast < RealType
>( 1 - 0.08076 ),
173 static_cast < RealType
>( 0.08076 ),
177 static_cast < RealType
>(- 3 ),
178 static_cast < RealType
>( 5 ),
179 static_cast < RealType
>( 0 ),
180 static_cast < RealType
>(- 4.5 ),
181 static_cast < RealType
>( 0.38209 ),
182 static_cast < RealType
>( 1 - 0.38209 ),
186 static_cast < RealType
>(- 3 ),
187 static_cast < RealType
>( 5 ),
188 static_cast < RealType
>( 0 ),
189 static_cast < RealType
>(- 1.5 ),
190 static_cast < RealType
>( 1 - 0.38209 ),
191 static_cast < RealType
>( 0.38209 ),
195 static_cast < RealType
>(- 3 ),
196 static_cast < RealType
>( 5 ),
197 static_cast < RealType
>( 0 ),
198 static_cast < RealType
>(- 8.5 ),
199 static_cast < RealType
>( 0.13567 ),
200 static_cast < RealType
>( 1 - 0.13567 ),
204 static_cast < RealType
>(- 3 ),
205 static_cast < RealType
>( 5 ),
206 static_cast < RealType
>( 0 ),
207 static_cast < RealType
>( 2.5 ),
208 static_cast < RealType
>( 1 - 0.13567 ),
209 static_cast < RealType
>( 0.13567 ),
212 // Tests where shape != 0, specific to skew_normal distribution.
213 //void check_skew_normal(RealType mean, RealType scale, RealType shape, RealType x, RealType p, RealType q, RealType tol)
214 check_skew_normal ( // 1st R example.
215 static_cast < RealType
>( 1.1 ),
216 static_cast < RealType
>( 2.2 ),
217 static_cast < RealType
>(- 3.3 ),
218 static_cast < RealType
>( 0.4 ), // x
219 static_cast < RealType
>( 0.733918618927874 ), // p == psn
220 static_cast < RealType
>( 1 - 0.733918618927874 ), // q
223 // Not sure about these yet.
224 //check_skew_normal( // 2nd R example.
225 //static_cast<RealType>(1.1),
226 //static_cast<RealType>(0.02),
227 //static_cast<RealType>(0.03),
228 //static_cast<RealType>(1.3), // x
229 //static_cast<RealType>(0.01), // p
230 //static_cast<RealType>(0.09), // q
232 //check_skew_normal( // 3nd R example.
233 //static_cast<RealType>(10.1),
234 //static_cast<RealType>(5.),
235 //static_cast<RealType>(-0.03),
236 //static_cast<RealType>(-1.3), // x
237 //static_cast<RealType>(0.01201290665838824), // p
238 //static_cast<RealType>(1. - 0.01201290665838824), // q 0.987987101
241 // Tests for PDF: we know that the normal peak value is at 1/sqrt(2*pi)
243 tolerance
= boost :: math :: tools :: epsilon
< RealType
>() * 5 ; // 5 eps as a fraction
244 BOOST_CHECK_CLOSE_FRACTION (
245 pdf ( skew_normal_distribution
< RealType
>(), static_cast < RealType
>( 0 )),
246 static_cast < RealType
>( 0.3989422804014326779399460599343818684759L ), // 1/sqrt(2*pi)
248 BOOST_CHECK_CLOSE_FRACTION (
249 pdf ( skew_normal_distribution
< RealType
>( 3 ), static_cast < RealType
>( 3 )),
250 static_cast < RealType
>( 0.3989422804014326779399460599343818684759L ),
252 BOOST_CHECK_CLOSE_FRACTION (
253 pdf ( skew_normal_distribution
< RealType
>( 3 , 5 ), static_cast < RealType
>( 3 )),
254 static_cast < RealType
>( 0.3989422804014326779399460599343818684759L / 5 ),
258 BOOST_CHECK_CLOSE_FRACTION (
259 pdf ( skew_normal_distribution
< RealType
>( 3 , 5 , 1e-6 ), static_cast < RealType
>( 3 )),
260 static_cast < RealType
>( 0.3989422804014326779399460599343818684759L / 5 ),
264 // Checks on mean, variance cumulants etc.
265 // Checks on shape ==0
267 RealType tol5
= boost :: math :: tools :: epsilon
< RealType
>() * 5 ;
268 skew_normal_distribution
< RealType
> dist ( 8 , 3 );
269 RealType x
= static_cast < RealType
>( 0.125 );
271 BOOST_MATH_STD_USING
// ADL of std math lib names
276 , static_cast < RealType
>( 8 ), tol5
);
280 , static_cast < RealType
>( 9 ), tol5
);
283 standard_deviation ( dist
)
284 , static_cast < RealType
>( 3 ), tol5
);
288 , pdf ( dist
, x
) / cdf ( complement ( dist
, x
)), tol5
);
289 // cumulative hazard:
292 , - log ( cdf ( complement ( dist
, x
))), tol5
);
293 // coefficient_of_variation:
295 coefficient_of_variation ( dist
)
296 , standard_deviation ( dist
) / mean ( dist
), tol5
);
298 BOOST_CHECK_CLOSE_FRACTION ( mode ( dist
), static_cast < RealType
>( 8 ), 0.001 f
);
302 , static_cast < RealType
>( 8 ), tol5
);
307 , static_cast < RealType
>( 0 ), tol5
);
311 , static_cast < RealType
>( 3 ), tol5
);
314 kurtosis_excess ( dist
)
315 , static_cast < RealType
>( 0 ), tol5
);
317 skew_normal_distribution
< RealType
> norm01 ( 0 , 1 ); // Test default (0, 1)
320 static_cast < RealType
>( 0 ), 0 ); // Mean == zero
322 skew_normal_distribution
< RealType
> defsd_norm01 ( 0 ); // Test default (0, sd = 1)
325 static_cast < RealType
>( 0 ), 0 ); // Mean == zero
327 skew_normal_distribution
< RealType
> def_norm01
; // Test default (0, sd = 1)
330 static_cast < RealType
>( 0 ), 0 ); // Mean == zero
333 standard_deviation ( def_norm01
),
334 static_cast < RealType
>( 1 ), 0 ); //
338 static_cast < RealType
>( 0 ), 0 ); // Mode == zero
341 // Skew_normal tests with shape != 0.
343 // Note these tolerances are expressed as percentages, hence the extra * 100 on the end:
344 RealType tol10
= boost :: math :: tools :: epsilon
< RealType
>() * 10 * 100 ;
345 RealType tol100
= boost :: math :: tools :: epsilon
< RealType
>() * 100 * 100 ;
347 //skew_normal_distribution<RealType> dist(1.1, 0.02, 0.03);
349 BOOST_MATH_STD_USING
// ADL of std math lib names.
351 // Test values from R = see skew_normal_drv.cpp which included the R code used.
353 dist
= skew_normal_distribution
< RealType
>( static_cast < RealType
>( 1.1l ), static_cast < RealType
>( 2.2l ), static_cast < RealType
>(- 3.3l ));
355 BOOST_CHECK_CLOSE ( // mean:
357 , static_cast < RealType
>(- 0.579908992539856825862549L ), tol10
* 2 );
359 std :: cout
<< std :: setprecision ( 17 ) << "Variance = " << variance ( dist
) << std :: endl
;
360 BOOST_CHECK_CLOSE ( // variance: N[variance[skewnormaldistribution[1.1, 2.2, -3.3]], 50]
362 , static_cast < RealType
>( 2.0179057767837232633904061072049998357047989154484L ), tol10
);
364 BOOST_CHECK_CLOSE ( // skewness:
366 , static_cast < RealType
>(- 0.709854548171537509192897824663L ), tol100
);
367 BOOST_CHECK_CLOSE ( // kurtosis:
369 , static_cast < RealType
>( 3.5538752625241790601377L ), tol100
);
370 BOOST_CHECK_CLOSE ( // kurtosis excess:
371 kurtosis_excess ( dist
)
372 , static_cast < RealType
>( 0.5538752625241790601377L ), tol100
);
375 pdf ( dist
, static_cast < RealType
>( 0.4L )),
376 static_cast < RealType
>( 0.294140110156599539564571L ),
380 cdf ( dist
, static_cast < RealType
>( 0.4L )),
381 static_cast < RealType
>( 0.7339186189278737976326676452L ),
385 quantile ( dist
, static_cast < RealType
>( 0.3L )),
386 static_cast < RealType
>(- 1.180104068086875314419247L ),
392 dist
= skew_normal_distribution
< RealType
>( static_cast < RealType
>( 0 . l
), static_cast < RealType
>( 1 . l
), static_cast < RealType
>( 4 . l
));
394 // cout << "pdf(dist, 0) = " << pdf(dist, 0) << ", pdf(dist, 0.45) = " << pdf(dist, 0.45) << endl;
395 // BOOST_CHECK_CLOSE(mode(dist), boost::math::constants::root_two<RealType>() / 2, tol5);
396 BOOST_CHECK_CLOSE ( mode ( dist
), static_cast < RealType
>( 0.41697299497388863932L ), tol100
);
402 dist
= skew_normal_distribution
< RealType
>( static_cast < RealType
>( 1.1l ), static_cast < RealType
>( 0.02l ), static_cast < RealType
>( 0.03l ));
404 BOOST_CHECK_CLOSE ( // mean:
406 , static_cast < RealType
>( 1.1004785154529557886162L ), tol10
);
407 BOOST_CHECK_CLOSE ( // variance:
409 , static_cast < RealType
>( 0.00039977102296128251645L ), tol10
);
411 BOOST_CHECK_CLOSE ( // skewness:
413 , static_cast < RealType
>( 5.8834811259890359782e-006L ), tol100
);
414 BOOST_CHECK_CLOSE ( // kurtosis:
416 , static_cast < RealType
>( 3 . L
+ 9.2903475812137800239002e-008L ), tol100
);
417 BOOST_CHECK_CLOSE ( // kurtosis excess:
418 kurtosis_excess ( dist
)
419 , static_cast < RealType
>( 9.2903475812137800239002e-008L ), tol100
);
422 dist
= skew_normal_distribution
< RealType
>( static_cast < RealType
>( 10.1l ), static_cast < RealType
>( 5 . l
), static_cast < RealType
>(- 0.03l ));
423 BOOST_CHECK_CLOSE ( // mean:
425 , static_cast < RealType
>( 9.9803711367610528459485937L ), tol10
);
426 BOOST_CHECK_CLOSE ( // variance:
428 , static_cast < RealType
>( 24.98568893508015727823L ), tol10
);
430 BOOST_CHECK_CLOSE ( // skewness:
432 , static_cast < RealType
>(- 5.8834811259890359782085e-006L ), tol100
);
433 BOOST_CHECK_CLOSE ( // kurtosis:
435 , static_cast < RealType
>( 3 . L
+ 9.2903475812137800239002e-008L ), tol100
);
436 BOOST_CHECK_CLOSE ( // kurtosis excess:
437 kurtosis_excess ( dist
)
438 , static_cast < RealType
>( 9.2903475812137800239002e-008L ), tol100
);
441 dist
= skew_normal_distribution
< RealType
>( static_cast < RealType
>(- 10.1l ), static_cast < RealType
>( 5 . l
), static_cast < RealType
>( 30 . l
));
442 BOOST_CHECK_CLOSE ( // mean:
444 , static_cast < RealType
>(- 6.11279169674138408531365L ), 2 * tol10
);
445 BOOST_CHECK_CLOSE ( // variance:
447 , static_cast < RealType
>( 9.10216994642554914628242L ), tol10
* 2 );
449 BOOST_CHECK_CLOSE ( // skewness:
451 , static_cast < RealType
>( 0.99072425443686904424L ), tol100
);
452 BOOST_CHECK_CLOSE ( // kurtosis:
454 , static_cast < RealType
>( 3 . L
+ 0.8638862008406084244563L ), tol100
);
455 BOOST_CHECK_CLOSE ( // kurtosis excess:
456 kurtosis_excess ( dist
)
457 , static_cast < RealType
>( 0.8638862008406084244563L ), tol100
);
460 BOOST_MATH_CHECK_THROW ( cdf ( skew_normal_distribution
< RealType
>( 0 , 0 , 0 ), 0 ), std :: domain_error
);
461 BOOST_MATH_CHECK_THROW ( cdf ( skew_normal_distribution
< RealType
>( 0 , - 1 , 0 ), 0 ), std :: domain_error
);
462 BOOST_MATH_CHECK_THROW ( quantile ( skew_normal_distribution
< RealType
>( 0 , 1 , 0 ), - 1 ), std :: domain_error
);
463 BOOST_MATH_CHECK_THROW ( quantile ( skew_normal_distribution
< RealType
>( 0 , 1 , 0 ), 2 ), std :: domain_error
);
464 check_out_of_range
< skew_normal_distribution
< RealType
> >( 1 , 1 , 1 );
468 } // template <class RealType>void test_spots(RealType)
470 BOOST_AUTO_TEST_CASE ( test_main
)
474 using boost :: math :: skew_normal
;
475 using boost :: math :: skew_normal_distribution
;
477 //int precision = 17; // std::numeric_limits<double::max_digits10;
478 double tolfeweps
= numeric_limits
< double >:: epsilon () * 5 ;
479 //double tol6decdigits = numeric_limits<float>::epsilon() * 2;
480 // Check that can generate skew_normal distribution using the two convenience methods:
481 boost :: math :: skew_normal
w12 ( 1 ., 2 ); // Using typedef.
482 boost :: math :: skew_normal_distribution
<> w01
; // Use default unity values for mean and scale.
483 // Note NOT myn01() as the compiler will interpret as a function!
485 // Checks on constructors.
486 // Default parameters.
487 BOOST_CHECK_EQUAL ( w01
. location (), 0 );
488 BOOST_CHECK_EQUAL ( w01
. scale (), 1 );
489 BOOST_CHECK_EQUAL ( w01
. shape (), 0 );
491 skew_normal_distribution
<> w23 ( 2 ., 3 ); // Using default RealType double.
492 BOOST_CHECK_EQUAL ( w23
. scale (), 3 );
493 BOOST_CHECK_EQUAL ( w23
. shape (), 0 );
495 skew_normal_distribution
<> w123 ( 1 ., 2 ., 3 .); // Using default RealType double.
496 BOOST_CHECK_EQUAL ( w123
. location (), 1 .);
497 BOOST_CHECK_EQUAL ( w123
. scale (), 2 .);
498 BOOST_CHECK_EQUAL ( w123
. shape (), 3 .);
500 BOOST_CHECK_CLOSE_FRACTION ( mean ( w01
), static_cast < double >( 0 ), tolfeweps
); // Default mean == zero
501 BOOST_CHECK_CLOSE_FRACTION ( scale ( w01
), static_cast < double >( 1 ), tolfeweps
); // Default scale == unity
503 // Basic sanity-check spot values for all floating-point types..
504 // (Parameter value, arbitrarily zero, only communicates the floating point type).
505 test_spots ( 0.0 F
); // Test float. OK at decdigits = 0 tolerance = 0.0001 %
506 test_spots ( 0.0 ); // Test double. OK at decdigits 7, tolerance = 1e07 %
507 #ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
508 test_spots ( 0.0L ); // Test long double.
509 #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
510 test_spots ( boost :: math :: concepts :: real_concept ( 0 .)); // Test real concept.
513 std :: cout
<< "<note>The long double tests have been disabled on this platform "
514 "either because the long double overloads of the usual math functions are "
515 "not available at all, or because they are too inaccurate for these tests "
516 "to pass.</note>" << std :: endl
;
520 } // BOOST_AUTO_TEST_CASE( test_main )