File indexing completed on 2025-07-11 08:15:53
0001
0002
0003
0004
0005
0006
0007 #ifndef BOOST_MATH_TOOLS_CONFIG_HPP
0008 #define BOOST_MATH_TOOLS_CONFIG_HPP
0009
0010 #ifdef _MSC_VER
0011 #pragma once
0012 #endif
0013
0014 #include <boost/math/tools/is_standalone.hpp>
0015
0016
0017 #ifdef _MSVC_LANG
0018 # if _MSVC_LANG < 201402L
0019 # pragma message("Boost.Math requires C++14");
0020 # endif
0021 # if _MSC_VER == 1900
0022 # pragma message("MSVC 14.0 has broken C++14 constexpr support. Support for this compiler will be removed in Boost 1.86")
0023 # endif
0024 #else
0025 # if __cplusplus < 201402L
0026 # warning "Boost.Math requires C++14"
0027 # endif
0028 #endif
0029
0030 #ifndef BOOST_MATH_STANDALONE
0031 #include <boost/config.hpp>
0032
0033
0034
0035
0036
0037
0038 #ifndef BOOST_MATH_PREVENT_MACRO_SUBSTITUTION
0039 # define BOOST_MATH_PREVENT_MACRO_SUBSTITUTION BOOST_PREVENT_MACRO_SUBSTITUTION
0040 #endif
0041
0042 #define BOOST_MATH_CXX14_CONSTEXPR BOOST_CXX14_CONSTEXPR
0043 #ifdef BOOST_NO_CXX14_CONSTEXPR
0044 # define BOOST_MATH_NO_CXX14_CONSTEXPR
0045 #endif
0046
0047 #define BOOST_MATH_IF_CONSTEXPR BOOST_IF_CONSTEXPR
0048 #ifdef BOOST_NO_CXX17_IF_CONSTEXPR
0049 # define BOOST_MATH_NO_CXX17_IF_CONSTEXPR
0050 #endif
0051
0052 #ifdef BOOST_NO_CXX17_HDR_EXECUTION
0053 # define BOOST_MATH_NO_CXX17_HDR_EXECUTION
0054 #endif
0055
0056 #ifdef BOOST_HAS_THREADS
0057 # define BOOST_MATH_HAS_THREADS
0058 #endif
0059 #ifdef BOOST_DISABLE_THREADS
0060 # define BOOST_MATH_DISABLE_THREADS
0061 #endif
0062 #ifdef BOOST_NO_CXX11_THREAD_LOCAL
0063 # define BOOST_MATH_NO_CXX11_THREAD_LOCAL
0064 #endif
0065
0066 #ifdef BOOST_NO_EXCEPTIONS
0067 # define BOOST_MATH_NO_EXCEPTIONS
0068 #endif
0069
0070 #ifdef BOOST_NO_TYPEID
0071 # define BOOST_MATH_NO_TYPEID
0072 #endif
0073 #ifdef BOOST_NO_RTTI
0074 # define BOOST_MATH_NO_RTTI
0075 #endif
0076
0077 #define BOOST_MATH_NOINLINE BOOST_NOINLINE
0078 #define BOOST_MATH_FORCEINLINE BOOST_FORCEINLINE
0079
0080 #define BOOST_MATH_JOIN(X, Y) BOOST_JOIN(X, Y)
0081 #define BOOST_MATH_STRINGIZE(X) BOOST_STRINGIZE(X)
0082
0083 #else
0084
0085 #define BOOST_MATH_PREVENT_MACRO_SUBSTITUTION
0086 #define BOOST_MATH_NO_REAL_CONCEPT_TESTS
0087 #define BOOST_MATH_NO_DISTRIBUTION_CONCEPT_TESTS
0088 #define BOOST_MATH_NO_LEXICAL_CAST
0089
0090
0091 #define BOOST_MATH_NO_MP_TESTS
0092
0093 #if (__cplusplus > 201400L || _MSVC_LANG > 201400L)
0094 #define BOOST_MATH_CXX14_CONSTEXPR constexpr
0095 #else
0096 #define BOOST_MATH_CXX14_CONSTEXPR
0097 #define BOOST_MATH_NO_CXX14_CONSTEXPR
0098 #endif
0099
0100 #if (__cplusplus > 201700L || _MSVC_LANG > 201700L)
0101 #define BOOST_MATH_IF_CONSTEXPR if constexpr
0102
0103
0104
0105 # if !__has_include(<execution>) || (defined(__APPLE__) && defined(__clang__))
0106 # define BOOST_MATH_NO_CXX17_HDR_EXECUTION
0107 # endif
0108 #else
0109 # define BOOST_MATH_IF_CONSTEXPR if
0110 # define BOOST_MATH_NO_CXX17_IF_CONSTEXPR
0111 # define BOOST_MATH_NO_CXX17_HDR_EXECUTION
0112 #endif
0113
0114 #if __cpp_lib_gcd_lcm >= 201606L
0115 #define BOOST_MATH_HAS_CXX17_NUMERIC
0116 #endif
0117
0118 #define BOOST_MATH_JOIN(X, Y) BOOST_MATH_DO_JOIN(X, Y)
0119 #define BOOST_MATH_DO_JOIN(X, Y) BOOST_MATH_DO_JOIN2(X,Y)
0120 #define BOOST_MATH_DO_JOIN2(X, Y) X##Y
0121
0122 #define BOOST_MATH_STRINGIZE(X) BOOST_MATH_DO_STRINGIZE(X)
0123 #define BOOST_MATH_DO_STRINGIZE(X) #X
0124
0125 #ifdef BOOST_MATH_DISABLE_THREADS
0126
0127 #elif defined(__has_include)
0128 # if !__has_include(<thread>) || !__has_include(<mutex>) || !__has_include(<future>) || !__has_include(<atomic>)
0129 # define BOOST_MATH_DISABLE_THREADS
0130 # else
0131 # define BOOST_MATH_HAS_THREADS
0132 # endif
0133 #else
0134 # define BOOST_MATH_HAS_THREADS
0135 #endif
0136
0137 #ifdef BOOST_MATH_DISABLE_THREADS
0138 # define BOOST_MATH_NO_CXX11_THREAD_LOCAL
0139 #endif
0140
0141 #ifdef __GNUC__
0142 # if !defined(__EXCEPTIONS) && !defined(BOOST_MATH_NO_EXCEPTIONS)
0143 # define BOOST_MATH_NO_EXCEPTIONS
0144 # endif
0145
0146
0147
0148 # include <algorithm> // for min and max
0149 # include <limits>
0150 # ifndef __GXX_RTTI
0151 # ifndef BOOST_MATH_NO_TYPEID
0152 # define BOOST_MATH_NO_TYPEID
0153 # endif
0154 # ifndef BOOST_MATH_NO_RTTI
0155 # define BOOST_MATH_NO_RTTI
0156 # endif
0157 # endif
0158 #endif
0159
0160 #if !defined(BOOST_MATH_NOINLINE)
0161 # if defined(_MSC_VER)
0162 # define BOOST_MATH_NOINLINE __declspec(noinline)
0163 # elif defined(__GNUC__) && __GNUC__ > 3
0164
0165 # if defined(__CUDACC__)
0166
0167
0168 # define BOOST_MATH_NOINLINE __attribute__ ((noinline))
0169 # elif defined(__HIP__)
0170
0171 # define BOOST_MATH_NOINLINE __attribute__ ((noinline))
0172 # else
0173 # define BOOST_MATH_NOINLINE __attribute__ ((__noinline__))
0174 # endif
0175 # else
0176 # define BOOST_MATH_NOINLINE
0177 # endif
0178 #endif
0179
0180 #if !defined(BOOST_MATH_FORCEINLINE)
0181 # if defined(_MSC_VER)
0182 # define BOOST_MATH_FORCEINLINE __forceinline
0183 # elif defined(__GNUC__) && __GNUC__ > 3
0184
0185 # define BOOST_MATH_FORCEINLINE inline __attribute__ ((__always_inline__))
0186 # else
0187 # define BOOST_MATH_FORCEINLINE inline
0188 # endif
0189 #endif
0190
0191 #endif
0192
0193
0194
0195 #if !defined(BOOST_MATH_NO_CXX17_HDR_EXECUTION) && defined(BOOST_MATH_HAS_THREADS)
0196 # define BOOST_MATH_EXEC_COMPATIBLE
0197 #endif
0198
0199
0200 #if __cplusplus > 202002L || (defined(_MSVC_LANG) &&_MSVC_LANG > 202002L)
0201 # if __GNUC__ >= 13
0202
0203
0204 # if defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128) || defined(_GLIBCXX_HAVE_FLOAT128_MATH)
0205 # include <cstring> // std::strlen is used with from_chars
0206 # include <charconv>
0207 # include <stdfloat>
0208 # define BOOST_MATH_USE_CHARCONV_FOR_CONVERSION
0209 # endif
0210 # endif
0211 #endif
0212
0213 #include <algorithm> // for min and max
0214 #include <limits>
0215 #include <cmath>
0216 #include <climits>
0217 #include <cfloat>
0218
0219 #include <boost/math/tools/user.hpp>
0220
0221 #if (defined(__NetBSD__) || defined(__EMSCRIPTEN__)\
0222 || (defined(__hppa) && !defined(__OpenBSD__)) || (defined(__NO_LONG_DOUBLE_MATH) && (DBL_MANT_DIG != LDBL_MANT_DIG))) \
0223 && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
0224
0225 #endif
0226
0227 #ifdef __IBMCPP__
0228
0229
0230
0231
0232 #ifndef BOOST_MATH_NO_REAL_CONCEPT_TESTS
0233 # define BOOST_MATH_NO_REAL_CONCEPT_TESTS
0234 #endif
0235 #endif
0236 #ifdef sun
0237
0238 # define BOOST_MATH_DISABLE_FLOAT128
0239 #endif
0240 #ifdef __HAIKU__
0241
0242
0243
0244
0245 # define BOOST_MATH_DISABLE_FLOAT128
0246 # define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
0247 #endif
0248 #if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
0249
0250
0251
0252
0253 # define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
0254 #endif
0255 #if !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) && (LDBL_MANT_DIG == 106) && (LDBL_MIN_EXP > DBL_MIN_EXP)
0256
0257
0258
0259
0260 # define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
0261 #endif
0262 #if defined(unix) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1000) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
0263
0264
0265
0266
0267
0268
0269
0270
0271
0272
0273
0274
0275 # define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
0276 #endif
0277 #if defined(unix) && defined(__INTEL_COMPILER)
0278
0279
0280
0281
0282
0283 #define BOOST_MATH_DISABLE_STD_FPCLASSIFY
0284 #endif
0285
0286 #if defined(_MSC_VER) && !defined(_WIN32_WCE)
0287
0288 # define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM)
0289 #endif
0290
0291 #ifdef __IBMCPP__
0292 # define BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS
0293 #endif
0294
0295 #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901))
0296 # define BOOST_MATH_USE_C99
0297 #endif
0298
0299 #if (defined(__hpux) && !defined(__hppa))
0300 # define BOOST_MATH_USE_C99
0301 #endif
0302
0303 #if defined(__GNUC__) && defined(_GLIBCXX_USE_C99)
0304 # define BOOST_MATH_USE_C99
0305 #endif
0306
0307 #if defined(_LIBCPP_VERSION) && !defined(_MSC_VER)
0308 # define BOOST_MATH_USE_C99
0309 #endif
0310
0311 #if defined(__CYGWIN__) || defined(__HP_aCC) || defined(__INTEL_COMPILER) \
0312 || defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \
0313 || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))\
0314 || defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
0315 # define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY
0316 #endif
0317
0318 #if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x590)
0319
0320 namespace boost { namespace math { namespace tools { namespace detail {
0321 template <typename T>
0322 struct type {};
0323
0324 template <typename T, T n>
0325 struct non_type {};
0326 }}}}
0327
0328 # define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t) boost::math::tools::detail::type<t>* = 0
0329 # define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::math::tools::detail::type<t>*
0330 # define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::math::tools::detail::non_type<t, v>* = 0
0331 # define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::math::tools::detail::non_type<t, v>*
0332
0333 # define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \
0334 , BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t)
0335 # define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \
0336 , BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
0337 # define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \
0338 , BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
0339 # define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \
0340 , BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
0341
0342 #else
0343
0344
0345
0346 # define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t)
0347 # define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
0348 # define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
0349 # define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
0350
0351 # define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t)
0352 # define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
0353 # define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
0354 # define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
0355
0356
0357 #endif
0358
0359 #if (defined(__SUNPRO_CC) || defined(__hppa) || defined(__GNUC__)) && !defined(BOOST_MATH_SMALL_CONSTANT)
0360
0361
0362 # define BOOST_MATH_SMALL_CONSTANT(x) 0.0
0363 #else
0364 # define BOOST_MATH_SMALL_CONSTANT(x) x
0365 #endif
0366
0367
0368
0369
0370
0371 #ifdef _MSC_VER
0372 # ifndef BOOST_MATH_POLY_METHOD
0373 # define BOOST_MATH_POLY_METHOD 2
0374 # endif
0375 #if _MSC_VER <= 1900
0376 # ifndef BOOST_MATH_POLY_METHOD
0377 # define BOOST_MATH_RATIONAL_METHOD 1
0378 # endif
0379 #else
0380 # ifndef BOOST_MATH_RATIONAL_METHOD
0381 # define BOOST_MATH_RATIONAL_METHOD 2
0382 # endif
0383 #endif
0384 #if _MSC_VER > 1900
0385 # ifndef BOOST_MATH_INT_TABLE_TYPE
0386 # define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
0387 # endif
0388 # ifndef BOOST_MATH_INT_VALUE_SUFFIX
0389 # define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
0390 # endif
0391 #endif
0392
0393 #elif defined(__INTEL_COMPILER)
0394 # ifndef BOOST_MATH_POLY_METHOD
0395 # define BOOST_MATH_POLY_METHOD 2
0396 # endif
0397 # ifndef BOOST_MATH_RATIONAL_METHOD
0398 # define BOOST_MATH_RATIONAL_METHOD 1
0399 # endif
0400
0401 #elif defined(__GNUC__)
0402 # ifndef BOOST_MATH_POLY_METHOD
0403 # define BOOST_MATH_POLY_METHOD 3
0404 # endif
0405 # ifndef BOOST_MATH_RATIONAL_METHOD
0406 # define BOOST_MATH_RATIONAL_METHOD 3
0407 # endif
0408
0409 #elif defined(__clang__)
0410
0411 #if __clang__ > 6
0412 # ifndef BOOST_MATH_POLY_METHOD
0413 # define BOOST_MATH_POLY_METHOD 3
0414 # endif
0415 # ifndef BOOST_MATH_RATIONAL_METHOD
0416 # define BOOST_MATH_RATIONAL_METHOD 3
0417 # endif
0418 # ifndef BOOST_MATH_INT_TABLE_TYPE
0419 # define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
0420 # endif
0421 # ifndef BOOST_MATH_INT_VALUE_SUFFIX
0422 # define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
0423 # endif
0424 #endif
0425
0426 #endif
0427
0428
0429
0430
0431 #include <type_traits>
0432 #define BOOST_MATH_NOEXCEPT(T) noexcept(std::is_floating_point<T>::value)
0433 #define BOOST_MATH_IS_FLOAT(T) (std::is_floating_point<T>::value)
0434
0435
0436
0437
0438
0439 #ifndef BOOST_MATH_MAX_POLY_ORDER
0440 # define BOOST_MATH_MAX_POLY_ORDER 20
0441 #endif
0442
0443
0444
0445 #ifndef BOOST_MATH_POLY_METHOD
0446 # define BOOST_MATH_POLY_METHOD 2
0447 #endif
0448 #ifndef BOOST_MATH_RATIONAL_METHOD
0449 # define BOOST_MATH_RATIONAL_METHOD 1
0450 #endif
0451
0452
0453
0454 #ifndef BOOST_MATH_INT_TABLE_TYPE
0455 # define BOOST_MATH_INT_TABLE_TYPE(RT, IT) IT
0456 #endif
0457 #ifndef BOOST_MATH_INT_VALUE_SUFFIX
0458 # define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF
0459 #endif
0460
0461
0462
0463 #if defined(BOOST_MATH_STANDALONE) && defined(_GLIBCXX_USE_FLOAT128) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) && !defined(__STRICT_ANSI__) \
0464 && !defined(BOOST_MATH_DISABLE_FLOAT128) && !defined(BOOST_MATH_USE_FLOAT128)
0465 # define BOOST_MATH_USE_FLOAT128
0466 #elif defined(BOOST_HAS_FLOAT128) && !defined(BOOST_MATH_USE_FLOAT128)
0467 # define BOOST_MATH_USE_FLOAT128
0468 #endif
0469 #ifdef BOOST_MATH_USE_FLOAT128
0470
0471
0472
0473
0474 # if defined(__INTEL_COMPILER) && defined(__GNUC__)
0475 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 6))
0476 # define BOOST_MATH_FLOAT128_TYPE __float128
0477 # endif
0478 # elif defined(__GNUC__)
0479 # define BOOST_MATH_FLOAT128_TYPE __float128
0480 # endif
0481
0482 # ifndef BOOST_MATH_FLOAT128_TYPE
0483 # define BOOST_MATH_FLOAT128_TYPE _Quad
0484 # endif
0485 #endif
0486
0487
0488
0489 #if defined(_WIN32_WCE) && !defined(__SGI_STL_PORT)
0490 # define BOOST_MATH_NO_LEXICAL_CAST
0491 #endif
0492
0493
0494
0495
0496 #ifndef BOOST_MATH_CONTROL_FP
0497 # define BOOST_MATH_CONTROL_FP
0498 #endif
0499
0500
0501
0502 #define BOOST_MATH_STD_USING_CORE \
0503 using std::abs;\
0504 using std::acos;\
0505 using std::cos;\
0506 using std::fmod;\
0507 using std::modf;\
0508 using std::tan;\
0509 using std::asin;\
0510 using std::cosh;\
0511 using std::frexp;\
0512 using std::pow;\
0513 using std::tanh;\
0514 using std::atan;\
0515 using std::exp;\
0516 using std::ldexp;\
0517 using std::sin;\
0518 using std::atan2;\
0519 using std::fabs;\
0520 using std::log;\
0521 using std::sinh;\
0522 using std::ceil;\
0523 using std::floor;\
0524 using std::log10;\
0525 using std::sqrt;
0526
0527 #define BOOST_MATH_STD_USING BOOST_MATH_STD_USING_CORE
0528
0529 namespace boost{ namespace math{
0530 namespace tools
0531 {
0532
0533 template <class T>
0534 inline T max BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c) BOOST_MATH_NOEXCEPT(T)
0535 {
0536 return (std::max)((std::max)(a, b), c);
0537 }
0538
0539 template <class T>
0540 inline T max BOOST_MATH_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d) BOOST_MATH_NOEXCEPT(T)
0541 {
0542 return (std::max)((std::max)(a, b), (std::max)(c, d));
0543 }
0544
0545 }
0546
0547 template <class T>
0548 void suppress_unused_variable_warning(const T&) BOOST_MATH_NOEXCEPT(T)
0549 {
0550 }
0551
0552 namespace detail{
0553
0554 template <class T>
0555 struct is_integer_for_rounding
0556 {
0557 static constexpr bool value = std::is_integral<T>::value || (std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::is_integer);
0558 };
0559
0560 }
0561
0562 }}
0563
0564 #ifdef __GLIBC_PREREQ
0565 # if __GLIBC_PREREQ(2,14)
0566 # define BOOST_MATH_HAVE_FIXED_GLIBC
0567 # endif
0568 #endif
0569
0570 #if ((defined(__linux__) && !defined(__UCLIBC__) && !defined(BOOST_MATH_HAVE_FIXED_GLIBC)) || defined(__QNX__) || defined(__IBMCPP__))
0571
0572
0573
0574
0575
0576
0577
0578 #include <cfenv>
0579
0580 # ifdef FE_ALL_EXCEPT
0581
0582 namespace boost{ namespace math{
0583 namespace detail
0584 {
0585 struct fpu_guard
0586 {
0587 fpu_guard()
0588 {
0589 fegetexceptflag(&m_flags, FE_ALL_EXCEPT);
0590 feclearexcept(FE_ALL_EXCEPT);
0591 }
0592 ~fpu_guard()
0593 {
0594 fesetexceptflag(&m_flags, FE_ALL_EXCEPT);
0595 }
0596 private:
0597 fexcept_t m_flags;
0598 };
0599
0600 }
0601 }}
0602
0603 # define BOOST_FPU_EXCEPTION_GUARD boost::math::detail::fpu_guard local_guard_object;
0604 # define BOOST_MATH_INSTRUMENT_FPU do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); BOOST_MATH_INSTRUMENT_VARIABLE(cpu_flags); } while(0);
0605
0606 # else
0607
0608 # define BOOST_FPU_EXCEPTION_GUARD
0609 # define BOOST_MATH_INSTRUMENT_FPU
0610
0611 # endif
0612
0613 #else
0614 # define BOOST_FPU_EXCEPTION_GUARD
0615 # define BOOST_MATH_INSTRUMENT_FPU
0616 #endif
0617
0618 #ifdef BOOST_MATH_INSTRUMENT
0619
0620 # include <iostream>
0621 # include <iomanip>
0622 # include <typeinfo>
0623
0624 # define BOOST_MATH_INSTRUMENT_CODE(x) \
0625 std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl;
0626 # define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(#name << " = " << name)
0627
0628 #else
0629
0630 # define BOOST_MATH_INSTRUMENT_CODE(x)
0631 # define BOOST_MATH_INSTRUMENT_VARIABLE(name)
0632
0633 #endif
0634
0635
0636
0637
0638 #ifndef BOOST_MATH_DISABLE_THREADS
0639 # define BOOST_MATH_THREAD_LOCAL thread_local
0640 #else
0641 # define BOOST_MATH_THREAD_LOCAL
0642 #endif
0643
0644
0645
0646
0647
0648 #if (defined(__MINGW32__) && (__GNUC__ < 9) && !defined(__clang__))
0649 # define BOOST_MATH_NO_THREAD_LOCAL_WITH_NON_TRIVIAL_TYPES
0650 #endif
0651
0652
0653
0654
0655
0656 #if (!defined(BOOST_MATH_NO_CXX14_CONSTEXPR)) || (defined(_MSC_VER) && _MSC_VER >= 1910)
0657 #define BOOST_MATH_HAVE_CONSTEXPR_TABLES
0658 #define BOOST_MATH_CONSTEXPR_TABLE_FUNCTION constexpr
0659 #else
0660 #define BOOST_MATH_CONSTEXPR_TABLE_FUNCTION
0661 #endif
0662
0663
0664 #endif
0665
0666
0667
0668