Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:35

0001 ///////////////////////////////////////////////////////////////////////////////
0002 // Copyright Christopher Kormanyos 2014.
0003 // Copyright John Maddock 2014.
0004 // Copyright Paul Bristow 2014.
0005 // Distributed under the Boost Software License,
0006 // Version 1.0. (See accompanying file LICENSE_1_0.txt
0007 // or copy at http://www.boost.org/LICENSE_1_0.txt)
0008 //
0009 
0010 // Implement quadruple-precision <cmath> support.
0011 
0012 #ifndef BOOST_MATH_CSTDFLOAT_CMATH_2014_02_15_HPP_
0013 #define BOOST_MATH_CSTDFLOAT_CMATH_2014_02_15_HPP_
0014 
0015 #include <boost/math/cstdfloat/cstdfloat_types.hpp>
0016 #include <boost/math/cstdfloat/cstdfloat_limits.hpp>
0017 
0018 #if defined(BOOST_CSTDFLOAT_HAS_INTERNAL_FLOAT128_T) && defined(BOOST_MATH_USE_FLOAT128) && !defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_SUPPORT)
0019 
0020 #include <cstdint>
0021 #include <cmath>
0022 #include <stdexcept>
0023 #include <iostream>
0024 #include <type_traits>
0025 #include <memory>
0026 #include <boost/math/tools/assert.hpp>
0027 #include <boost/math/tools/nothrow.hpp>
0028 #include <boost/math/tools/throw_exception.hpp>
0029 
0030 #if defined(_WIN32) && defined(__GNUC__)
0031   // Several versions of Mingw and probably cygwin too have broken
0032   // libquadmath implementations that segfault as soon as you call
0033   // expq or any function that depends on it.
0034 #define BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
0035 #endif
0036 
0037 // Here is a helper function used for raising the value of a given
0038 // floating-point type to the power of n, where n has integral type.
0039 namespace boost {
0040    namespace math {
0041       namespace cstdfloat {
0042          namespace detail {
0043 
0044             template<class float_type, class integer_type>
0045             inline float_type pown(const float_type& x, const integer_type p)
0046             {
0047                const bool isneg = (x < 0);
0048                const bool isnan = (x != x);
0049                const bool isinf = ((!isneg) ? bool(+x > (std::numeric_limits<float_type>::max)())
0050                   : bool(-x > (std::numeric_limits<float_type>::max)()));
0051 
0052                if (isnan) { return x; }
0053 
0054                if (isinf) { return std::numeric_limits<float_type>::quiet_NaN(); }
0055 
0056                const bool       x_is_neg = (x < 0);
0057                const float_type abs_x = (x_is_neg ? -x : x);
0058 
0059                if (p < static_cast<integer_type>(0))
0060                {
0061                   if (abs_x < (std::numeric_limits<float_type>::min)())
0062                   {
0063                      return (x_is_neg ? -std::numeric_limits<float_type>::infinity()
0064                         : +std::numeric_limits<float_type>::infinity());
0065                   }
0066                   else
0067                   {
0068                      return float_type(1) / pown(x, static_cast<integer_type>(-p));
0069                   }
0070                }
0071 
0072                if (p == static_cast<integer_type>(0))
0073                {
0074                   return float_type(1);
0075                }
0076                else
0077                {
0078                   if (p == static_cast<integer_type>(1)) { return x; }
0079 
0080                   if (abs_x > (std::numeric_limits<float_type>::max)())
0081                   {
0082                      return (x_is_neg ? -std::numeric_limits<float_type>::infinity()
0083                         : +std::numeric_limits<float_type>::infinity());
0084                   }
0085 
0086                   if      (p == static_cast<integer_type>(2)) { return  (x * x); }
0087                   else if (p == static_cast<integer_type>(3)) { return ((x * x) * x); }
0088                   else if (p == static_cast<integer_type>(4)) { const float_type x2 = (x * x); return (x2 * x2); }
0089                   else
0090                   {
0091                      // The variable xn stores the binary powers of x.
0092                      float_type result(((p % integer_type(2)) != integer_type(0)) ? x : float_type(1));
0093                      float_type xn(x);
0094 
0095                      integer_type p2 = p;
0096 
0097                      while (integer_type(p2 /= 2) != integer_type(0))
0098                      {
0099                         // Square xn for each binary power.
0100                         xn *= xn;
0101 
0102                         const bool has_binary_power = (integer_type(p2 % integer_type(2)) != integer_type(0));
0103 
0104                         if (has_binary_power)
0105                         {
0106                            // Multiply the result with each binary power contained in the exponent.
0107                            result *= xn;
0108                         }
0109                      }
0110 
0111                      return result;
0112                   }
0113                }
0114             }
0115 
0116          }
0117       }
0118    }
0119 } // boost::math::cstdfloat::detail
0120 
0121 // We will now define preprocessor symbols representing quadruple-precision <cmath> functions.
0122 #if defined(__INTEL_COMPILER)
0123 #define BOOST_CSTDFLOAT_FLOAT128_LDEXP  __ldexpq
0124 #define BOOST_CSTDFLOAT_FLOAT128_FREXP  __frexpq
0125 #define BOOST_CSTDFLOAT_FLOAT128_FABS   __fabsq
0126 #define BOOST_CSTDFLOAT_FLOAT128_FLOOR  __floorq
0127 #define BOOST_CSTDFLOAT_FLOAT128_CEIL   __ceilq
0128 #if !defined(BOOST_CSTDFLOAT_FLOAT128_SQRT)
0129 #define BOOST_CSTDFLOAT_FLOAT128_SQRT   __sqrtq
0130 #endif
0131 #define BOOST_CSTDFLOAT_FLOAT128_TRUNC  __truncq
0132 #define BOOST_CSTDFLOAT_FLOAT128_EXP    __expq
0133 #define BOOST_CSTDFLOAT_FLOAT128_EXPM1  __expm1q
0134 #define BOOST_CSTDFLOAT_FLOAT128_POW    __powq
0135 #define BOOST_CSTDFLOAT_FLOAT128_LOG    __logq
0136 #define BOOST_CSTDFLOAT_FLOAT128_LOG10  __log10q
0137 #define BOOST_CSTDFLOAT_FLOAT128_SIN    __sinq
0138 #define BOOST_CSTDFLOAT_FLOAT128_COS    __cosq
0139 #define BOOST_CSTDFLOAT_FLOAT128_TAN    __tanq
0140 #define BOOST_CSTDFLOAT_FLOAT128_ASIN   __asinq
0141 #define BOOST_CSTDFLOAT_FLOAT128_ACOS   __acosq
0142 #define BOOST_CSTDFLOAT_FLOAT128_ATAN   __atanq
0143 #define BOOST_CSTDFLOAT_FLOAT128_SINH   __sinhq
0144 #define BOOST_CSTDFLOAT_FLOAT128_COSH   __coshq
0145 #define BOOST_CSTDFLOAT_FLOAT128_TANH   __tanhq
0146 #define BOOST_CSTDFLOAT_FLOAT128_ASINH  __asinhq
0147 #define BOOST_CSTDFLOAT_FLOAT128_ACOSH  __acoshq
0148 #define BOOST_CSTDFLOAT_FLOAT128_ATANH  __atanhq
0149 #define BOOST_CSTDFLOAT_FLOAT128_FMOD   __fmodq
0150 #define BOOST_CSTDFLOAT_FLOAT128_ATAN2  __atan2q
0151 #define BOOST_CSTDFLOAT_FLOAT128_LGAMMA __lgammaq
0152 #define BOOST_CSTDFLOAT_FLOAT128_TGAMMA __tgammaq
0153 //   begin more functions
0154 #define BOOST_CSTDFLOAT_FLOAT128_REMAINDER   __remainderq
0155 #define BOOST_CSTDFLOAT_FLOAT128_REMQUO      __remquoq
0156 #define BOOST_CSTDFLOAT_FLOAT128_FMA         __fmaq
0157 #define BOOST_CSTDFLOAT_FLOAT128_FMAX        __fmaxq
0158 #define BOOST_CSTDFLOAT_FLOAT128_FMIN        __fminq
0159 #define BOOST_CSTDFLOAT_FLOAT128_FDIM        __fdimq
0160 #define BOOST_CSTDFLOAT_FLOAT128_NAN         __nanq
0161 //#define BOOST_CSTDFLOAT_FLOAT128_EXP2      __exp2q
0162 #define BOOST_CSTDFLOAT_FLOAT128_LOG2        __log2q
0163 #define BOOST_CSTDFLOAT_FLOAT128_LOG1P       __log1pq
0164 #define BOOST_CSTDFLOAT_FLOAT128_CBRT        __cbrtq
0165 #define BOOST_CSTDFLOAT_FLOAT128_HYPOT       __hypotq
0166 #define BOOST_CSTDFLOAT_FLOAT128_ERF         __erfq
0167 #define BOOST_CSTDFLOAT_FLOAT128_ERFC        __erfcq
0168 #define BOOST_CSTDFLOAT_FLOAT128_LLROUND     __llroundq
0169 #define BOOST_CSTDFLOAT_FLOAT128_LROUND      __lroundq
0170 #define BOOST_CSTDFLOAT_FLOAT128_ROUND       __roundq
0171 #define BOOST_CSTDFLOAT_FLOAT128_NEARBYINT   __nearbyintq
0172 #define BOOST_CSTDFLOAT_FLOAT128_LLRINT      __llrintq
0173 #define BOOST_CSTDFLOAT_FLOAT128_LRINT       __lrintq
0174 #define BOOST_CSTDFLOAT_FLOAT128_RINT        __rintq
0175 #define BOOST_CSTDFLOAT_FLOAT128_MODF        __modfq
0176 #define BOOST_CSTDFLOAT_FLOAT128_SCALBLN     __scalblnq
0177 #define BOOST_CSTDFLOAT_FLOAT128_SCALBN      __scalbnq
0178 #define BOOST_CSTDFLOAT_FLOAT128_ILOGB       __ilogbq
0179 #define BOOST_CSTDFLOAT_FLOAT128_LOGB        __logbq
0180 #define BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER   __nextafterq
0181 //#define BOOST_CSTDFLOAT_FLOAT128_NEXTTOWARD  __nexttowardq
0182 #define BOOST_CSTDFLOAT_FLOAT128_COPYSIGN     __copysignq
0183 #define BOOST_CSTDFLOAT_FLOAT128_SIGNBIT      __signbitq
0184 //#define BOOST_CSTDFLOAT_FLOAT128_FPCLASSIFY __fpclassifyq
0185 //#define BOOST_CSTDFLOAT_FLOAT128_ISFINITE   __isfiniteq
0186 #define BOOST_CSTDFLOAT_FLOAT128_ISINF        __isinfq
0187 #define BOOST_CSTDFLOAT_FLOAT128_ISNAN        __isnanq
0188 //#define BOOST_CSTDFLOAT_FLOAT128_ISNORMAL   __isnormalq
0189 //#define BOOST_CSTDFLOAT_FLOAT128_ISGREATER  __isgreaterq
0190 //#define BOOST_CSTDFLOAT_FLOAT128_ISGREATEREQUAL __isgreaterequalq
0191 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESS         __islessq
0192 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESSEQUAL    __islessequalq
0193 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESSGREATER  __islessgreaterq
0194 //#define BOOST_CSTDFLOAT_FLOAT128_ISUNORDERED    __isunorderedq
0195 //   end more functions
0196 #elif defined(__GNUC__)
0197 #define BOOST_CSTDFLOAT_FLOAT128_LDEXP  ldexpq
0198 #define BOOST_CSTDFLOAT_FLOAT128_FREXP  frexpq
0199 #define BOOST_CSTDFLOAT_FLOAT128_FABS   fabsq
0200 #define BOOST_CSTDFLOAT_FLOAT128_FLOOR  floorq
0201 #define BOOST_CSTDFLOAT_FLOAT128_CEIL   ceilq
0202 #if !defined(BOOST_CSTDFLOAT_FLOAT128_SQRT)
0203 #define BOOST_CSTDFLOAT_FLOAT128_SQRT   sqrtq
0204 #endif
0205 #define BOOST_CSTDFLOAT_FLOAT128_TRUNC  truncq
0206 #define BOOST_CSTDFLOAT_FLOAT128_POW    powq
0207 #define BOOST_CSTDFLOAT_FLOAT128_LOG    logq
0208 #define BOOST_CSTDFLOAT_FLOAT128_LOG10  log10q
0209 #define BOOST_CSTDFLOAT_FLOAT128_SIN    sinq
0210 #define BOOST_CSTDFLOAT_FLOAT128_COS    cosq
0211 #define BOOST_CSTDFLOAT_FLOAT128_TAN    tanq
0212 #define BOOST_CSTDFLOAT_FLOAT128_ASIN   asinq
0213 #define BOOST_CSTDFLOAT_FLOAT128_ACOS   acosq
0214 #define BOOST_CSTDFLOAT_FLOAT128_ATAN   atanq
0215 #define BOOST_CSTDFLOAT_FLOAT128_FMOD   fmodq
0216 #define BOOST_CSTDFLOAT_FLOAT128_ATAN2  atan2q
0217 #define BOOST_CSTDFLOAT_FLOAT128_LGAMMA lgammaq
0218 #if !defined(BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS)
0219 #define BOOST_CSTDFLOAT_FLOAT128_EXP    expq
0220 #define BOOST_CSTDFLOAT_FLOAT128_EXPM1  expm1q
0221 #define BOOST_CSTDFLOAT_FLOAT128_SINH   sinhq
0222 #define BOOST_CSTDFLOAT_FLOAT128_COSH   coshq
0223 #define BOOST_CSTDFLOAT_FLOAT128_TANH   tanhq
0224 #define BOOST_CSTDFLOAT_FLOAT128_ASINH  asinhq
0225 #define BOOST_CSTDFLOAT_FLOAT128_ACOSH  acoshq
0226 #define BOOST_CSTDFLOAT_FLOAT128_ATANH  atanhq
0227 #define BOOST_CSTDFLOAT_FLOAT128_TGAMMA tgammaq
0228 #else // BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
0229 #define BOOST_CSTDFLOAT_FLOAT128_EXP    expq_patch
0230 #define BOOST_CSTDFLOAT_FLOAT128_SINH   sinhq_patch
0231 #define BOOST_CSTDFLOAT_FLOAT128_COSH   coshq_patch
0232 #define BOOST_CSTDFLOAT_FLOAT128_TANH   tanhq_patch
0233 #define BOOST_CSTDFLOAT_FLOAT128_ASINH  asinhq_patch
0234 #define BOOST_CSTDFLOAT_FLOAT128_ACOSH  acoshq_patch
0235 #define BOOST_CSTDFLOAT_FLOAT128_ATANH  atanhq_patch
0236 #define BOOST_CSTDFLOAT_FLOAT128_TGAMMA tgammaq_patch
0237 #endif // BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
0238 //   begin more functions
0239 #define BOOST_CSTDFLOAT_FLOAT128_REMAINDER   remainderq
0240 #define BOOST_CSTDFLOAT_FLOAT128_REMQUO      remquoq
0241 #define BOOST_CSTDFLOAT_FLOAT128_FMA         fmaq
0242 #define BOOST_CSTDFLOAT_FLOAT128_FMAX        fmaxq
0243 #define BOOST_CSTDFLOAT_FLOAT128_FMIN        fminq
0244 #define BOOST_CSTDFLOAT_FLOAT128_FDIM        fdimq
0245 #define BOOST_CSTDFLOAT_FLOAT128_NAN         nanq
0246 //#define BOOST_CSTDFLOAT_FLOAT128_EXP2      exp2q
0247 #define BOOST_CSTDFLOAT_FLOAT128_LOG2        log2q
0248 #define BOOST_CSTDFLOAT_FLOAT128_LOG1P       log1pq
0249 #define BOOST_CSTDFLOAT_FLOAT128_CBRT        cbrtq
0250 #define BOOST_CSTDFLOAT_FLOAT128_HYPOT       hypotq
0251 #define BOOST_CSTDFLOAT_FLOAT128_ERF         erfq
0252 #define BOOST_CSTDFLOAT_FLOAT128_ERFC        erfcq
0253 #define BOOST_CSTDFLOAT_FLOAT128_LLROUND     llroundq
0254 #define BOOST_CSTDFLOAT_FLOAT128_LROUND      lroundq
0255 #define BOOST_CSTDFLOAT_FLOAT128_ROUND       roundq
0256 #define BOOST_CSTDFLOAT_FLOAT128_NEARBYINT   nearbyintq
0257 #define BOOST_CSTDFLOAT_FLOAT128_LLRINT      llrintq
0258 #define BOOST_CSTDFLOAT_FLOAT128_LRINT       lrintq
0259 #define BOOST_CSTDFLOAT_FLOAT128_RINT        rintq
0260 #define BOOST_CSTDFLOAT_FLOAT128_MODF        modfq
0261 #define BOOST_CSTDFLOAT_FLOAT128_SCALBLN     scalblnq
0262 #define BOOST_CSTDFLOAT_FLOAT128_SCALBN      scalbnq
0263 #define BOOST_CSTDFLOAT_FLOAT128_ILOGB       ilogbq
0264 #define BOOST_CSTDFLOAT_FLOAT128_LOGB        logbq
0265 #define BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER   nextafterq
0266 //#define BOOST_CSTDFLOAT_FLOAT128_NEXTTOWARD nexttowardq
0267 #define BOOST_CSTDFLOAT_FLOAT128_COPYSIGN    copysignq
0268 #define BOOST_CSTDFLOAT_FLOAT128_SIGNBIT     signbitq
0269 //#define BOOST_CSTDFLOAT_FLOAT128_FPCLASSIFY fpclassifyq
0270 //#define BOOST_CSTDFLOAT_FLOAT128_ISFINITE   isfiniteq
0271 #define BOOST_CSTDFLOAT_FLOAT128_ISINF        isinfq
0272 #define BOOST_CSTDFLOAT_FLOAT128_ISNAN        isnanq
0273 //#define BOOST_CSTDFLOAT_FLOAT128_ISNORMAL   isnormalq
0274 //#define BOOST_CSTDFLOAT_FLOAT128_ISGREATER  isgreaterq
0275 //#define BOOST_CSTDFLOAT_FLOAT128_ISGREATEREQUAL isgreaterequalq
0276 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESS         islessq
0277 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESSEQUAL    islessequalq
0278 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESSGREATER  islessgreaterq
0279 //#define BOOST_CSTDFLOAT_FLOAT128_ISUNORDERED    isunorderedq
0280 //   end more functions
0281 #endif
0282 
0283 // Implement quadruple-precision <cmath> functions in the namespace
0284 // boost::math::cstdfloat::detail. Subsequently inject these into the
0285 // std namespace via *using* directive.
0286 
0287 // Begin with some forward function declarations. Also implement patches
0288 // for compilers that have broken float128 exponential functions.
0289 
0290 extern "C" int quadmath_snprintf(char*, std::size_t, const char*, ...) BOOST_MATH_NOTHROW;
0291 
0292 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LDEXP(boost::math::cstdfloat::detail::float_internal128_t, int) BOOST_MATH_NOTHROW;
0293 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_FREXP(boost::math::cstdfloat::detail::float_internal128_t, int*) BOOST_MATH_NOTHROW;
0294 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_FABS(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0295 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_FLOOR(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0296 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_CEIL(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0297 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SQRT(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0298 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TRUNC(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0299 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_POW(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0300 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LOG(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0301 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LOG10(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0302 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SIN(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0303 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_COS(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0304 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TAN(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0305 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ASIN(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0306 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ACOS(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0307 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ATAN(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0308 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_FMOD(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0309 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ATAN2(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0310 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LGAMMA(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0311 
0312 //   begin more functions
0313 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_REMAINDER(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0314 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_REMQUO(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t, int*) BOOST_MATH_NOTHROW;
0315 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_FMA(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0316 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_FMAX(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0317 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_FMIN(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0318 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_FDIM(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0319 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_NAN(const char*) BOOST_MATH_NOTHROW;
0320 //extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_EXP2         (boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0321 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_LOG2(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0322 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_LOG1P(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0323 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_CBRT(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0324 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_HYPOT(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0325 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_ERF(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0326 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_ERFC(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0327 extern "C" long long int                                BOOST_CSTDFLOAT_FLOAT128_LLROUND(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0328 extern "C" long int                                   BOOST_CSTDFLOAT_FLOAT128_LROUND(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0329 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_ROUND(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0330 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_NEARBYINT(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0331 extern "C" long long int                                BOOST_CSTDFLOAT_FLOAT128_LLRINT(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0332 extern "C" long int                                   BOOST_CSTDFLOAT_FLOAT128_LRINT(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0333 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_RINT(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0334 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_MODF(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t*) BOOST_MATH_NOTHROW;
0335 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_SCALBLN(boost::math::cstdfloat::detail::float_internal128_t, long int) BOOST_MATH_NOTHROW;
0336 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_SCALBN(boost::math::cstdfloat::detail::float_internal128_t, int) BOOST_MATH_NOTHROW;
0337 extern "C" int                                      BOOST_CSTDFLOAT_FLOAT128_ILOGB(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0338 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_LOGB(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0339 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0340 //extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_NEXTTOWARD   (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0341 extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_COPYSIGN(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0342 extern "C" int                                                  BOOST_CSTDFLOAT_FLOAT128_SIGNBIT(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0343 //extern "C" int                                                BOOST_CSTDFLOAT_FLOAT128_FPCLASSIFY   (boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0344 //extern "C" int                                                BOOST_CSTDFLOAT_FLOAT128_ISFINITE      (boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0345 extern "C" int                                                  BOOST_CSTDFLOAT_FLOAT128_ISINF(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0346 extern "C" int                                                  BOOST_CSTDFLOAT_FLOAT128_ISNAN(boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0347 //extern "C" boost::math::cstdfloat::detail::float_internal128_t  BOOST_CSTDFLOAT_FLOAT128_ISNORMAL   (boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0348 //extern "C" int                                                BOOST_CSTDFLOAT_FLOAT128_ISGREATER   (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0349 //extern "C" int                                                BOOST_CSTDFLOAT_FLOAT128_ISGREATEREQUAL(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0350 //extern "C" int                                                BOOST_CSTDFLOAT_FLOAT128_ISLESS      (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0351 //extern "C" int                                                BOOST_CSTDFLOAT_FLOAT128_ISLESSEQUAL   (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0352 //extern "C" int                                                BOOST_CSTDFLOAT_FLOAT128_ISLESSGREATER(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0353 //extern "C" int                                                BOOST_CSTDFLOAT_FLOAT128_ISUNORDERED   (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) BOOST_MATH_NOTHROW;
0354  //   end more functions
0355 
0356 #if !defined(BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS)
0357 
0358 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXP(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0359 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXPM1(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0360 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SINH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0361 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_COSH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0362 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TANH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0363 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ASINH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0364 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ACOSH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0365 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ATANH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0366 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TGAMMA(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW;
0367  
0368 #else // BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
0369 
0370 // Forward declaration of the patched exponent function, exp(x).
0371 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXP(boost::math::cstdfloat::detail::float_internal128_t x);
0372 
0373 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXPM1(boost::math::cstdfloat::detail::float_internal128_t x)
0374 {
0375    // Compute exp(x) - 1 for x small.
0376 
0377    // Use an order-12 Pade approximation of the exponential function.
0378    // PadeApproximant[Exp[x] - 1, {x, 0, 12, 12}].
0379 
0380    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0381 
0382    float_type sum;
0383 
0384    if (x > BOOST_FLOAT128_C(0.693147180559945309417232121458176568075500134360255))
0385    {
0386       sum = ::BOOST_CSTDFLOAT_FLOAT128_EXP(x) - float_type(1);
0387    }
0388    else
0389    {
0390       const float_type x2 = (x * x);
0391 
0392       const float_type top = (((((  float_type(BOOST_FLOAT128_C(2.4087176110456818621091195109360728010934088788572E-13))  * x2
0393                                   + float_type(BOOST_FLOAT128_C(9.2735628025258751691201101171038802842096241836000E-10))) * x2
0394                                   + float_type(BOOST_FLOAT128_C(9.0806726962333369656024118266681195742980640005812E-07))) * x2
0395                                   + float_type(BOOST_FLOAT128_C(3.1055900621118012422360248447204968944099378881988E-04))) * x2
0396                                   + float_type(BOOST_FLOAT128_C(3.6231884057971014492753623188405797101449275362319E-02))) * x2
0397                                   + float_type(BOOST_FLOAT128_C(1.00000000000000000000000000000000000000000000000000000)))
0398                                   ;
0399 
0400       const float_type bot = ((((((((((((  float_type(BOOST_FLOAT128_C(+7.7202487533515444298369215094104897470942592271063E-16))  * x
0401                                          + float_type(BOOST_FLOAT128_C(-1.2043588055228409310545597554680364005467044394286E-13))) * x
0402                                          + float_type(BOOST_FLOAT128_C(+9.2735628025258751691201101171038802842096241836000E-12))) * x
0403                                          + float_type(BOOST_FLOAT128_C(-4.6367814012629375845600550585519401421048120918000E-10))) * x
0404                                          + float_type(BOOST_FLOAT128_C(+1.6692413044546575304416198210786984511577323530480E-08))) * x
0405                                          + float_type(BOOST_FLOAT128_C(-4.5403363481166684828012059133340597871490320002906E-07))) * x
0406                                          + float_type(BOOST_FLOAT128_C(+9.5347063310450038138825324180015255530129672006102E-06))) * x
0407                                          + float_type(BOOST_FLOAT128_C(-1.5527950310559006211180124223602484472049689440994E-04))) * x
0408                                          + float_type(BOOST_FLOAT128_C(+1.9409937888198757763975155279503105590062111801242E-03))) * x
0409                                          + float_type(BOOST_FLOAT128_C(-1.8115942028985507246376811594202898550724637681159E-02))) * x
0410                                          + float_type(BOOST_FLOAT128_C(+1.1956521739130434782608695652173913043478260869565E-01))) * x
0411                                          + float_type(BOOST_FLOAT128_C(-0.50000000000000000000000000000000000000000000000000000))) * x
0412                                          + float_type(BOOST_FLOAT128_C(+1.00000000000000000000000000000000000000000000000000000)))
0413                                          ;
0414 
0415       sum = (x * top) / bot;
0416    }
0417 
0418    return sum;
0419 }
0420 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXP(boost::math::cstdfloat::detail::float_internal128_t x)
0421 {
0422    // Patch the expq() function for a subset of broken GCC compilers
0423    // like GCC 4.7, 4.8 on MinGW.
0424 
0425    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0426 
0427    // Scale the argument x to the range (-ln2 < x < ln2).
0428    constexpr float_type one_over_ln2 = float_type(BOOST_FLOAT128_C(1.44269504088896340735992468100189213742664595415299));
0429    const float_type x_over_ln2 = x * one_over_ln2;
0430 
0431    int n;
0432 
0433    if (x != x)
0434    {
0435       // The argument is NaN.
0436       return std::numeric_limits<float_type>::quiet_NaN();
0437    }
0438    else if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x) > BOOST_FLOAT128_C(+0.693147180559945309417232121458176568075500134360255))
0439    {
0440       // The absolute value of the argument exceeds ln2.
0441       n = static_cast<int>(::BOOST_CSTDFLOAT_FLOAT128_FLOOR(x_over_ln2));
0442    }
0443    else if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x) < BOOST_FLOAT128_C(+0.693147180559945309417232121458176568075500134360255))
0444    {
0445       // The absolute value of the argument is less than ln2.
0446       n = 0;
0447    }
0448    else
0449    {
0450       // The absolute value of the argument is exactly equal to ln2 (in the sense of floating-point equality).
0451       return float_type(2);
0452    }
0453 
0454    // Check if the argument is very near an integer.
0455    const float_type floor_of_x = ::BOOST_CSTDFLOAT_FLOAT128_FLOOR(x);
0456 
0457    if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x - floor_of_x) < float_type(BOOST_CSTDFLOAT_FLOAT128_EPS))
0458    {
0459       // Return e^n for arguments very near an integer.
0460       return boost::math::cstdfloat::detail::pown(BOOST_FLOAT128_C(2.71828182845904523536028747135266249775724709369996), static_cast<std::int_fast32_t>(floor_of_x));
0461    }
0462 
0463    // Compute the scaled argument alpha.
0464    const float_type alpha = x - (n * BOOST_FLOAT128_C(0.693147180559945309417232121458176568075500134360255));
0465 
0466    // Compute the polynomial approximation of expm1(alpha) and add to it
0467    // in order to obtain the scaled result.
0468    const float_type scaled_result = ::BOOST_CSTDFLOAT_FLOAT128_EXPM1(alpha) + float_type(1);
0469 
0470    // Rescale the result and return it.
0471    return scaled_result * boost::math::cstdfloat::detail::pown(float_type(2), n);
0472 }
0473 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SINH(boost::math::cstdfloat::detail::float_internal128_t x)
0474 {
0475    // Patch the sinhq() function for a subset of broken GCC compilers
0476    // like GCC 4.7, 4.8 on MinGW.
0477    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0478 
0479    // Here, we use the following:
0480    // Set: ex  = exp(x)
0481    // Set: em1 = expm1(x)
0482    // Then
0483    // sinh(x) = (ex - 1/ex) / 2         ; for |x| >= 1
0484    // sinh(x) = (2em1 + em1^2) / (2ex)  ; for |x| < 1
0485 
0486    const float_type ex = ::BOOST_CSTDFLOAT_FLOAT128_EXP(x);
0487 
0488    if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x) < float_type(+1))
0489    {
0490       const float_type em1 = ::BOOST_CSTDFLOAT_FLOAT128_EXPM1(x);
0491 
0492       return ((em1 * 2) + (em1 * em1)) / (ex * 2);
0493    }
0494    else
0495    {
0496       return (ex - (float_type(1) / ex)) / 2;
0497    }
0498 }
0499 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_COSH(boost::math::cstdfloat::detail::float_internal128_t x)
0500 {
0501    // Patch the coshq() function for a subset of broken GCC compilers
0502    // like GCC 4.7, 4.8 on MinGW.
0503    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0504    const float_type ex = ::BOOST_CSTDFLOAT_FLOAT128_EXP(x);
0505    return (ex + (float_type(1) / ex)) / 2;
0506 }
0507 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TANH(boost::math::cstdfloat::detail::float_internal128_t x)
0508 {
0509    // Patch the tanhq() function for a subset of broken GCC compilers
0510    // like GCC 4.7, 4.8 on MinGW.
0511    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0512    const float_type ex_plus = ::BOOST_CSTDFLOAT_FLOAT128_EXP(x);
0513    const float_type ex_minus = (float_type(1) / ex_plus);
0514    return (ex_plus - ex_minus) / (ex_plus + ex_minus);
0515 }
0516 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ASINH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW
0517 {
0518    // Patch the asinh() function since quadmath does not have it.
0519    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0520    return ::BOOST_CSTDFLOAT_FLOAT128_LOG(x + ::BOOST_CSTDFLOAT_FLOAT128_SQRT((x * x) + float_type(1)));
0521 }
0522 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ACOSH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW
0523 {
0524    // Patch the acosh() function since quadmath does not have it.
0525    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0526    const float_type zp(x + float_type(1));
0527    const float_type zm(x - float_type(1));
0528 
0529    return ::BOOST_CSTDFLOAT_FLOAT128_LOG(x + (zp * ::BOOST_CSTDFLOAT_FLOAT128_SQRT(zm / zp)));
0530 }
0531 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ATANH(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW
0532 {
0533    // Patch the atanh() function since quadmath does not have it.
0534    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0535    return (::BOOST_CSTDFLOAT_FLOAT128_LOG(float_type(1) + x)
0536       - ::BOOST_CSTDFLOAT_FLOAT128_LOG(float_type(1) - x)) / 2;
0537 }
0538 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TGAMMA(boost::math::cstdfloat::detail::float_internal128_t x) BOOST_MATH_NOTHROW
0539 {
0540    // Patch the tgammaq() function for a subset of broken GCC compilers
0541    // like GCC 4.7, 4.8 on MinGW.
0542    typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
0543 
0544    if (x > float_type(0))
0545    {
0546       return ::BOOST_CSTDFLOAT_FLOAT128_EXP(::BOOST_CSTDFLOAT_FLOAT128_LGAMMA(x));
0547    }
0548    else if (x < float_type(0))
0549    {
0550       // For x < 0, compute tgamma(-x) and use the reflection formula.
0551       const float_type positive_x = -x;
0552       float_type gamma_value = ::BOOST_CSTDFLOAT_FLOAT128_TGAMMA(positive_x);
0553       const float_type floor_of_positive_x = ::BOOST_CSTDFLOAT_FLOAT128_FLOOR(positive_x);
0554 
0555       // Take the reflection checks (slightly adapted) from <boost/math/gamma.hpp>.
0556       const bool floor_of_z_is_equal_to_z = (positive_x == ::BOOST_CSTDFLOAT_FLOAT128_FLOOR(positive_x));
0557 
0558       constexpr float_type my_pi = BOOST_FLOAT128_C(3.14159265358979323846264338327950288419716939937511);
0559 
0560       if (floor_of_z_is_equal_to_z)
0561       {
0562          const bool is_odd = ((std::int32_t(floor_of_positive_x) % std::int32_t(2)) != std::int32_t(0));
0563 
0564          return (is_odd ? -std::numeric_limits<float_type>::infinity()
0565             : +std::numeric_limits<float_type>::infinity());
0566       }
0567 
0568       const float_type sinpx_value = x * ::BOOST_CSTDFLOAT_FLOAT128_SIN(my_pi * x);
0569 
0570       gamma_value *= sinpx_value;
0571 
0572       const bool result_is_too_large_to_represent = ((::BOOST_CSTDFLOAT_FLOAT128_FABS(gamma_value) < float_type(1))
0573          && (((std::numeric_limits<float_type>::max)() * ::BOOST_CSTDFLOAT_FLOAT128_FABS(gamma_value)) < my_pi));
0574 
0575       if (result_is_too_large_to_represent)
0576       {
0577          const bool is_odd = ((std::int32_t(floor_of_positive_x) % std::int32_t(2)) != std::int32_t(0));
0578 
0579          return (is_odd ? -std::numeric_limits<float_type>::infinity()
0580             : +std::numeric_limits<float_type>::infinity());
0581       }
0582 
0583       gamma_value = -my_pi / gamma_value;
0584 
0585       if ((gamma_value > float_type(0)) || (gamma_value < float_type(0)))
0586       {
0587          return gamma_value;
0588       }
0589       else
0590       {
0591          // The value of gamma is too small to represent. Return 0.0 here.
0592          return float_type(0);
0593       }
0594    }
0595    else
0596    {
0597       // Gamma of zero is complex infinity. Return NaN here.
0598       return std::numeric_limits<float_type>::quiet_NaN();
0599    }
0600 }
0601 #endif // BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
0602 
0603 // Define the quadruple-precision <cmath> functions in the namespace boost::math::cstdfloat::detail.
0604 
0605 namespace boost {
0606    namespace math {
0607       namespace cstdfloat {
0608          namespace detail {
0609             inline   boost::math::cstdfloat::detail::float_internal128_t ldexp(boost::math::cstdfloat::detail::float_internal128_t x, int n) { return ::BOOST_CSTDFLOAT_FLOAT128_LDEXP(x, n); }
0610             inline   boost::math::cstdfloat::detail::float_internal128_t frexp(boost::math::cstdfloat::detail::float_internal128_t x, int* pn) { return ::BOOST_CSTDFLOAT_FLOAT128_FREXP(x, pn); }
0611             inline   boost::math::cstdfloat::detail::float_internal128_t fabs(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_FABS(x); }
0612             inline   boost::math::cstdfloat::detail::float_internal128_t abs(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_FABS(x); }
0613             inline   boost::math::cstdfloat::detail::float_internal128_t floor(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_FLOOR(x); }
0614             inline   boost::math::cstdfloat::detail::float_internal128_t ceil(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_CEIL(x); }
0615             inline   boost::math::cstdfloat::detail::float_internal128_t sqrt(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_SQRT(x); }
0616             inline   boost::math::cstdfloat::detail::float_internal128_t trunc(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_TRUNC(x); }
0617             inline   boost::math::cstdfloat::detail::float_internal128_t exp(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_EXP(x); }
0618             inline   boost::math::cstdfloat::detail::float_internal128_t expm1(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_EXPM1(x); }
0619             inline   boost::math::cstdfloat::detail::float_internal128_t pow(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t a) { return ::BOOST_CSTDFLOAT_FLOAT128_POW(x, a); }
0620             inline   boost::math::cstdfloat::detail::float_internal128_t pow(boost::math::cstdfloat::detail::float_internal128_t x, int a) { return ::BOOST_CSTDFLOAT_FLOAT128_POW(x, boost::math::cstdfloat::detail::float_internal128_t(a)); }
0621             inline   boost::math::cstdfloat::detail::float_internal128_t log(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOG(x); }
0622             inline   boost::math::cstdfloat::detail::float_internal128_t log10(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOG10(x); }
0623             inline   boost::math::cstdfloat::detail::float_internal128_t sin(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_SIN(x); }
0624             inline   boost::math::cstdfloat::detail::float_internal128_t cos(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_COS(x); }
0625             inline   boost::math::cstdfloat::detail::float_internal128_t tan(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_TAN(x); }
0626             inline   boost::math::cstdfloat::detail::float_internal128_t asin(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ASIN(x); }
0627             inline   boost::math::cstdfloat::detail::float_internal128_t acos(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ACOS(x); }
0628             inline   boost::math::cstdfloat::detail::float_internal128_t atan(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ATAN(x); }
0629             inline   boost::math::cstdfloat::detail::float_internal128_t sinh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_SINH(x); }
0630             inline   boost::math::cstdfloat::detail::float_internal128_t cosh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_COSH(x); }
0631             inline   boost::math::cstdfloat::detail::float_internal128_t tanh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_TANH(x); }
0632             inline   boost::math::cstdfloat::detail::float_internal128_t asinh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ASINH(x); }
0633             inline   boost::math::cstdfloat::detail::float_internal128_t acosh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ACOSH(x); }
0634             inline   boost::math::cstdfloat::detail::float_internal128_t atanh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ATANH(x); }
0635             inline   boost::math::cstdfloat::detail::float_internal128_t fmod(boost::math::cstdfloat::detail::float_internal128_t a, boost::math::cstdfloat::detail::float_internal128_t b) { return ::BOOST_CSTDFLOAT_FLOAT128_FMOD(a, b); }
0636             inline   boost::math::cstdfloat::detail::float_internal128_t atan2(boost::math::cstdfloat::detail::float_internal128_t y, boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ATAN2(y, x); }
0637             inline   boost::math::cstdfloat::detail::float_internal128_t lgamma(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LGAMMA(x); }
0638             inline   boost::math::cstdfloat::detail::float_internal128_t tgamma(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_TGAMMA(x); }
0639             //   begin more functions
0640             inline boost::math::cstdfloat::detail::float_internal128_t  remainder(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_REMAINDER(x, y); }
0641             inline boost::math::cstdfloat::detail::float_internal128_t  remquo(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y, int* z) { return ::BOOST_CSTDFLOAT_FLOAT128_REMQUO(x, y, z); }
0642             inline boost::math::cstdfloat::detail::float_internal128_t  fma(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y, boost::math::cstdfloat::detail::float_internal128_t z) { return BOOST_CSTDFLOAT_FLOAT128_FMA(x, y, z); }
0643 
0644             inline boost::math::cstdfloat::detail::float_internal128_t  fmax(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMAX(x, y); }
0645             template <class T>
0646             inline typename std::enable_if<
0647                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0648                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0649                fmax(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMAX(x, y); }
0650             template <class T>
0651             inline typename std::enable_if<
0652                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0653                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0654                fmax(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMAX(x, y); }
0655             inline boost::math::cstdfloat::detail::float_internal128_t  fmin(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMIN(x, y); }
0656             template <class T>
0657             inline typename std::enable_if<
0658                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0659                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0660                fmin(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMIN(x, y); }
0661             template <class T>
0662             inline typename std::enable_if<
0663                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0664                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0665                fmin(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMIN(x, y); }
0666 
0667             inline boost::math::cstdfloat::detail::float_internal128_t  fdim(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_FDIM(x, y); }
0668             inline boost::math::cstdfloat::detail::float_internal128_t  nanq(const char* x) { return ::BOOST_CSTDFLOAT_FLOAT128_NAN(x); }
0669             inline boost::math::cstdfloat::detail::float_internal128_t  exp2(boost::math::cstdfloat::detail::float_internal128_t x)
0670             {
0671                return ::BOOST_CSTDFLOAT_FLOAT128_POW(boost::math::cstdfloat::detail::float_internal128_t(2), x);
0672             }
0673             inline boost::math::cstdfloat::detail::float_internal128_t  log2(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOG2(x); }
0674             inline boost::math::cstdfloat::detail::float_internal128_t  log1p(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOG1P(x); }
0675             inline boost::math::cstdfloat::detail::float_internal128_t  cbrt(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_CBRT(x); }
0676             inline boost::math::cstdfloat::detail::float_internal128_t  hypot(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y, boost::math::cstdfloat::detail::float_internal128_t z) { return ::BOOST_CSTDFLOAT_FLOAT128_SQRT(x*x + y * y + z * z); }
0677             inline boost::math::cstdfloat::detail::float_internal128_t  hypot(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_HYPOT(x, y); }
0678             template <class T>
0679             inline typename std::enable_if<
0680                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0681                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0682                hypot(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return ::BOOST_CSTDFLOAT_FLOAT128_HYPOT(x, y); }
0683             template <class T>
0684             inline typename std::enable_if<
0685                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0686                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0687                hypot(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_HYPOT(x, y); }
0688 
0689 
0690             inline boost::math::cstdfloat::detail::float_internal128_t  erf(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ERF(x); }
0691             inline boost::math::cstdfloat::detail::float_internal128_t  erfc(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ERFC(x); }
0692             inline long long int                                        llround(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LLROUND(x); }
0693             inline long int                                             lround(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LROUND(x); }
0694             inline boost::math::cstdfloat::detail::float_internal128_t  round(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ROUND(x); }
0695             inline boost::math::cstdfloat::detail::float_internal128_t  nearbyint(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_NEARBYINT(x); }
0696             inline long long int                                        llrint(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LLRINT(x); }
0697             inline long int                                             lrint(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LRINT(x); }
0698             inline boost::math::cstdfloat::detail::float_internal128_t  rint(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_RINT(x); }
0699             inline boost::math::cstdfloat::detail::float_internal128_t  modf(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t* y) { return ::BOOST_CSTDFLOAT_FLOAT128_MODF(x, y); }
0700             inline boost::math::cstdfloat::detail::float_internal128_t  scalbln(boost::math::cstdfloat::detail::float_internal128_t x, long int y) { return ::BOOST_CSTDFLOAT_FLOAT128_SCALBLN(x, y); }
0701             inline boost::math::cstdfloat::detail::float_internal128_t  scalbn(boost::math::cstdfloat::detail::float_internal128_t x, int y) { return ::BOOST_CSTDFLOAT_FLOAT128_SCALBN(x, y); }
0702             inline int                                                  ilogb(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ILOGB(x); }
0703             inline boost::math::cstdfloat::detail::float_internal128_t  logb(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOGB(x); }
0704             inline boost::math::cstdfloat::detail::float_internal128_t  nextafter(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER(x, y); }
0705             inline boost::math::cstdfloat::detail::float_internal128_t  nexttoward(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return -(::BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER(-x, -y)); }
0706             inline boost::math::cstdfloat::detail::float_internal128_t  copysign   BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_COPYSIGN(x, y); }
0707             inline bool                                                 signbit   BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_SIGNBIT(x); }
0708             inline int                                                  fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)
0709             {
0710                if (::BOOST_CSTDFLOAT_FLOAT128_ISNAN(x))
0711                   return FP_NAN;
0712                else if (::BOOST_CSTDFLOAT_FLOAT128_ISINF(x))
0713                   return FP_INFINITE;
0714                else if (x == BOOST_FLOAT128_C(0.0))
0715                   return FP_ZERO;
0716 
0717                if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x) < BOOST_CSTDFLOAT_FLOAT128_MIN)
0718                   return FP_SUBNORMAL;
0719                else
0720                   return FP_NORMAL;
0721             }
0722             inline bool                                      isfinite   BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)
0723             {
0724                return !::BOOST_CSTDFLOAT_FLOAT128_ISNAN(x) && !::BOOST_CSTDFLOAT_FLOAT128_ISINF(x);
0725             }
0726             inline bool                                      isinf      BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ISINF(x); }
0727             inline bool                                      isnan      BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ISNAN(x); }
0728             inline bool                                      isnormal   BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x) { return boost::math::cstdfloat::detail::fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(x) == FP_NORMAL; }
0729             inline bool                                      isgreater      BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
0730             {
0731                if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
0732                   return false;
0733                return x > y;
0734             }
0735             template <class T>
0736             inline typename std::enable_if<
0737                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0738                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0739                isgreater BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return isgreater BOOST_PREVENT_MACRO_SUBSTITUTION(x, (boost::math::cstdfloat::detail::float_internal128_t)y); }
0740             template <class T>
0741             inline typename std::enable_if<
0742                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0743                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0744                isgreater BOOST_PREVENT_MACRO_SUBSTITUTION(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return isgreater BOOST_PREVENT_MACRO_SUBSTITUTION((boost::math::cstdfloat::detail::float_internal128_t)x, y); }
0745 
0746             inline bool                                      isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
0747             {
0748                if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
0749                   return false;
0750                return x >= y;
0751             }
0752             template <class T>
0753             inline typename std::enable_if<
0754                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0755                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0756                isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION(x, (boost::math::cstdfloat::detail::float_internal128_t)y); }
0757             template <class T>
0758             inline typename std::enable_if<
0759                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0760                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0761                isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION((boost::math::cstdfloat::detail::float_internal128_t)x, y); }
0762 
0763             inline bool                                      isless      BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
0764             {
0765                if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
0766                   return false;
0767                return x < y;
0768             }
0769             template <class T>
0770             inline typename std::enable_if<
0771                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0772                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0773                isless BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return isless BOOST_PREVENT_MACRO_SUBSTITUTION(x, (boost::math::cstdfloat::detail::float_internal128_t)y); }
0774             template <class T>
0775             inline typename std::enable_if<
0776                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0777                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0778                isless BOOST_PREVENT_MACRO_SUBSTITUTION(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return isless BOOST_PREVENT_MACRO_SUBSTITUTION((boost::math::cstdfloat::detail::float_internal128_t)x, y); }
0779 
0780 
0781             inline bool                                      islessequal   BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
0782             {
0783                if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
0784                   return false;
0785                return x <= y;
0786             }
0787             template <class T>
0788             inline typename std::enable_if<
0789                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0790                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0791                islessequal BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return islessequal BOOST_PREVENT_MACRO_SUBSTITUTION(x, (boost::math::cstdfloat::detail::float_internal128_t)y); }
0792             template <class T>
0793             inline typename std::enable_if<
0794                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0795                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0796                islessequal BOOST_PREVENT_MACRO_SUBSTITUTION(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return islessequal BOOST_PREVENT_MACRO_SUBSTITUTION((boost::math::cstdfloat::detail::float_internal128_t)x, y); }
0797 
0798 
0799             inline bool                                      islessgreater   BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
0800             {
0801                if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
0802                   return false;
0803                return (x < y) || (x > y);
0804             }
0805             template <class T>
0806             inline typename std::enable_if<
0807                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0808                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0809                islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION(x, (boost::math::cstdfloat::detail::float_internal128_t)y); }
0810             template <class T>
0811             inline typename std::enable_if<
0812                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0813                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0814                islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION((boost::math::cstdfloat::detail::float_internal128_t)x, y); }
0815 
0816 
0817             inline bool                                      isunordered   BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_ISNAN(x) || ::BOOST_CSTDFLOAT_FLOAT128_ISNAN(y); }
0818             template <class T>
0819             inline typename std::enable_if<
0820                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0821                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0822                isunordered BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return isunordered BOOST_PREVENT_MACRO_SUBSTITUTION(x, (boost::math::cstdfloat::detail::float_internal128_t)y); }
0823             template <class T>
0824             inline typename std::enable_if<
0825                std::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
0826                && !std::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
0827                isunordered BOOST_PREVENT_MACRO_SUBSTITUTION(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return isunordered BOOST_PREVENT_MACRO_SUBSTITUTION((boost::math::cstdfloat::detail::float_internal128_t)x, y); }
0828 
0829 
0830             //   end more functions
0831          }
0832       }
0833    }
0834 } // boost::math::cstdfloat::detail
0835 
0836 // We will now inject the quadruple-precision <cmath> functions
0837 // into the std namespace. This is done via *using* directive.
0838 namespace std
0839 {
0840    using boost::math::cstdfloat::detail::ldexp;
0841    using boost::math::cstdfloat::detail::frexp;
0842    using boost::math::cstdfloat::detail::fabs;
0843 
0844 #if !(defined(_GLIBCXX_USE_FLOAT128) && defined(__GNUC__) && (__GNUC__ >= 7))
0845 #if (defined(__clang__) && !(!defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128))) || (__GNUC__ <= 6 && !defined(__clang__)) 
0846    // workaround for clang using libstdc++ and old GCC
0847    using boost::math::cstdfloat::detail::abs;
0848 #endif
0849 #endif
0850 
0851    using boost::math::cstdfloat::detail::floor;
0852    using boost::math::cstdfloat::detail::ceil;
0853    using boost::math::cstdfloat::detail::sqrt;
0854    using boost::math::cstdfloat::detail::trunc;
0855    using boost::math::cstdfloat::detail::exp;
0856    using boost::math::cstdfloat::detail::expm1;
0857    using boost::math::cstdfloat::detail::pow;
0858    using boost::math::cstdfloat::detail::log;
0859    using boost::math::cstdfloat::detail::log10;
0860    using boost::math::cstdfloat::detail::sin;
0861    using boost::math::cstdfloat::detail::cos;
0862    using boost::math::cstdfloat::detail::tan;
0863    using boost::math::cstdfloat::detail::asin;
0864    using boost::math::cstdfloat::detail::acos;
0865    using boost::math::cstdfloat::detail::atan;
0866    using boost::math::cstdfloat::detail::sinh;
0867    using boost::math::cstdfloat::detail::cosh;
0868    using boost::math::cstdfloat::detail::tanh;
0869    using boost::math::cstdfloat::detail::asinh;
0870    using boost::math::cstdfloat::detail::acosh;
0871    using boost::math::cstdfloat::detail::atanh;
0872    using boost::math::cstdfloat::detail::fmod;
0873    using boost::math::cstdfloat::detail::atan2;
0874    using boost::math::cstdfloat::detail::lgamma;
0875    using boost::math::cstdfloat::detail::tgamma;
0876 
0877    //   begin more functions
0878    using boost::math::cstdfloat::detail::remainder;
0879    using boost::math::cstdfloat::detail::remquo;
0880    using boost::math::cstdfloat::detail::fma;
0881    using boost::math::cstdfloat::detail::fmax;
0882    using boost::math::cstdfloat::detail::fmin;
0883    using boost::math::cstdfloat::detail::fdim;
0884    using boost::math::cstdfloat::detail::nanq;
0885    using boost::math::cstdfloat::detail::exp2;
0886    using boost::math::cstdfloat::detail::log2;
0887    using boost::math::cstdfloat::detail::log1p;
0888    using boost::math::cstdfloat::detail::cbrt;
0889    using boost::math::cstdfloat::detail::hypot;
0890    using boost::math::cstdfloat::detail::erf;
0891    using boost::math::cstdfloat::detail::erfc;
0892    using boost::math::cstdfloat::detail::llround;
0893    using boost::math::cstdfloat::detail::lround;
0894    using boost::math::cstdfloat::detail::round;
0895    using boost::math::cstdfloat::detail::nearbyint;
0896    using boost::math::cstdfloat::detail::llrint;
0897    using boost::math::cstdfloat::detail::lrint;
0898    using boost::math::cstdfloat::detail::rint;
0899    using boost::math::cstdfloat::detail::modf;
0900    using boost::math::cstdfloat::detail::scalbln;
0901    using boost::math::cstdfloat::detail::scalbn;
0902    using boost::math::cstdfloat::detail::ilogb;
0903    using boost::math::cstdfloat::detail::logb;
0904    using boost::math::cstdfloat::detail::nextafter;
0905    using boost::math::cstdfloat::detail::nexttoward;
0906    using boost::math::cstdfloat::detail::copysign;
0907    using boost::math::cstdfloat::detail::signbit;
0908    using boost::math::cstdfloat::detail::fpclassify;
0909    using boost::math::cstdfloat::detail::isfinite;
0910    using boost::math::cstdfloat::detail::isinf;
0911    using boost::math::cstdfloat::detail::isnan;
0912    using boost::math::cstdfloat::detail::isnormal;
0913    using boost::math::cstdfloat::detail::isgreater;
0914    using boost::math::cstdfloat::detail::isgreaterequal;
0915    using boost::math::cstdfloat::detail::isless;
0916    using boost::math::cstdfloat::detail::islessequal;
0917    using boost::math::cstdfloat::detail::islessgreater;
0918    using boost::math::cstdfloat::detail::isunordered;
0919    //   end more functions
0920 
0921 } // namespace std
0922 
0923 // We will now remove the preprocessor symbols representing quadruple-precision <cmath>
0924 // functions from the preprocessor.
0925 
0926 #undef BOOST_CSTDFLOAT_FLOAT128_LDEXP
0927 #undef BOOST_CSTDFLOAT_FLOAT128_FREXP
0928 #undef BOOST_CSTDFLOAT_FLOAT128_FABS
0929 #undef BOOST_CSTDFLOAT_FLOAT128_FLOOR
0930 #undef BOOST_CSTDFLOAT_FLOAT128_CEIL
0931 #undef BOOST_CSTDFLOAT_FLOAT128_SQRT
0932 #undef BOOST_CSTDFLOAT_FLOAT128_TRUNC
0933 #undef BOOST_CSTDFLOAT_FLOAT128_EXP
0934 #undef BOOST_CSTDFLOAT_FLOAT128_EXPM1
0935 #undef BOOST_CSTDFLOAT_FLOAT128_POW
0936 #undef BOOST_CSTDFLOAT_FLOAT128_LOG
0937 #undef BOOST_CSTDFLOAT_FLOAT128_LOG10
0938 #undef BOOST_CSTDFLOAT_FLOAT128_SIN
0939 #undef BOOST_CSTDFLOAT_FLOAT128_COS
0940 #undef BOOST_CSTDFLOAT_FLOAT128_TAN
0941 #undef BOOST_CSTDFLOAT_FLOAT128_ASIN
0942 #undef BOOST_CSTDFLOAT_FLOAT128_ACOS
0943 #undef BOOST_CSTDFLOAT_FLOAT128_ATAN
0944 #undef BOOST_CSTDFLOAT_FLOAT128_SINH
0945 #undef BOOST_CSTDFLOAT_FLOAT128_COSH
0946 #undef BOOST_CSTDFLOAT_FLOAT128_TANH
0947 #undef BOOST_CSTDFLOAT_FLOAT128_ASINH
0948 #undef BOOST_CSTDFLOAT_FLOAT128_ACOSH
0949 #undef BOOST_CSTDFLOAT_FLOAT128_ATANH
0950 #undef BOOST_CSTDFLOAT_FLOAT128_FMOD
0951 #undef BOOST_CSTDFLOAT_FLOAT128_ATAN2
0952 #undef BOOST_CSTDFLOAT_FLOAT128_LGAMMA
0953 #undef BOOST_CSTDFLOAT_FLOAT128_TGAMMA
0954 
0955 //   begin more functions
0956 #undef BOOST_CSTDFLOAT_FLOAT128_REMAINDER
0957 #undef BOOST_CSTDFLOAT_FLOAT128_REMQUO
0958 #undef BOOST_CSTDFLOAT_FLOAT128_FMA
0959 #undef BOOST_CSTDFLOAT_FLOAT128_FMAX
0960 #undef BOOST_CSTDFLOAT_FLOAT128_FMIN
0961 #undef BOOST_CSTDFLOAT_FLOAT128_FDIM
0962 #undef BOOST_CSTDFLOAT_FLOAT128_NAN
0963 #undef BOOST_CSTDFLOAT_FLOAT128_EXP2
0964 #undef BOOST_CSTDFLOAT_FLOAT128_LOG2
0965 #undef BOOST_CSTDFLOAT_FLOAT128_LOG1P
0966 #undef BOOST_CSTDFLOAT_FLOAT128_CBRT
0967 #undef BOOST_CSTDFLOAT_FLOAT128_HYPOT
0968 #undef BOOST_CSTDFLOAT_FLOAT128_ERF
0969 #undef BOOST_CSTDFLOAT_FLOAT128_ERFC
0970 #undef BOOST_CSTDFLOAT_FLOAT128_LLROUND
0971 #undef BOOST_CSTDFLOAT_FLOAT128_LROUND
0972 #undef BOOST_CSTDFLOAT_FLOAT128_ROUND
0973 #undef BOOST_CSTDFLOAT_FLOAT128_NEARBYINT
0974 #undef BOOST_CSTDFLOAT_FLOAT128_LLRINT
0975 #undef BOOST_CSTDFLOAT_FLOAT128_LRINT
0976 #undef BOOST_CSTDFLOAT_FLOAT128_RINT
0977 #undef BOOST_CSTDFLOAT_FLOAT128_MODF
0978 #undef BOOST_CSTDFLOAT_FLOAT128_SCALBLN
0979 #undef BOOST_CSTDFLOAT_FLOAT128_SCALBN
0980 #undef BOOST_CSTDFLOAT_FLOAT128_ILOGB
0981 #undef BOOST_CSTDFLOAT_FLOAT128_LOGB
0982 #undef BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER
0983 #undef BOOST_CSTDFLOAT_FLOAT128_NEXTTOWARD
0984 #undef BOOST_CSTDFLOAT_FLOAT128_COPYSIGN
0985 #undef BOOST_CSTDFLOAT_FLOAT128_SIGNBIT
0986 #undef BOOST_CSTDFLOAT_FLOAT128_FPCLASSIFY
0987 #undef BOOST_CSTDFLOAT_FLOAT128_ISFINITE
0988 #undef BOOST_CSTDFLOAT_FLOAT128_ISINF
0989 #undef BOOST_CSTDFLOAT_FLOAT128_ISNAN
0990 #undef BOOST_CSTDFLOAT_FLOAT128_ISNORMAL
0991 #undef BOOST_CSTDFLOAT_FLOAT128_ISGREATER
0992 #undef BOOST_CSTDFLOAT_FLOAT128_ISGREATEREQUAL
0993 #undef BOOST_CSTDFLOAT_FLOAT128_ISLESS
0994 #undef BOOST_CSTDFLOAT_FLOAT128_ISLESSEQUAL
0995 #undef BOOST_CSTDFLOAT_FLOAT128_ISLESSGREATER
0996 #undef BOOST_CSTDFLOAT_FLOAT128_ISUNORDERED
0997 //   end more functions
0998 
0999 #endif // Not BOOST_CSTDFLOAT_NO_LIBQUADMATH_SUPPORT (i.e., the user would like to have libquadmath support)
1000 
1001 #endif // BOOST_MATH_CSTDFLOAT_CMATH_2014_02_15_HPP_
1002