1 ///////////////////////////////////////////////////////////////////////////////
2 // Copyright Christopher Kormanyos 2014.
3 // Copyright John Maddock 2014.
4 // Copyright Paul Bristow 2014.
5 // Distributed under the Boost Software License,
6 // Version 1.0. (See accompanying file LICENSE_1_0.txt
7 // or copy at http://www.boost.org/LICENSE_1_0.txt)
8 //
9
10 // Implement quadruple-precision <cmath> support.
11
12 #ifndef BOOST_MATH_CSTDFLOAT_CMATH_2014_02_15_HPP_
13 #define BOOST_MATH_CSTDFLOAT_CMATH_2014_02_15_HPP_
14
15 #include <boost/math/cstdfloat/cstdfloat_types.hpp>
16 #include <boost/math/cstdfloat/cstdfloat_limits.hpp>
17
18 #if defined(BOOST_CSTDFLOAT_HAS_INTERNAL_FLOAT128_T) && defined(BOOST_MATH_USE_FLOAT128) && !defined(BOOST_CSTDFLOAT_NO_LIBQUADMATH_SUPPORT)
19
20 #include <cmath>
21 #include <stdexcept>
22 #include <iostream>
23 #include <boost/cstdint.hpp>
24 #include <boost/static_assert.hpp>
25 #include <boost/throw_exception.hpp>
26 #include <boost/core/enable_if.hpp>
27 #include <boost/type_traits/is_same.hpp>
28 #include <boost/type_traits/is_convertible.hpp>
29 #include <boost/scoped_array.hpp>
30
31 #if defined(_WIN32) && defined(__GNUC__)
32 // Several versions of Mingw and probably cygwin too have broken
33 // libquadmath implementations that segfault as soon as you call
34 // expq or any function that depends on it.
35 #define BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
36 #endif
37
38 // Here is a helper function used for raising the value of a given
39 // floating-point type to the power of n, where n has integral type.
40 namespace boost {
41 namespace math {
42 namespace cstdfloat {
43 namespace detail {
44
45 template<class float_type, class integer_type>
pown(const float_type & x,const integer_type p)46 inline float_type pown(const float_type& x, const integer_type p)
47 {
48 const bool isneg = (x < 0);
49 const bool isnan = (x != x);
50 const bool isinf = ((!isneg) ? bool(+x > (std::numeric_limits<float_type>::max)())
51 : bool(-x > (std::numeric_limits<float_type>::max)()));
52
53 if (isnan) { return x; }
54
55 if (isinf) { return std::numeric_limits<float_type>::quiet_NaN(); }
56
57 const bool x_is_neg = (x < 0);
58 const float_type abs_x = (x_is_neg ? -x : x);
59
60 if (p < static_cast<integer_type>(0))
61 {
62 if (abs_x < (std::numeric_limits<float_type>::min)())
63 {
64 return (x_is_neg ? -std::numeric_limits<float_type>::infinity()
65 : +std::numeric_limits<float_type>::infinity());
66 }
67 else
68 {
69 return float_type(1) / pown(x, static_cast<integer_type>(-p));
70 }
71 }
72
73 if (p == static_cast<integer_type>(0))
74 {
75 return float_type(1);
76 }
77 else
78 {
79 if (p == static_cast<integer_type>(1)) { return x; }
80
81 if (abs_x > (std::numeric_limits<float_type>::max)())
82 {
83 return (x_is_neg ? -std::numeric_limits<float_type>::infinity()
84 : +std::numeric_limits<float_type>::infinity());
85 }
86
87 if (p == static_cast<integer_type>(2)) { return (x * x); }
88 else if (p == static_cast<integer_type>(3)) { return ((x * x) * x); }
89 else if (p == static_cast<integer_type>(4)) { const float_type x2 = (x * x); return (x2 * x2); }
90 else
91 {
92 // The variable xn stores the binary powers of x.
93 float_type result(((p % integer_type(2)) != integer_type(0)) ? x : float_type(1));
94 float_type xn(x);
95
96 integer_type p2 = p;
97
98 while (integer_type(p2 /= 2) != integer_type(0))
99 {
100 // Square xn for each binary power.
101 xn *= xn;
102
103 const bool has_binary_power = (integer_type(p2 % integer_type(2)) != integer_type(0));
104
105 if (has_binary_power)
106 {
107 // Multiply the result with each binary power contained in the exponent.
108 result *= xn;
109 }
110 }
111
112 return result;
113 }
114 }
115 }
116
117 }
118 }
119 }
120 } // boost::math::cstdfloat::detail
121
122 // We will now define preprocessor symbols representing quadruple-precision <cmath> functions.
123 #if defined(BOOST_INTEL)
124 #define BOOST_CSTDFLOAT_FLOAT128_LDEXP __ldexpq
125 #define BOOST_CSTDFLOAT_FLOAT128_FREXP __frexpq
126 #define BOOST_CSTDFLOAT_FLOAT128_FABS __fabsq
127 #define BOOST_CSTDFLOAT_FLOAT128_FLOOR __floorq
128 #define BOOST_CSTDFLOAT_FLOAT128_CEIL __ceilq
129 #if !defined(BOOST_CSTDFLOAT_FLOAT128_SQRT)
130 #define BOOST_CSTDFLOAT_FLOAT128_SQRT __sqrtq
131 #endif
132 #define BOOST_CSTDFLOAT_FLOAT128_TRUNC __truncq
133 #define BOOST_CSTDFLOAT_FLOAT128_EXP __expq
134 #define BOOST_CSTDFLOAT_FLOAT128_EXPM1 __expm1q
135 #define BOOST_CSTDFLOAT_FLOAT128_POW __powq
136 #define BOOST_CSTDFLOAT_FLOAT128_LOG __logq
137 #define BOOST_CSTDFLOAT_FLOAT128_LOG10 __log10q
138 #define BOOST_CSTDFLOAT_FLOAT128_SIN __sinq
139 #define BOOST_CSTDFLOAT_FLOAT128_COS __cosq
140 #define BOOST_CSTDFLOAT_FLOAT128_TAN __tanq
141 #define BOOST_CSTDFLOAT_FLOAT128_ASIN __asinq
142 #define BOOST_CSTDFLOAT_FLOAT128_ACOS __acosq
143 #define BOOST_CSTDFLOAT_FLOAT128_ATAN __atanq
144 #define BOOST_CSTDFLOAT_FLOAT128_SINH __sinhq
145 #define BOOST_CSTDFLOAT_FLOAT128_COSH __coshq
146 #define BOOST_CSTDFLOAT_FLOAT128_TANH __tanhq
147 #define BOOST_CSTDFLOAT_FLOAT128_ASINH __asinhq
148 #define BOOST_CSTDFLOAT_FLOAT128_ACOSH __acoshq
149 #define BOOST_CSTDFLOAT_FLOAT128_ATANH __atanhq
150 #define BOOST_CSTDFLOAT_FLOAT128_FMOD __fmodq
151 #define BOOST_CSTDFLOAT_FLOAT128_ATAN2 __atan2q
152 #define BOOST_CSTDFLOAT_FLOAT128_LGAMMA __lgammaq
153 #define BOOST_CSTDFLOAT_FLOAT128_TGAMMA __tgammaq
154 // begin more functions
155 #define BOOST_CSTDFLOAT_FLOAT128_REMAINDER __remainderq
156 #define BOOST_CSTDFLOAT_FLOAT128_REMQUO __remquoq
157 #define BOOST_CSTDFLOAT_FLOAT128_FMA __fmaq
158 #define BOOST_CSTDFLOAT_FLOAT128_FMAX __fmaxq
159 #define BOOST_CSTDFLOAT_FLOAT128_FMIN __fminq
160 #define BOOST_CSTDFLOAT_FLOAT128_FDIM __fdimq
161 #define BOOST_CSTDFLOAT_FLOAT128_NAN __nanq
162 //#define BOOST_CSTDFLOAT_FLOAT128_EXP2 __exp2q
163 #define BOOST_CSTDFLOAT_FLOAT128_LOG2 __log2q
164 #define BOOST_CSTDFLOAT_FLOAT128_LOG1P __log1pq
165 #define BOOST_CSTDFLOAT_FLOAT128_CBRT __cbrtq
166 #define BOOST_CSTDFLOAT_FLOAT128_HYPOT __hypotq
167 #define BOOST_CSTDFLOAT_FLOAT128_ERF __erfq
168 #define BOOST_CSTDFLOAT_FLOAT128_ERFC __erfcq
169 #define BOOST_CSTDFLOAT_FLOAT128_LLROUND __llroundq
170 #define BOOST_CSTDFLOAT_FLOAT128_LROUND __lroundq
171 #define BOOST_CSTDFLOAT_FLOAT128_ROUND __roundq
172 #define BOOST_CSTDFLOAT_FLOAT128_NEARBYINT __nearbyintq
173 #define BOOST_CSTDFLOAT_FLOAT128_LLRINT __llrintq
174 #define BOOST_CSTDFLOAT_FLOAT128_LRINT __lrintq
175 #define BOOST_CSTDFLOAT_FLOAT128_RINT __rintq
176 #define BOOST_CSTDFLOAT_FLOAT128_MODF __modfq
177 #define BOOST_CSTDFLOAT_FLOAT128_SCALBLN __scalblnq
178 #define BOOST_CSTDFLOAT_FLOAT128_SCALBN __scalbnq
179 #define BOOST_CSTDFLOAT_FLOAT128_ILOGB __ilogbq
180 #define BOOST_CSTDFLOAT_FLOAT128_LOGB __logbq
181 #define BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER __nextafterq
182 //#define BOOST_CSTDFLOAT_FLOAT128_NEXTTOWARD __nexttowardq
183 #define BOOST_CSTDFLOAT_FLOAT128_COPYSIGN __copysignq
184 #define BOOST_CSTDFLOAT_FLOAT128_SIGNBIT __signbitq
185 //#define BOOST_CSTDFLOAT_FLOAT128_FPCLASSIFY __fpclassifyq
186 //#define BOOST_CSTDFLOAT_FLOAT128_ISFINITE __isfiniteq
187 #define BOOST_CSTDFLOAT_FLOAT128_ISINF __isinfq
188 #define BOOST_CSTDFLOAT_FLOAT128_ISNAN __isnanq
189 //#define BOOST_CSTDFLOAT_FLOAT128_ISNORMAL __isnormalq
190 //#define BOOST_CSTDFLOAT_FLOAT128_ISGREATER __isgreaterq
191 //#define BOOST_CSTDFLOAT_FLOAT128_ISGREATEREQUAL __isgreaterequalq
192 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESS __islessq
193 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESSEQUAL __islessequalq
194 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESSGREATER __islessgreaterq
195 //#define BOOST_CSTDFLOAT_FLOAT128_ISUNORDERED __isunorderedq
196 // end more functions
197 #elif defined(__GNUC__)
198 #define BOOST_CSTDFLOAT_FLOAT128_LDEXP ldexpq
199 #define BOOST_CSTDFLOAT_FLOAT128_FREXP frexpq
200 #define BOOST_CSTDFLOAT_FLOAT128_FABS fabsq
201 #define BOOST_CSTDFLOAT_FLOAT128_FLOOR floorq
202 #define BOOST_CSTDFLOAT_FLOAT128_CEIL ceilq
203 #if !defined(BOOST_CSTDFLOAT_FLOAT128_SQRT)
204 #define BOOST_CSTDFLOAT_FLOAT128_SQRT sqrtq
205 #endif
206 #define BOOST_CSTDFLOAT_FLOAT128_TRUNC truncq
207 #define BOOST_CSTDFLOAT_FLOAT128_POW powq
208 #define BOOST_CSTDFLOAT_FLOAT128_LOG logq
209 #define BOOST_CSTDFLOAT_FLOAT128_LOG10 log10q
210 #define BOOST_CSTDFLOAT_FLOAT128_SIN sinq
211 #define BOOST_CSTDFLOAT_FLOAT128_COS cosq
212 #define BOOST_CSTDFLOAT_FLOAT128_TAN tanq
213 #define BOOST_CSTDFLOAT_FLOAT128_ASIN asinq
214 #define BOOST_CSTDFLOAT_FLOAT128_ACOS acosq
215 #define BOOST_CSTDFLOAT_FLOAT128_ATAN atanq
216 #define BOOST_CSTDFLOAT_FLOAT128_FMOD fmodq
217 #define BOOST_CSTDFLOAT_FLOAT128_ATAN2 atan2q
218 #define BOOST_CSTDFLOAT_FLOAT128_LGAMMA lgammaq
219 #if !defined(BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS)
220 #define BOOST_CSTDFLOAT_FLOAT128_EXP expq
221 #define BOOST_CSTDFLOAT_FLOAT128_EXPM1 expm1q
222 #define BOOST_CSTDFLOAT_FLOAT128_SINH sinhq
223 #define BOOST_CSTDFLOAT_FLOAT128_COSH coshq
224 #define BOOST_CSTDFLOAT_FLOAT128_TANH tanhq
225 #define BOOST_CSTDFLOAT_FLOAT128_ASINH asinhq
226 #define BOOST_CSTDFLOAT_FLOAT128_ACOSH acoshq
227 #define BOOST_CSTDFLOAT_FLOAT128_ATANH atanhq
228 #define BOOST_CSTDFLOAT_FLOAT128_TGAMMA tgammaq
229 #else // BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
230 #define BOOST_CSTDFLOAT_FLOAT128_EXP expq_patch
231 #define BOOST_CSTDFLOAT_FLOAT128_SINH sinhq_patch
232 #define BOOST_CSTDFLOAT_FLOAT128_COSH coshq_patch
233 #define BOOST_CSTDFLOAT_FLOAT128_TANH tanhq_patch
234 #define BOOST_CSTDFLOAT_FLOAT128_ASINH asinhq_patch
235 #define BOOST_CSTDFLOAT_FLOAT128_ACOSH acoshq_patch
236 #define BOOST_CSTDFLOAT_FLOAT128_ATANH atanhq_patch
237 #define BOOST_CSTDFLOAT_FLOAT128_TGAMMA tgammaq_patch
238 #endif // BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
239 // begin more functions
240 #define BOOST_CSTDFLOAT_FLOAT128_REMAINDER remainderq
241 #define BOOST_CSTDFLOAT_FLOAT128_REMQUO remquoq
242 #define BOOST_CSTDFLOAT_FLOAT128_FMA fmaq
243 #define BOOST_CSTDFLOAT_FLOAT128_FMAX fmaxq
244 #define BOOST_CSTDFLOAT_FLOAT128_FMIN fminq
245 #define BOOST_CSTDFLOAT_FLOAT128_FDIM fdimq
246 #define BOOST_CSTDFLOAT_FLOAT128_NAN nanq
247 //#define BOOST_CSTDFLOAT_FLOAT128_EXP2 exp2q
248 #define BOOST_CSTDFLOAT_FLOAT128_LOG2 log2q
249 #define BOOST_CSTDFLOAT_FLOAT128_LOG1P log1pq
250 #define BOOST_CSTDFLOAT_FLOAT128_CBRT cbrtq
251 #define BOOST_CSTDFLOAT_FLOAT128_HYPOT hypotq
252 #define BOOST_CSTDFLOAT_FLOAT128_ERF erfq
253 #define BOOST_CSTDFLOAT_FLOAT128_ERFC erfcq
254 #define BOOST_CSTDFLOAT_FLOAT128_LLROUND llroundq
255 #define BOOST_CSTDFLOAT_FLOAT128_LROUND lroundq
256 #define BOOST_CSTDFLOAT_FLOAT128_ROUND roundq
257 #define BOOST_CSTDFLOAT_FLOAT128_NEARBYINT nearbyintq
258 #define BOOST_CSTDFLOAT_FLOAT128_LLRINT llrintq
259 #define BOOST_CSTDFLOAT_FLOAT128_LRINT lrintq
260 #define BOOST_CSTDFLOAT_FLOAT128_RINT rintq
261 #define BOOST_CSTDFLOAT_FLOAT128_MODF modfq
262 #define BOOST_CSTDFLOAT_FLOAT128_SCALBLN scalblnq
263 #define BOOST_CSTDFLOAT_FLOAT128_SCALBN scalbnq
264 #define BOOST_CSTDFLOAT_FLOAT128_ILOGB ilogbq
265 #define BOOST_CSTDFLOAT_FLOAT128_LOGB logbq
266 #define BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER nextafterq
267 //#define BOOST_CSTDFLOAT_FLOAT128_NEXTTOWARD nexttowardq
268 #define BOOST_CSTDFLOAT_FLOAT128_COPYSIGN copysignq
269 #define BOOST_CSTDFLOAT_FLOAT128_SIGNBIT signbitq
270 //#define BOOST_CSTDFLOAT_FLOAT128_FPCLASSIFY fpclassifyq
271 //#define BOOST_CSTDFLOAT_FLOAT128_ISFINITE isfiniteq
272 #define BOOST_CSTDFLOAT_FLOAT128_ISINF isinfq
273 #define BOOST_CSTDFLOAT_FLOAT128_ISNAN isnanq
274 //#define BOOST_CSTDFLOAT_FLOAT128_ISNORMAL isnormalq
275 //#define BOOST_CSTDFLOAT_FLOAT128_ISGREATER isgreaterq
276 //#define BOOST_CSTDFLOAT_FLOAT128_ISGREATEREQUAL isgreaterequalq
277 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESS islessq
278 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESSEQUAL islessequalq
279 //#define BOOST_CSTDFLOAT_FLOAT128_ISLESSGREATER islessgreaterq
280 //#define BOOST_CSTDFLOAT_FLOAT128_ISUNORDERED isunorderedq
281 // end more functions
282 #endif
283
284 // Implement quadruple-precision <cmath> functions in the namespace
285 // boost::math::cstdfloat::detail. Subsequently inject these into the
286 // std namespace via *using* directive.
287
288 // Begin with some forward function declarations. Also implement patches
289 // for compilers that have broken float128 exponential functions.
290
291 extern "C" int quadmath_snprintf(char*, std::size_t, const char*, ...) throw();
292
293 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LDEXP(boost::math::cstdfloat::detail::float_internal128_t, int) throw();
294 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_FREXP(boost::math::cstdfloat::detail::float_internal128_t, int*) throw();
295 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_FABS(boost::math::cstdfloat::detail::float_internal128_t) throw();
296 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_FLOOR(boost::math::cstdfloat::detail::float_internal128_t) throw();
297 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_CEIL(boost::math::cstdfloat::detail::float_internal128_t) throw();
298 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SQRT(boost::math::cstdfloat::detail::float_internal128_t) throw();
299 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TRUNC(boost::math::cstdfloat::detail::float_internal128_t) throw();
300 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) throw();
301 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LOG(boost::math::cstdfloat::detail::float_internal128_t) throw();
302 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LOG10(boost::math::cstdfloat::detail::float_internal128_t) throw();
303 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SIN(boost::math::cstdfloat::detail::float_internal128_t) throw();
304 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_COS(boost::math::cstdfloat::detail::float_internal128_t) throw();
305 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TAN(boost::math::cstdfloat::detail::float_internal128_t) throw();
306 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ASIN(boost::math::cstdfloat::detail::float_internal128_t) throw();
307 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ACOS(boost::math::cstdfloat::detail::float_internal128_t) throw();
308 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ATAN(boost::math::cstdfloat::detail::float_internal128_t) throw();
309 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) throw();
310 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) throw();
311 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LGAMMA(boost::math::cstdfloat::detail::float_internal128_t) throw();
312
313 // begin more functions
314 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) throw();
315 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*) throw();
316 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) throw();
317 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) throw();
318 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) throw();
319 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) throw();
320 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_NAN(const char*) throw();
321 //extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXP2 (boost::math::cstdfloat::detail::float_internal128_t) throw();
322 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LOG2(boost::math::cstdfloat::detail::float_internal128_t) throw();
323 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LOG1P(boost::math::cstdfloat::detail::float_internal128_t) throw();
324 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_CBRT(boost::math::cstdfloat::detail::float_internal128_t) throw();
325 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) throw();
326 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ERF(boost::math::cstdfloat::detail::float_internal128_t) throw();
327 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ERFC(boost::math::cstdfloat::detail::float_internal128_t) throw();
328 extern "C" long long int BOOST_CSTDFLOAT_FLOAT128_LLROUND(boost::math::cstdfloat::detail::float_internal128_t) throw();
329 extern "C" long int BOOST_CSTDFLOAT_FLOAT128_LROUND(boost::math::cstdfloat::detail::float_internal128_t) throw();
330 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ROUND(boost::math::cstdfloat::detail::float_internal128_t) throw();
331 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_NEARBYINT(boost::math::cstdfloat::detail::float_internal128_t) throw();
332 extern "C" long long int BOOST_CSTDFLOAT_FLOAT128_LLRINT(boost::math::cstdfloat::detail::float_internal128_t) throw();
333 extern "C" long int BOOST_CSTDFLOAT_FLOAT128_LRINT(boost::math::cstdfloat::detail::float_internal128_t) throw();
334 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_RINT(boost::math::cstdfloat::detail::float_internal128_t) throw();
335 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*) throw();
336 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SCALBLN(boost::math::cstdfloat::detail::float_internal128_t, long int) throw();
337 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SCALBN(boost::math::cstdfloat::detail::float_internal128_t, int) throw();
338 extern "C" int BOOST_CSTDFLOAT_FLOAT128_ILOGB(boost::math::cstdfloat::detail::float_internal128_t) throw();
339 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_LOGB(boost::math::cstdfloat::detail::float_internal128_t) throw();
340 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) throw();
341 //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) throw();
342 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) throw();
343 extern "C" int BOOST_CSTDFLOAT_FLOAT128_SIGNBIT(boost::math::cstdfloat::detail::float_internal128_t) throw();
344 //extern "C" int BOOST_CSTDFLOAT_FLOAT128_FPCLASSIFY (boost::math::cstdfloat::detail::float_internal128_t) throw();
345 //extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISFINITE (boost::math::cstdfloat::detail::float_internal128_t) throw();
346 extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISINF(boost::math::cstdfloat::detail::float_internal128_t) throw();
347 extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISNAN(boost::math::cstdfloat::detail::float_internal128_t) throw();
348 //extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ISNORMAL (boost::math::cstdfloat::detail::float_internal128_t) throw();
349 //extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISGREATER (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) throw();
350 //extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISGREATEREQUAL(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) throw();
351 //extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISLESS (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) throw();
352 //extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISLESSEQUAL (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) throw();
353 //extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISLESSGREATER(boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) throw();
354 //extern "C" int BOOST_CSTDFLOAT_FLOAT128_ISUNORDERED (boost::math::cstdfloat::detail::float_internal128_t, boost::math::cstdfloat::detail::float_internal128_t) throw();
355 // end more functions
356
357 #if !defined(BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS)
358
359 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXP(boost::math::cstdfloat::detail::float_internal128_t x) throw();
360 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXPM1(boost::math::cstdfloat::detail::float_internal128_t x) throw();
361 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SINH(boost::math::cstdfloat::detail::float_internal128_t x) throw();
362 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_COSH(boost::math::cstdfloat::detail::float_internal128_t x) throw();
363 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TANH(boost::math::cstdfloat::detail::float_internal128_t x) throw();
364 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ASINH(boost::math::cstdfloat::detail::float_internal128_t x) throw();
365 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ACOSH(boost::math::cstdfloat::detail::float_internal128_t x) throw();
366 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ATANH(boost::math::cstdfloat::detail::float_internal128_t x) throw();
367 extern "C" boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TGAMMA(boost::math::cstdfloat::detail::float_internal128_t x) throw();
368
369 #else // BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
370
371 // Forward declaration of the patched exponent function, exp(x).
372 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXP(boost::math::cstdfloat::detail::float_internal128_t x);
373
BOOST_CSTDFLOAT_FLOAT128_EXPM1(boost::math::cstdfloat::detail::float_internal128_t x)374 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXPM1(boost::math::cstdfloat::detail::float_internal128_t x)
375 {
376 // Compute exp(x) - 1 for x small.
377
378 // Use an order-36 polynomial approximation of the exponential function
379 // in the range of (-ln2 < x < ln2). Scale the argument to this range
380 // and subsequently multiply the result by 2^n accordingly.
381
382 // Derive the polynomial coefficients with Mathematica(R) by generating
383 // a table of high-precision values of exp(x) in the range (-ln2 < x < ln2)
384 // and subsequently applying the built-in *Fit* function.
385
386 // Table[{x, Exp[x] - 1}, {x, -Log[2], Log[2], 1/180}]
387 // N[%, 120]
388 // Fit[%, {x, x^2, x^3, x^4, x^5, x^6, x^7, x^8, x^9, x^10, x^11, x^12,
389 // x^13, x^14, x^15, x^16, x^17, x^18, x^19, x^20, x^21, x^22,
390 // x^23, x^24, x^25, x^26, x^27, x^28, x^29, x^30, x^31, x^32,
391 // x^33, x^34, x^35, x^36}, x]
392
393 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
394
395 float_type sum;
396
397 if (x > BOOST_FLOAT128_C(0.693147180559945309417232121458176568075500134360255))
398 {
399 sum = ::BOOST_CSTDFLOAT_FLOAT128_EXP(x) - float_type(1);
400 }
401 else
402 {
403 // Compute the polynomial approximation of exp(alpha).
404 sum = ((((((((((((((((((((((((((((((((((((float_type(BOOST_FLOAT128_C(2.69291698127774166063293705964720493864630783729857438187365E-42)) * x
405 + float_type(BOOST_FLOAT128_C(9.70937085471487654794114679403710456028986572118859594614033E-41))) * x
406 + float_type(BOOST_FLOAT128_C(3.38715585158055097155585505318085512156885389014410753080500E-39))) * x
407 + float_type(BOOST_FLOAT128_C(1.15162718532861050809222658798662695267019717760563645440433E-37))) * x
408 + float_type(BOOST_FLOAT128_C(3.80039074689434663295873584133017767349635602413675471702393E-36))) * x
409 + float_type(BOOST_FLOAT128_C(1.21612504934087520075905434734158045947460467096773246215239E-34))) * x
410 + float_type(BOOST_FLOAT128_C(3.76998762883139753126119821241037824830069851253295480396224E-33))) * x
411 + float_type(BOOST_FLOAT128_C(1.13099628863830344684998293828608215735777107850991029729440E-31))) * x
412 + float_type(BOOST_FLOAT128_C(3.27988923706982293204067897468714277771890104022419696770352E-30))) * x
413 + float_type(BOOST_FLOAT128_C(9.18368986379558482800593745627556950089950023355628325088207E-29))) * x
414 + float_type(BOOST_FLOAT128_C(2.47959626322479746949155352659617642905315302382639380521497E-27))) * x
415 + float_type(BOOST_FLOAT128_C(6.44695028438447337900255966737803112935639344283098705091949E-26))) * x
416 + float_type(BOOST_FLOAT128_C(1.61173757109611834904452725462599961406036904573072897122957E-24))) * x
417 + float_type(BOOST_FLOAT128_C(3.86817017063068403772269360016918092488847584660382953555804E-23))) * x
418 + float_type(BOOST_FLOAT128_C(8.89679139245057328674891109315654704307721758924206107351744E-22))) * x
419 + float_type(BOOST_FLOAT128_C(1.95729410633912612308475595397946731738088422488032228717097E-20))) * x
420 + float_type(BOOST_FLOAT128_C(4.11031762331216485847799061511674191805055663711439605760231E-19))) * x
421 + float_type(BOOST_FLOAT128_C(8.22063524662432971695598123977873600603370758794431071426640E-18))) * x
422 + float_type(BOOST_FLOAT128_C(1.56192069685862264622163643500633782667263448653185159383285E-16))) * x
423 + float_type(BOOST_FLOAT128_C(2.81145725434552076319894558300988749849555291507956994126835E-15))) * x
424 + float_type(BOOST_FLOAT128_C(4.77947733238738529743820749111754320727153728139716409114011E-14))) * x
425 + float_type(BOOST_FLOAT128_C(7.64716373181981647590113198578807092707697416852226691068627E-13))) * x
426 + float_type(BOOST_FLOAT128_C(1.14707455977297247138516979786821056670509688396295740818677E-11))) * x
427 + float_type(BOOST_FLOAT128_C(1.60590438368216145993923771701549479323291461578567184216302E-10))) * x
428 + float_type(BOOST_FLOAT128_C(2.08767569878680989792100903212014323125428376052986408239620E-09))) * x
429 + float_type(BOOST_FLOAT128_C(2.50521083854417187750521083854417187750523408006206780016659E-08))) * x
430 + float_type(BOOST_FLOAT128_C(2.75573192239858906525573192239858906525573195144226062684604E-07))) * x
431 + float_type(BOOST_FLOAT128_C(2.75573192239858906525573192239858906525573191310049321957902E-06))) * x
432 + float_type(BOOST_FLOAT128_C(0.00002480158730158730158730158730158730158730158730149317774))) * x
433 + float_type(BOOST_FLOAT128_C(0.00019841269841269841269841269841269841269841269841293575920))) * x
434 + float_type(BOOST_FLOAT128_C(0.00138888888888888888888888888888888888888888888888889071045))) * x
435 + float_type(BOOST_FLOAT128_C(0.00833333333333333333333333333333333333333333333333332986595))) * x
436 + float_type(BOOST_FLOAT128_C(0.04166666666666666666666666666666666666666666666666666664876))) * x
437 + float_type(BOOST_FLOAT128_C(0.16666666666666666666666666666666666666666666666666666669048))) * x
438 + float_type(BOOST_FLOAT128_C(0.50000000000000000000000000000000000000000000000000000000006))) * x
439 + float_type(BOOST_FLOAT128_C(0.99999999999999999999999999999999999999999999999999999999995))) * x);
440 }
441
442 return sum;
443 }
BOOST_CSTDFLOAT_FLOAT128_EXP(boost::math::cstdfloat::detail::float_internal128_t x)444 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_EXP(boost::math::cstdfloat::detail::float_internal128_t x)
445 {
446 // Patch the expq() function for a subset of broken GCC compilers
447 // like GCC 4.7, 4.8 on MinGW.
448
449 // Use an order-36 polynomial approximation of the exponential function
450 // in the range of (-ln2 < x < ln2). Scale the argument to this range
451 // and subsequently multiply the result by 2^n accordingly.
452
453 // Derive the polynomial coefficients with Mathematica(R) by generating
454 // a table of high-precision values of exp(x) in the range (-ln2 < x < ln2)
455 // and subsequently applying the built-in *Fit* function.
456
457 // Table[{x, Exp[x] - 1}, {x, -Log[2], Log[2], 1/180}]
458 // N[%, 120]
459 // Fit[%, {x, x^2, x^3, x^4, x^5, x^6, x^7, x^8, x^9, x^10, x^11, x^12,
460 // x^13, x^14, x^15, x^16, x^17, x^18, x^19, x^20, x^21, x^22,
461 // x^23, x^24, x^25, x^26, x^27, x^28, x^29, x^30, x^31, x^32,
462 // x^33, x^34, x^35, x^36}, x]
463
464 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
465
466 // Scale the argument x to the range (-ln2 < x < ln2).
467 BOOST_CONSTEXPR_OR_CONST float_type one_over_ln2 = float_type(BOOST_FLOAT128_C(1.44269504088896340735992468100189213742664595415299));
468 const float_type x_over_ln2 = x * one_over_ln2;
469
470 boost::int_fast32_t n;
471
472 if (x != x)
473 {
474 // The argument is NaN.
475 return std::numeric_limits<float_type>::quiet_NaN();
476 }
477 else if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x) > BOOST_FLOAT128_C(+0.693147180559945309417232121458176568075500134360255))
478 {
479 // The absolute value of the argument exceeds ln2.
480 n = static_cast<boost::int_fast32_t>(::BOOST_CSTDFLOAT_FLOAT128_FLOOR(x_over_ln2));
481 }
482 else if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x) < BOOST_FLOAT128_C(+0.693147180559945309417232121458176568075500134360255))
483 {
484 // The absolute value of the argument is less than ln2.
485 n = static_cast<boost::int_fast32_t>(0);
486 }
487 else
488 {
489 // The absolute value of the argument is exactly equal to ln2 (in the sense of floating-point equality).
490 return float_type(2);
491 }
492
493 // Check if the argument is very near an integer.
494 const float_type floor_of_x = ::BOOST_CSTDFLOAT_FLOAT128_FLOOR(x);
495
496 if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x - floor_of_x) < float_type(BOOST_CSTDFLOAT_FLOAT128_EPS))
497 {
498 // Return e^n for arguments very near an integer.
499 return boost::math::cstdfloat::detail::pown(BOOST_FLOAT128_C(2.71828182845904523536028747135266249775724709369996), static_cast<boost::int_fast32_t>(floor_of_x));
500 }
501
502 // Compute the scaled argument alpha.
503 const float_type alpha = x - (n * BOOST_FLOAT128_C(0.693147180559945309417232121458176568075500134360255));
504
505 // Compute the polynomial approximation of expm1(alpha) and add to it
506 // in order to obtain the scaled result.
507 const float_type scaled_result = ::BOOST_CSTDFLOAT_FLOAT128_EXPM1(alpha) + float_type(1);
508
509 // Rescale the result and return it.
510 return scaled_result * boost::math::cstdfloat::detail::pown(float_type(2), n);
511 }
BOOST_CSTDFLOAT_FLOAT128_SINH(boost::math::cstdfloat::detail::float_internal128_t x)512 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_SINH(boost::math::cstdfloat::detail::float_internal128_t x)
513 {
514 // Patch the sinhq() function for a subset of broken GCC compilers
515 // like GCC 4.7, 4.8 on MinGW.
516 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
517
518 // Here, we use the following:
519 // Set: ex = exp(x)
520 // Set: em1 = expm1(x)
521 // Then
522 // sinh(x) = (ex - 1/ex) / 2 ; for |x| >= 1
523 // sinh(x) = (2em1 + em1^2) / (2ex) ; for |x| < 1
524
525 const float_type ex = ::BOOST_CSTDFLOAT_FLOAT128_EXP(x);
526
527 if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x) < float_type(+1))
528 {
529 const float_type em1 = ::BOOST_CSTDFLOAT_FLOAT128_EXPM1(x);
530
531 return ((em1 * 2) + (em1 * em1)) / (ex * 2);
532 }
533 else
534 {
535 return (ex - (float_type(1) / ex)) / 2;
536 }
537 }
BOOST_CSTDFLOAT_FLOAT128_COSH(boost::math::cstdfloat::detail::float_internal128_t x)538 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_COSH(boost::math::cstdfloat::detail::float_internal128_t x)
539 {
540 // Patch the coshq() function for a subset of broken GCC compilers
541 // like GCC 4.7, 4.8 on MinGW.
542 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
543 const float_type ex = ::BOOST_CSTDFLOAT_FLOAT128_EXP(x);
544 return (ex + (float_type(1) / ex)) / 2;
545 }
BOOST_CSTDFLOAT_FLOAT128_TANH(boost::math::cstdfloat::detail::float_internal128_t x)546 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TANH(boost::math::cstdfloat::detail::float_internal128_t x)
547 {
548 // Patch the tanhq() function for a subset of broken GCC compilers
549 // like GCC 4.7, 4.8 on MinGW.
550 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
551 const float_type ex_plus = ::BOOST_CSTDFLOAT_FLOAT128_EXP(x);
552 const float_type ex_minus = (float_type(1) / ex_plus);
553 return (ex_plus - ex_minus) / (ex_plus + ex_minus);
554 }
BOOST_CSTDFLOAT_FLOAT128_ASINH(boost::math::cstdfloat::detail::float_internal128_t x)555 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ASINH(boost::math::cstdfloat::detail::float_internal128_t x) throw()
556 {
557 // Patch the asinh() function since quadmath does not have it.
558 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
559 return ::BOOST_CSTDFLOAT_FLOAT128_LOG(x + ::BOOST_CSTDFLOAT_FLOAT128_SQRT((x * x) + float_type(1)));
560 }
BOOST_CSTDFLOAT_FLOAT128_ACOSH(boost::math::cstdfloat::detail::float_internal128_t x)561 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ACOSH(boost::math::cstdfloat::detail::float_internal128_t x) throw()
562 {
563 // Patch the acosh() function since quadmath does not have it.
564 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
565 const float_type zp(x + float_type(1));
566 const float_type zm(x - float_type(1));
567
568 return ::BOOST_CSTDFLOAT_FLOAT128_LOG(x + (zp * ::BOOST_CSTDFLOAT_FLOAT128_SQRT(zm / zp)));
569 }
BOOST_CSTDFLOAT_FLOAT128_ATANH(boost::math::cstdfloat::detail::float_internal128_t x)570 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_ATANH(boost::math::cstdfloat::detail::float_internal128_t x) throw()
571 {
572 // Patch the atanh() function since quadmath does not have it.
573 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
574 return (::BOOST_CSTDFLOAT_FLOAT128_LOG(float_type(1) + x)
575 - ::BOOST_CSTDFLOAT_FLOAT128_LOG(float_type(1) - x)) / 2;
576 }
BOOST_CSTDFLOAT_FLOAT128_TGAMMA(boost::math::cstdfloat::detail::float_internal128_t x)577 inline boost::math::cstdfloat::detail::float_internal128_t BOOST_CSTDFLOAT_FLOAT128_TGAMMA(boost::math::cstdfloat::detail::float_internal128_t x) throw()
578 {
579 // Patch the tgammaq() function for a subset of broken GCC compilers
580 // like GCC 4.7, 4.8 on MinGW.
581 typedef boost::math::cstdfloat::detail::float_internal128_t float_type;
582
583 if (x > float_type(0))
584 {
585 return ::BOOST_CSTDFLOAT_FLOAT128_EXP(::BOOST_CSTDFLOAT_FLOAT128_LGAMMA(x));
586 }
587 else if (x < float_type(0))
588 {
589 // For x < 0, compute tgamma(-x) and use the reflection formula.
590 const float_type positive_x = -x;
591 float_type gamma_value = ::BOOST_CSTDFLOAT_FLOAT128_TGAMMA(positive_x);
592 const float_type floor_of_positive_x = ::BOOST_CSTDFLOAT_FLOAT128_FLOOR(positive_x);
593
594 // Take the reflection checks (slightly adapted) from <boost/math/gamma.hpp>.
595 const bool floor_of_z_is_equal_to_z = (positive_x == ::BOOST_CSTDFLOAT_FLOAT128_FLOOR(positive_x));
596
597 BOOST_CONSTEXPR_OR_CONST float_type my_pi = BOOST_FLOAT128_C(3.14159265358979323846264338327950288419716939937511);
598
599 if (floor_of_z_is_equal_to_z)
600 {
601 const bool is_odd = ((boost::int32_t(floor_of_positive_x) % boost::int32_t(2)) != boost::int32_t(0));
602
603 return (is_odd ? -std::numeric_limits<float_type>::infinity()
604 : +std::numeric_limits<float_type>::infinity());
605 }
606
607 const float_type sinpx_value = x * ::BOOST_CSTDFLOAT_FLOAT128_SIN(my_pi * x);
608
609 gamma_value *= sinpx_value;
610
611 const bool result_is_too_large_to_represent = ((::BOOST_CSTDFLOAT_FLOAT128_FABS(gamma_value) < float_type(1))
612 && (((std::numeric_limits<float_type>::max)() * ::BOOST_CSTDFLOAT_FLOAT128_FABS(gamma_value)) < my_pi));
613
614 if (result_is_too_large_to_represent)
615 {
616 const bool is_odd = ((boost::int32_t(floor_of_positive_x) % boost::int32_t(2)) != boost::int32_t(0));
617
618 return (is_odd ? -std::numeric_limits<float_type>::infinity()
619 : +std::numeric_limits<float_type>::infinity());
620 }
621
622 gamma_value = -my_pi / gamma_value;
623
624 if ((gamma_value > float_type(0)) || (gamma_value < float_type(0)))
625 {
626 return gamma_value;
627 }
628 else
629 {
630 // The value of gamma is too small to represent. Return 0.0 here.
631 return float_type(0);
632 }
633 }
634 else
635 {
636 // Gamma of zero is complex infinity. Return NaN here.
637 return std::numeric_limits<float_type>::quiet_NaN();
638 }
639 }
640 #endif // BOOST_CSTDFLOAT_BROKEN_FLOAT128_MATH_FUNCTIONS
641
642 // Define the quadruple-precision <cmath> functions in the namespace boost::math::cstdfloat::detail.
643
644 namespace boost {
645 namespace math {
646 namespace cstdfloat {
647 namespace detail {
ldexp(boost::math::cstdfloat::detail::float_internal128_t x,int n)648 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); }
frexp(boost::math::cstdfloat::detail::float_internal128_t x,int * pn)649 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); }
fabs(boost::math::cstdfloat::detail::float_internal128_t x)650 inline boost::math::cstdfloat::detail::float_internal128_t fabs(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_FABS(x); }
abs(boost::math::cstdfloat::detail::float_internal128_t x)651 inline boost::math::cstdfloat::detail::float_internal128_t abs(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_FABS(x); }
floor(boost::math::cstdfloat::detail::float_internal128_t x)652 inline boost::math::cstdfloat::detail::float_internal128_t floor(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_FLOOR(x); }
ceil(boost::math::cstdfloat::detail::float_internal128_t x)653 inline boost::math::cstdfloat::detail::float_internal128_t ceil(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_CEIL(x); }
sqrt(boost::math::cstdfloat::detail::float_internal128_t x)654 inline boost::math::cstdfloat::detail::float_internal128_t sqrt(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_SQRT(x); }
trunc(boost::math::cstdfloat::detail::float_internal128_t x)655 inline boost::math::cstdfloat::detail::float_internal128_t trunc(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_TRUNC(x); }
exp(boost::math::cstdfloat::detail::float_internal128_t x)656 inline boost::math::cstdfloat::detail::float_internal128_t exp(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_EXP(x); }
expm1(boost::math::cstdfloat::detail::float_internal128_t x)657 inline boost::math::cstdfloat::detail::float_internal128_t expm1(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_EXPM1(x); }
pow(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t a)658 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); }
pow(boost::math::cstdfloat::detail::float_internal128_t x,int a)659 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)); }
log(boost::math::cstdfloat::detail::float_internal128_t x)660 inline boost::math::cstdfloat::detail::float_internal128_t log(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOG(x); }
log10(boost::math::cstdfloat::detail::float_internal128_t x)661 inline boost::math::cstdfloat::detail::float_internal128_t log10(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOG10(x); }
sin(boost::math::cstdfloat::detail::float_internal128_t x)662 inline boost::math::cstdfloat::detail::float_internal128_t sin(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_SIN(x); }
cos(boost::math::cstdfloat::detail::float_internal128_t x)663 inline boost::math::cstdfloat::detail::float_internal128_t cos(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_COS(x); }
tan(boost::math::cstdfloat::detail::float_internal128_t x)664 inline boost::math::cstdfloat::detail::float_internal128_t tan(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_TAN(x); }
asin(boost::math::cstdfloat::detail::float_internal128_t x)665 inline boost::math::cstdfloat::detail::float_internal128_t asin(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ASIN(x); }
acos(boost::math::cstdfloat::detail::float_internal128_t x)666 inline boost::math::cstdfloat::detail::float_internal128_t acos(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ACOS(x); }
atan(boost::math::cstdfloat::detail::float_internal128_t x)667 inline boost::math::cstdfloat::detail::float_internal128_t atan(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ATAN(x); }
sinh(boost::math::cstdfloat::detail::float_internal128_t x)668 inline boost::math::cstdfloat::detail::float_internal128_t sinh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_SINH(x); }
cosh(boost::math::cstdfloat::detail::float_internal128_t x)669 inline boost::math::cstdfloat::detail::float_internal128_t cosh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_COSH(x); }
tanh(boost::math::cstdfloat::detail::float_internal128_t x)670 inline boost::math::cstdfloat::detail::float_internal128_t tanh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_TANH(x); }
asinh(boost::math::cstdfloat::detail::float_internal128_t x)671 inline boost::math::cstdfloat::detail::float_internal128_t asinh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ASINH(x); }
acosh(boost::math::cstdfloat::detail::float_internal128_t x)672 inline boost::math::cstdfloat::detail::float_internal128_t acosh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ACOSH(x); }
atanh(boost::math::cstdfloat::detail::float_internal128_t x)673 inline boost::math::cstdfloat::detail::float_internal128_t atanh(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ATANH(x); }
fmod(boost::math::cstdfloat::detail::float_internal128_t a,boost::math::cstdfloat::detail::float_internal128_t b)674 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); }
atan2(boost::math::cstdfloat::detail::float_internal128_t y,boost::math::cstdfloat::detail::float_internal128_t x)675 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); }
lgamma(boost::math::cstdfloat::detail::float_internal128_t x)676 inline boost::math::cstdfloat::detail::float_internal128_t lgamma(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LGAMMA(x); }
tgamma(boost::math::cstdfloat::detail::float_internal128_t x)677 inline boost::math::cstdfloat::detail::float_internal128_t tgamma(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_TGAMMA(x); }
678 // begin more functions
remainder(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)679 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); }
remquo(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y,int * z)680 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); }
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)681 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); }
682
fmax(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)683 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); }
684 template <class T>
685 inline typename boost::enable_if_c<
686 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
687 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
fmax(boost::math::cstdfloat::detail::float_internal128_t x,T y)688 fmax(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMAX(x, y); }
689 template <class T>
690 inline typename boost::enable_if_c<
691 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
692 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
fmax(T x,boost::math::cstdfloat::detail::float_internal128_t y)693 fmax(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMAX(x, y); }
fmin(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)694 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); }
695 template <class T>
696 inline typename boost::enable_if_c<
697 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
698 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
fmin(boost::math::cstdfloat::detail::float_internal128_t x,T y)699 fmin(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMIN(x, y); }
700 template <class T>
701 inline typename boost::enable_if_c<
702 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
703 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
fmin(T x,boost::math::cstdfloat::detail::float_internal128_t y)704 fmin(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_FMIN(x, y); }
705
fdim(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)706 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); }
nanq(const char * x)707 inline boost::math::cstdfloat::detail::float_internal128_t nanq(const char* x) { return ::BOOST_CSTDFLOAT_FLOAT128_NAN(x); }
exp2(boost::math::cstdfloat::detail::float_internal128_t x)708 inline boost::math::cstdfloat::detail::float_internal128_t exp2(boost::math::cstdfloat::detail::float_internal128_t x)
709 {
710 return ::BOOST_CSTDFLOAT_FLOAT128_POW(boost::math::cstdfloat::detail::float_internal128_t(2), x);
711 }
log2(boost::math::cstdfloat::detail::float_internal128_t x)712 inline boost::math::cstdfloat::detail::float_internal128_t log2(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOG2(x); }
log1p(boost::math::cstdfloat::detail::float_internal128_t x)713 inline boost::math::cstdfloat::detail::float_internal128_t log1p(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOG1P(x); }
cbrt(boost::math::cstdfloat::detail::float_internal128_t x)714 inline boost::math::cstdfloat::detail::float_internal128_t cbrt(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_CBRT(x); }
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)715 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); }
hypot(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)716 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); }
717 template <class T>
718 inline typename boost::enable_if_c<
719 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
720 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
hypot(boost::math::cstdfloat::detail::float_internal128_t x,T y)721 hypot(boost::math::cstdfloat::detail::float_internal128_t x, T y) { return ::BOOST_CSTDFLOAT_FLOAT128_HYPOT(x, y); }
722 template <class T>
723 inline typename boost::enable_if_c<
724 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
725 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
hypot(T x,boost::math::cstdfloat::detail::float_internal128_t y)726 hypot(T x, boost::math::cstdfloat::detail::float_internal128_t y) { return ::BOOST_CSTDFLOAT_FLOAT128_HYPOT(x, y); }
727
728
erf(boost::math::cstdfloat::detail::float_internal128_t x)729 inline boost::math::cstdfloat::detail::float_internal128_t erf(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ERF(x); }
erfc(boost::math::cstdfloat::detail::float_internal128_t x)730 inline boost::math::cstdfloat::detail::float_internal128_t erfc(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ERFC(x); }
llround(boost::math::cstdfloat::detail::float_internal128_t x)731 inline long long int llround(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LLROUND(x); }
lround(boost::math::cstdfloat::detail::float_internal128_t x)732 inline long int lround(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LROUND(x); }
round(boost::math::cstdfloat::detail::float_internal128_t x)733 inline boost::math::cstdfloat::detail::float_internal128_t round(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ROUND(x); }
nearbyint(boost::math::cstdfloat::detail::float_internal128_t x)734 inline boost::math::cstdfloat::detail::float_internal128_t nearbyint(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_NEARBYINT(x); }
llrint(boost::math::cstdfloat::detail::float_internal128_t x)735 inline long long int llrint(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LLRINT(x); }
lrint(boost::math::cstdfloat::detail::float_internal128_t x)736 inline long int lrint(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LRINT(x); }
rint(boost::math::cstdfloat::detail::float_internal128_t x)737 inline boost::math::cstdfloat::detail::float_internal128_t rint(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_RINT(x); }
modf(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t * y)738 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); }
scalbln(boost::math::cstdfloat::detail::float_internal128_t x,long int y)739 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); }
scalbn(boost::math::cstdfloat::detail::float_internal128_t x,int y)740 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); }
ilogb(boost::math::cstdfloat::detail::float_internal128_t x)741 inline int ilogb(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ILOGB(x); }
logb(boost::math::cstdfloat::detail::float_internal128_t x)742 inline boost::math::cstdfloat::detail::float_internal128_t logb(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_LOGB(x); }
nextafter(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)743 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); }
nexttoward(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)744 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)); }
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)745 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); }
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)746 inline bool signbit BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_SIGNBIT(x); }
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)747 inline int fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)
748 {
749 if (::BOOST_CSTDFLOAT_FLOAT128_ISNAN(x))
750 return FP_NAN;
751 else if (::BOOST_CSTDFLOAT_FLOAT128_ISINF(x))
752 return FP_INFINITE;
753 else if (x == BOOST_FLOAT128_C(0.0))
754 return FP_ZERO;
755
756 if (::BOOST_CSTDFLOAT_FLOAT128_FABS(x) < BOOST_CSTDFLOAT_FLOAT128_MIN)
757 return FP_SUBNORMAL;
758 else
759 return FP_NORMAL;
760 }
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)761 inline bool isfinite BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)
762 {
763 return !::BOOST_CSTDFLOAT_FLOAT128_ISNAN(x) && !::BOOST_CSTDFLOAT_FLOAT128_ISINF(x);
764 }
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)765 inline bool isinf BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ISINF(x); }
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)766 inline bool isnan BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x) { return ::BOOST_CSTDFLOAT_FLOAT128_ISNAN(x); }
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x)767 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; }
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)768 inline bool isgreater BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
769 {
770 if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
771 return false;
772 return x > y;
773 }
774 template <class T>
775 inline typename boost::enable_if_c<
776 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
777 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,T y)778 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); }
779 template <class T>
780 inline typename boost::enable_if_c<
781 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
782 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(T x,boost::math::cstdfloat::detail::float_internal128_t y)783 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); }
784
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)785 inline bool isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
786 {
787 if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
788 return false;
789 return x >= y;
790 }
791 template <class T>
792 inline typename boost::enable_if_c<
793 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
794 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,T y)795 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); }
796 template <class T>
797 inline typename boost::enable_if_c<
798 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
799 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(T x,boost::math::cstdfloat::detail::float_internal128_t y)800 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); }
801
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)802 inline bool isless BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
803 {
804 if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
805 return false;
806 return x < y;
807 }
808 template <class T>
809 inline typename boost::enable_if_c<
810 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
811 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,T y)812 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); }
813 template <class T>
814 inline typename boost::enable_if_c<
815 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
816 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(T x,boost::math::cstdfloat::detail::float_internal128_t y)817 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); }
818
819
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)820 inline bool islessequal BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
821 {
822 if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
823 return false;
824 return x <= y;
825 }
826 template <class T>
827 inline typename boost::enable_if_c<
828 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
829 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,T y)830 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); }
831 template <class T>
832 inline typename boost::enable_if_c<
833 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
834 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(T x,boost::math::cstdfloat::detail::float_internal128_t y)835 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); }
836
837
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)838 inline bool islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x, boost::math::cstdfloat::detail::float_internal128_t y)
839 {
840 if (isnan BOOST_PREVENT_MACRO_SUBSTITUTION(x) || isnan BOOST_PREVENT_MACRO_SUBSTITUTION(y))
841 return false;
842 return (x < y) || (x > y);
843 }
844 template <class T>
845 inline typename boost::enable_if_c<
846 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
847 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,T y)848 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); }
849 template <class T>
850 inline typename boost::enable_if_c<
851 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
852 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(T x,boost::math::cstdfloat::detail::float_internal128_t y)853 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); }
854
855
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,boost::math::cstdfloat::detail::float_internal128_t y)856 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); }
857 template <class T>
858 inline typename boost::enable_if_c<
859 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
860 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(boost::math::cstdfloat::detail::float_internal128_t x,T y)861 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); }
862 template <class T>
863 inline typename boost::enable_if_c<
864 boost::is_convertible<T, boost::math::cstdfloat::detail::float_internal128_t>::value
865 && !boost::is_same<T, boost::math::cstdfloat::detail::float_internal128_t>::value, boost::math::cstdfloat::detail::float_internal128_t>::type
BOOST_PREVENT_MACRO_SUBSTITUTION(T x,boost::math::cstdfloat::detail::float_internal128_t y)866 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); }
867
868
869 // end more functions
870 }
871 }
872 }
873 } // boost::math::cstdfloat::detail
874
875 // We will now inject the quadruple-precision <cmath> functions
876 // into the std namespace. This is done via *using* directive.
877 namespace std
878 {
879 using boost::math::cstdfloat::detail::ldexp;
880 using boost::math::cstdfloat::detail::frexp;
881 using boost::math::cstdfloat::detail::fabs;
882
883 #if !(defined(_GLIBCXX_USE_FLOAT128) && defined(__GNUC__) && (__GNUC__ >= 7))
884 using boost::math::cstdfloat::detail::abs;
885 #endif
886
887 using boost::math::cstdfloat::detail::floor;
888 using boost::math::cstdfloat::detail::ceil;
889 using boost::math::cstdfloat::detail::sqrt;
890 using boost::math::cstdfloat::detail::trunc;
891 using boost::math::cstdfloat::detail::exp;
892 using boost::math::cstdfloat::detail::expm1;
893 using boost::math::cstdfloat::detail::pow;
894 using boost::math::cstdfloat::detail::log;
895 using boost::math::cstdfloat::detail::log10;
896 using boost::math::cstdfloat::detail::sin;
897 using boost::math::cstdfloat::detail::cos;
898 using boost::math::cstdfloat::detail::tan;
899 using boost::math::cstdfloat::detail::asin;
900 using boost::math::cstdfloat::detail::acos;
901 using boost::math::cstdfloat::detail::atan;
902 using boost::math::cstdfloat::detail::sinh;
903 using boost::math::cstdfloat::detail::cosh;
904 using boost::math::cstdfloat::detail::tanh;
905 using boost::math::cstdfloat::detail::asinh;
906 using boost::math::cstdfloat::detail::acosh;
907 using boost::math::cstdfloat::detail::atanh;
908 using boost::math::cstdfloat::detail::fmod;
909 using boost::math::cstdfloat::detail::atan2;
910 using boost::math::cstdfloat::detail::lgamma;
911 using boost::math::cstdfloat::detail::tgamma;
912
913 // begin more functions
914 using boost::math::cstdfloat::detail::remainder;
915 using boost::math::cstdfloat::detail::remquo;
916 using boost::math::cstdfloat::detail::fma;
917 using boost::math::cstdfloat::detail::fmax;
918 using boost::math::cstdfloat::detail::fmin;
919 using boost::math::cstdfloat::detail::fdim;
920 using boost::math::cstdfloat::detail::nanq;
921 using boost::math::cstdfloat::detail::exp2;
922 using boost::math::cstdfloat::detail::log2;
923 using boost::math::cstdfloat::detail::log1p;
924 using boost::math::cstdfloat::detail::cbrt;
925 using boost::math::cstdfloat::detail::hypot;
926 using boost::math::cstdfloat::detail::erf;
927 using boost::math::cstdfloat::detail::erfc;
928 using boost::math::cstdfloat::detail::llround;
929 using boost::math::cstdfloat::detail::lround;
930 using boost::math::cstdfloat::detail::round;
931 using boost::math::cstdfloat::detail::nearbyint;
932 using boost::math::cstdfloat::detail::llrint;
933 using boost::math::cstdfloat::detail::lrint;
934 using boost::math::cstdfloat::detail::rint;
935 using boost::math::cstdfloat::detail::modf;
936 using boost::math::cstdfloat::detail::scalbln;
937 using boost::math::cstdfloat::detail::scalbn;
938 using boost::math::cstdfloat::detail::ilogb;
939 using boost::math::cstdfloat::detail::logb;
940 using boost::math::cstdfloat::detail::nextafter;
941 using boost::math::cstdfloat::detail::nexttoward;
942 using boost::math::cstdfloat::detail::copysign;
943 using boost::math::cstdfloat::detail::signbit;
944 using boost::math::cstdfloat::detail::fpclassify;
945 using boost::math::cstdfloat::detail::isfinite;
946 using boost::math::cstdfloat::detail::isinf;
947 using boost::math::cstdfloat::detail::isnan;
948 using boost::math::cstdfloat::detail::isnormal;
949 using boost::math::cstdfloat::detail::isgreater;
950 using boost::math::cstdfloat::detail::isgreaterequal;
951 using boost::math::cstdfloat::detail::isless;
952 using boost::math::cstdfloat::detail::islessequal;
953 using boost::math::cstdfloat::detail::islessgreater;
954 using boost::math::cstdfloat::detail::isunordered;
955 // end more functions
956
957 //
958 // Very basic iostream operator:
959 //
operator <<(std::ostream & os,__float128 m_value)960 inline std::ostream& operator << (std::ostream& os, __float128 m_value)
961 {
962 std::streamsize digits = os.precision();
963 std::ios_base::fmtflags f = os.flags();
964 std::string s;
965
966 char buf[100];
967 boost::scoped_array<char> buf2;
968 std::string format = "%";
969 if (f & std::ios_base::showpos)
970 format += "+";
971 if (f & std::ios_base::showpoint)
972 format += "#";
973 format += ".*";
974 if (digits == 0)
975 digits = 36;
976 format += "Q";
977 if (f & std::ios_base::scientific)
978 format += "e";
979 else if (f & std::ios_base::fixed)
980 format += "f";
981 else
982 format += "g";
983
984 int v = quadmath_snprintf(buf, 100, format.c_str(), digits, m_value);
985
986 if ((v < 0) || (v >= 99))
987 {
988 int v_max = v;
989 buf2.reset(new char[v + 3]);
990 v = quadmath_snprintf(&buf2[0], v_max + 3, format.c_str(), digits, m_value);
991 if (v >= v_max + 3)
992 {
993 BOOST_THROW_EXCEPTION(std::runtime_error("Formatting of float128_type failed."));
994 }
995 s = &buf2[0];
996 }
997 else
998 s = buf;
999 std::streamsize ss = os.width();
1000 if (ss > static_cast<std::streamsize>(s.size()))
1001 {
1002 char fill = os.fill();
1003 if ((os.flags() & std::ios_base::left) == std::ios_base::left)
1004 s.append(static_cast<std::string::size_type>(ss - s.size()), fill);
1005 else
1006 s.insert(static_cast<std::string::size_type>(0), static_cast<std::string::size_type>(ss - s.size()), fill);
1007 }
1008
1009 return os << s;
1010 }
1011
1012
1013 } // namespace std
1014
1015 // We will now remove the preprocessor symbols representing quadruple-precision <cmath>
1016 // functions from the preprocessor.
1017
1018 #undef BOOST_CSTDFLOAT_FLOAT128_LDEXP
1019 #undef BOOST_CSTDFLOAT_FLOAT128_FREXP
1020 #undef BOOST_CSTDFLOAT_FLOAT128_FABS
1021 #undef BOOST_CSTDFLOAT_FLOAT128_FLOOR
1022 #undef BOOST_CSTDFLOAT_FLOAT128_CEIL
1023 #undef BOOST_CSTDFLOAT_FLOAT128_SQRT
1024 #undef BOOST_CSTDFLOAT_FLOAT128_TRUNC
1025 #undef BOOST_CSTDFLOAT_FLOAT128_EXP
1026 #undef BOOST_CSTDFLOAT_FLOAT128_EXPM1
1027 #undef BOOST_CSTDFLOAT_FLOAT128_POW
1028 #undef BOOST_CSTDFLOAT_FLOAT128_LOG
1029 #undef BOOST_CSTDFLOAT_FLOAT128_LOG10
1030 #undef BOOST_CSTDFLOAT_FLOAT128_SIN
1031 #undef BOOST_CSTDFLOAT_FLOAT128_COS
1032 #undef BOOST_CSTDFLOAT_FLOAT128_TAN
1033 #undef BOOST_CSTDFLOAT_FLOAT128_ASIN
1034 #undef BOOST_CSTDFLOAT_FLOAT128_ACOS
1035 #undef BOOST_CSTDFLOAT_FLOAT128_ATAN
1036 #undef BOOST_CSTDFLOAT_FLOAT128_SINH
1037 #undef BOOST_CSTDFLOAT_FLOAT128_COSH
1038 #undef BOOST_CSTDFLOAT_FLOAT128_TANH
1039 #undef BOOST_CSTDFLOAT_FLOAT128_ASINH
1040 #undef BOOST_CSTDFLOAT_FLOAT128_ACOSH
1041 #undef BOOST_CSTDFLOAT_FLOAT128_ATANH
1042 #undef BOOST_CSTDFLOAT_FLOAT128_FMOD
1043 #undef BOOST_CSTDFLOAT_FLOAT128_ATAN2
1044 #undef BOOST_CSTDFLOAT_FLOAT128_LGAMMA
1045 #undef BOOST_CSTDFLOAT_FLOAT128_TGAMMA
1046
1047 // begin more functions
1048 #undef BOOST_CSTDFLOAT_FLOAT128_REMAINDER
1049 #undef BOOST_CSTDFLOAT_FLOAT128_REMQUO
1050 #undef BOOST_CSTDFLOAT_FLOAT128_FMA
1051 #undef BOOST_CSTDFLOAT_FLOAT128_FMAX
1052 #undef BOOST_CSTDFLOAT_FLOAT128_FMIN
1053 #undef BOOST_CSTDFLOAT_FLOAT128_FDIM
1054 #undef BOOST_CSTDFLOAT_FLOAT128_NAN
1055 #undef BOOST_CSTDFLOAT_FLOAT128_EXP2
1056 #undef BOOST_CSTDFLOAT_FLOAT128_LOG2
1057 #undef BOOST_CSTDFLOAT_FLOAT128_LOG1P
1058 #undef BOOST_CSTDFLOAT_FLOAT128_CBRT
1059 #undef BOOST_CSTDFLOAT_FLOAT128_HYPOT
1060 #undef BOOST_CSTDFLOAT_FLOAT128_ERF
1061 #undef BOOST_CSTDFLOAT_FLOAT128_ERFC
1062 #undef BOOST_CSTDFLOAT_FLOAT128_LLROUND
1063 #undef BOOST_CSTDFLOAT_FLOAT128_LROUND
1064 #undef BOOST_CSTDFLOAT_FLOAT128_ROUND
1065 #undef BOOST_CSTDFLOAT_FLOAT128_NEARBYINT
1066 #undef BOOST_CSTDFLOAT_FLOAT128_LLRINT
1067 #undef BOOST_CSTDFLOAT_FLOAT128_LRINT
1068 #undef BOOST_CSTDFLOAT_FLOAT128_RINT
1069 #undef BOOST_CSTDFLOAT_FLOAT128_MODF
1070 #undef BOOST_CSTDFLOAT_FLOAT128_SCALBLN
1071 #undef BOOST_CSTDFLOAT_FLOAT128_SCALBN
1072 #undef BOOST_CSTDFLOAT_FLOAT128_ILOGB
1073 #undef BOOST_CSTDFLOAT_FLOAT128_LOGB
1074 #undef BOOST_CSTDFLOAT_FLOAT128_NEXTAFTER
1075 #undef BOOST_CSTDFLOAT_FLOAT128_NEXTTOWARD
1076 #undef BOOST_CSTDFLOAT_FLOAT128_COPYSIGN
1077 #undef BOOST_CSTDFLOAT_FLOAT128_SIGNBIT
1078 #undef BOOST_CSTDFLOAT_FLOAT128_FPCLASSIFY
1079 #undef BOOST_CSTDFLOAT_FLOAT128_ISFINITE
1080 #undef BOOST_CSTDFLOAT_FLOAT128_ISINF
1081 #undef BOOST_CSTDFLOAT_FLOAT128_ISNAN
1082 #undef BOOST_CSTDFLOAT_FLOAT128_ISNORMAL
1083 #undef BOOST_CSTDFLOAT_FLOAT128_ISGREATER
1084 #undef BOOST_CSTDFLOAT_FLOAT128_ISGREATEREQUAL
1085 #undef BOOST_CSTDFLOAT_FLOAT128_ISLESS
1086 #undef BOOST_CSTDFLOAT_FLOAT128_ISLESSEQUAL
1087 #undef BOOST_CSTDFLOAT_FLOAT128_ISLESSGREATER
1088 #undef BOOST_CSTDFLOAT_FLOAT128_ISUNORDERED
1089 // end more functions
1090
1091 #endif // Not BOOST_CSTDFLOAT_NO_LIBQUADMATH_SUPPORT (i.e., the user would like to have libquadmath support)
1092
1093 #endif // BOOST_MATH_CSTDFLOAT_CMATH_2014_02_15_HPP_
1094
1095