blob: 50316bd5e5231bcfab1e0c2277ea2fa4a01e98b1 [file] [log] [blame]
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001// -*- C++ -*-
2//===---------------------------- cmath -----------------------------------===//
3//
Howard Hinnantf5256e12010-05-11 21:36:01 +00004// The LLVM Compiler Infrastructure
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00005//
Howard Hinnantb64f8b02010-11-16 22:09:02 +00006// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00008//
9//===----------------------------------------------------------------------===//
10
11#ifndef _LIBCPP_CMATH
12#define _LIBCPP_CMATH
13
14/*
15 cmath synopsis
16
17Macros:
18
19 HUGE_VAL
20 HUGE_VALF // C99
21 HUGE_VALL // C99
22 INFINITY // C99
23 NAN // C99
24 FP_INFINITE // C99
25 FP_NAN // C99
26 FP_NORMAL // C99
27 FP_SUBNORMAL // C99
28 FP_ZERO // C99
29 FP_FAST_FMA // C99
30 FP_FAST_FMAF // C99
31 FP_FAST_FMAL // C99
32 FP_ILOGB0 // C99
33 FP_ILOGBNAN // C99
34 MATH_ERRNO // C99
35 MATH_ERREXCEPT // C99
36 math_errhandling // C99
37
38namespace std
39{
40
41Types:
42
43 float_t // C99
44 double_t // C99
45
46// C90
47
48floating_point abs(floating_point x);
49
50floating_point acos (arithmetic x);
51float acosf(float x);
52long double acosl(long double x);
53
54floating_point asin (arithmetic x);
55float asinf(float x);
56long double asinl(long double x);
57
58floating_point atan (arithmetic x);
59float atanf(float x);
60long double atanl(long double x);
61
62floating_point atan2 (arithmetic y, arithmetic x);
63float atan2f(float y, float x);
64long double atan2l(long double y, long double x);
65
66floating_point ceil (arithmetic x);
67float ceilf(float x);
68long double ceill(long double x);
69
70floating_point cos (arithmetic x);
71float cosf(float x);
72long double cosl(long double x);
73
74floating_point cosh (arithmetic x);
75float coshf(float x);
76long double coshl(long double x);
77
78floating_point exp (arithmetic x);
79float expf(float x);
80long double expl(long double x);
81
82floating_point fabs (arithmetic x);
83float fabsf(float x);
84long double fabsl(long double x);
85
86floating_point floor (arithmetic x);
87float floorf(float x);
88long double floorl(long double x);
89
90floating_point fmod (arithmetic x, arithmetic y);
91float fmodf(float x, float y);
92long double fmodl(long double x, long double y);
93
94floating_point frexp (arithmetic value, int* exp);
95float frexpf(float value, int* exp);
96long double frexpl(long double value, int* exp);
97
98floating_point ldexp (arithmetic value, int exp);
99float ldexpf(float value, int exp);
100long double ldexpl(long double value, int exp);
101
102floating_point log (arithmetic x);
103float logf(float x);
104long double logl(long double x);
105
106floating_point log10 (arithmetic x);
107float log10f(float x);
108long double log10l(long double x);
109
110floating_point modf (floating_point value, floating_point* iptr);
111float modff(float value, float* iptr);
112long double modfl(long double value, long double* iptr);
113
114floating_point pow (arithmetic x, arithmetic y);
115float powf(float x, float y);
116long double powl(long double x, long double y);
117
118floating_point sin (arithmetic x);
119float sinf(float x);
120long double sinl(long double x);
121
122floating_point sinh (arithmetic x);
123float sinhf(float x);
124long double sinhl(long double x);
125
126floating_point sqrt (arithmetic x);
127float sqrtf(float x);
128long double sqrtl(long double x);
129
130floating_point tan (arithmetic x);
131float tanf(float x);
132long double tanl(long double x);
133
134floating_point tanh (arithmetic x);
135float tanhf(float x);
136long double tanhl(long double x);
137
138// C99
139
140bool signbit(floating_point x);
141
142int fpclassify(floating_point x);
143
Howard Hinnant324bb032010-08-22 00:02:43 +0000144bool isfinite(floating_point x);
145bool isinf(floating_point x);
146bool isnan(floating_point x);
147bool isnormal(floating_point x);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000148
Howard Hinnant324bb032010-08-22 00:02:43 +0000149bool isgreater(floating_point x, floating_point y);
150bool isgreaterequal(floating_point x, floating_point y);
151bool isless(floating_point x, floating_point y);
152bool islessequal(floating_point x, floating_point y);
153bool islessgreater(floating_point x, floating_point y);
154bool isunordered(floating_point x, floating_point y);
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000155
156floating_point acosh (arithmetic x);
157float acoshf(float x);
158long double acoshl(long double x);
159
160floating_point asinh (arithmetic x);
161float asinhf(float x);
162long double asinhl(long double x);
163
164floating_point atanh (arithmetic x);
165float atanhf(float x);
166long double atanhl(long double x);
167
168floating_point cbrt (arithmetic x);
169float cbrtf(float x);
170long double cbrtl(long double x);
171
172floating_point copysign (arithmetic x, arithmetic y);
173float copysignf(float x, float y);
174long double copysignl(long double x, long double y);
175
176floating_point erf (arithmetic x);
177float erff(float x);
178long double erfl(long double x);
179
180floating_point erfc (arithmetic x);
181float erfcf(float x);
182long double erfcl(long double x);
183
184floating_point exp2 (arithmetic x);
185float exp2f(float x);
186long double exp2l(long double x);
187
188floating_point expm1 (arithmetic x);
189float expm1f(float x);
190long double expm1l(long double x);
191
192floating_point fdim (arithmetic x, arithmetic y);
193float fdimf(float x, float y);
194long double fdiml(long double x, long double y);
195
196floating_point fma (arithmetic x, arithmetic y, arithmetic z);
197float fmaf(float x, float y, float z);
198long double fmal(long double x, long double y, long double z);
199
200floating_point fmax (arithmetic x, arithmetic y);
201float fmaxf(float x, float y);
202long double fmaxl(long double x, long double y);
203
204floating_point fmin (arithmetic x, arithmetic y);
205float fminf(float x, float y);
206long double fminl(long double x, long double y);
207
208floating_point hypot (arithmetic x, arithmetic y);
209float hypotf(float x, float y);
210long double hypotl(long double x, long double y);
211
212int ilogb (arithmetic x);
213int ilogbf(float x);
214int ilogbl(long double x);
215
216floating_point lgamma (arithmetic x);
217float lgammaf(float x);
218long double lgammal(long double x);
219
220long long llrint (arithmetic x);
221long long llrintf(float x);
222long long llrintl(long double x);
223
224long long llround (arithmetic x);
225long long llroundf(float x);
226long long llroundl(long double x);
227
228floating_point log1p (arithmetic x);
229float log1pf(float x);
230long double log1pl(long double x);
231
232floating_point log2 (arithmetic x);
233float log2f(float x);
234long double log2l(long double x);
235
236floating_point logb (arithmetic x);
237float logbf(float x);
238long double logbl(long double x);
239
240long lrint (arithmetic x);
241long lrintf(float x);
242long lrintl(long double x);
243
244long lround (arithmetic x);
245long lroundf(float x);
246long lroundl(long double x);
247
248double nan (const char* str);
249float nanf(const char* str);
250long double nanl(const char* str);
251
252floating_point nearbyint (arithmetic x);
253float nearbyintf(float x);
254long double nearbyintl(long double x);
255
256floating_point nextafter (arithmetic x, arithmetic y);
257float nextafterf(float x, float y);
258long double nextafterl(long double x, long double y);
259
260floating_point nexttoward (arithmetic x, long double y);
261float nexttowardf(float x, long double y);
262long double nexttowardl(long double x, long double y);
263
264floating_point remainder (arithmetic x, arithmetic y);
265float remainderf(float x, float y);
266long double remainderl(long double x, long double y);
267
268floating_point remquo (arithmetic x, arithmetic y, int* pquo);
269float remquof(float x, float y, int* pquo);
270long double remquol(long double x, long double y, int* pquo);
271
272floating_point rint (arithmetic x);
273float rintf(float x);
274long double rintl(long double x);
275
276floating_point round (arithmetic x);
277float roundf(float x);
278long double roundl(long double x);
279
280floating_point scalbln (arithmetic x, long ex);
281float scalblnf(float x, long ex);
282long double scalblnl(long double x, long ex);
283
284floating_point scalbn (arithmetic x, int ex);
285float scalbnf(float x, int ex);
286long double scalbnl(long double x, int ex);
287
288floating_point tgamma (arithmetic x);
289float tgammaf(float x);
290long double tgammal(long double x);
291
292floating_point trunc (arithmetic x);
293float truncf(float x);
294long double truncl(long double x);
295
296} // std
297
298*/
299
300#include <__config>
301#include <math.h>
302#include <type_traits>
303
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000304#ifdef _MSC_VER
305#include "support/win32/math_win32.h"
306#endif
307
Howard Hinnant08e17472011-10-17 20:05:10 +0000308#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000309#pragma GCC system_header
Howard Hinnant08e17472011-10-17 20:05:10 +0000310#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000311
Howard Hinnant0a111112011-05-13 21:52:40 +0000312// signbit
313
314#ifdef signbit
315
316template <class _A1>
317_LIBCPP_ALWAYS_INLINE
318bool
319__libcpp_signbit(_A1 __x)
320{
321 return signbit(__x);
322}
323
324#undef signbit
325
326template <class _A1>
327inline _LIBCPP_INLINE_VISIBILITY
328typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
329signbit(_A1 __x)
330{
331 return __libcpp_signbit(__x);
332}
333
334#endif // signbit
335
336// fpclassify
337
338#ifdef fpclassify
339
340template <class _A1>
341_LIBCPP_ALWAYS_INLINE
342int
343__libcpp_fpclassify(_A1 __x)
344{
345 return fpclassify(__x);
346}
347
348#undef fpclassify
349
350template <class _A1>
351inline _LIBCPP_INLINE_VISIBILITY
352typename std::enable_if<std::is_floating_point<_A1>::value, int>::type
353fpclassify(_A1 __x)
354{
355 return __libcpp_fpclassify(__x);
356}
357
358#endif // fpclassify
359
360// isfinite
361
362#ifdef isfinite
363
364template <class _A1>
365_LIBCPP_ALWAYS_INLINE
366bool
367__libcpp_isfinite(_A1 __x)
368{
369 return isfinite(__x);
370}
371
372#undef isfinite
373
374template <class _A1>
375inline _LIBCPP_INLINE_VISIBILITY
376typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
377isfinite(_A1 __x)
378{
379 return __libcpp_isfinite(__x);
380}
381
382#endif // isfinite
383
384// isinf
385
386#ifdef isinf
387
388template <class _A1>
389_LIBCPP_ALWAYS_INLINE
390bool
391__libcpp_isinf(_A1 __x)
392{
393 return isinf(__x);
394}
395
396#undef isinf
397
398template <class _A1>
399inline _LIBCPP_INLINE_VISIBILITY
400typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
401isinf(_A1 __x)
402{
403 return __libcpp_isinf(__x);
404}
405
406#endif // isinf
407
408// isnan
409
410#ifdef isnan
411
412template <class _A1>
413_LIBCPP_ALWAYS_INLINE
414bool
415__libcpp_isnan(_A1 __x)
416{
417 return isnan(__x);
418}
419
420#undef isnan
421
422template <class _A1>
423inline _LIBCPP_INLINE_VISIBILITY
424typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
425isnan(_A1 __x)
426{
427 return __libcpp_isnan(__x);
428}
429
430#endif // isnan
431
432// isnormal
433
434#ifdef isnormal
435
436template <class _A1>
437_LIBCPP_ALWAYS_INLINE
438bool
439__libcpp_isnormal(_A1 __x)
440{
441 return isnormal(__x);
442}
443
444#undef isnormal
445
446template <class _A1>
447inline _LIBCPP_INLINE_VISIBILITY
448typename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
449isnormal(_A1 __x)
450{
451 return __libcpp_isnormal(__x);
452}
453
454#endif // isnormal
455
456// isgreater
457
458#ifdef isgreater
459
460template <class _A1, class _A2>
461_LIBCPP_ALWAYS_INLINE
462bool
463__libcpp_isgreater(_A1 __x, _A2 __y)
464{
465 return isgreater(__x, __y);
466}
467
468#undef isgreater
469
470template <class _A1, class _A2>
471inline _LIBCPP_INLINE_VISIBILITY
472typename std::enable_if
473<
474 std::is_floating_point<_A1>::value &&
475 std::is_floating_point<_A2>::value,
476 bool
477>::type
478isgreater(_A1 __x, _A2 __y)
479{
480 return __libcpp_isgreater(__x, __y);
481}
482
483#endif // isgreater
484
485// isgreaterequal
486
487#ifdef isgreaterequal
488
489template <class _A1, class _A2>
490_LIBCPP_ALWAYS_INLINE
491bool
492__libcpp_isgreaterequal(_A1 __x, _A2 __y)
493{
494 return isgreaterequal(__x, __y);
495}
496
497#undef isgreaterequal
498
499template <class _A1, class _A2>
500inline _LIBCPP_INLINE_VISIBILITY
501typename std::enable_if
502<
503 std::is_floating_point<_A1>::value &&
504 std::is_floating_point<_A2>::value,
505 bool
506>::type
507isgreaterequal(_A1 __x, _A2 __y)
508{
509 return __libcpp_isgreaterequal(__x, __y);
510}
511
512#endif // isgreaterequal
513
514// isless
515
516#ifdef isless
517
518template <class _A1, class _A2>
519_LIBCPP_ALWAYS_INLINE
520bool
521__libcpp_isless(_A1 __x, _A2 __y)
522{
523 return isless(__x, __y);
524}
525
526#undef isless
527
528template <class _A1, class _A2>
529inline _LIBCPP_INLINE_VISIBILITY
530typename std::enable_if
531<
532 std::is_floating_point<_A1>::value &&
533 std::is_floating_point<_A2>::value,
534 bool
535>::type
536isless(_A1 __x, _A2 __y)
537{
538 return __libcpp_isless(__x, __y);
539}
540
541#endif // isless
542
543// islessequal
544
545#ifdef islessequal
546
547template <class _A1, class _A2>
548_LIBCPP_ALWAYS_INLINE
549bool
550__libcpp_islessequal(_A1 __x, _A2 __y)
551{
552 return islessequal(__x, __y);
553}
554
555#undef islessequal
556
557template <class _A1, class _A2>
558inline _LIBCPP_INLINE_VISIBILITY
559typename std::enable_if
560<
561 std::is_floating_point<_A1>::value &&
562 std::is_floating_point<_A2>::value,
563 bool
564>::type
565islessequal(_A1 __x, _A2 __y)
566{
567 return __libcpp_islessequal(__x, __y);
568}
569
570#endif // islessequal
571
572// islessgreater
573
574#ifdef islessgreater
575
576template <class _A1, class _A2>
577_LIBCPP_ALWAYS_INLINE
578bool
579__libcpp_islessgreater(_A1 __x, _A2 __y)
580{
581 return islessgreater(__x, __y);
582}
583
584#undef islessgreater
585
586template <class _A1, class _A2>
587inline _LIBCPP_INLINE_VISIBILITY
588typename std::enable_if
589<
590 std::is_floating_point<_A1>::value &&
591 std::is_floating_point<_A2>::value,
592 bool
593>::type
594islessgreater(_A1 __x, _A2 __y)
595{
596 return __libcpp_islessgreater(__x, __y);
597}
598
599#endif // islessgreater
600
601// isunordered
602
603#ifdef isunordered
604
605template <class _A1, class _A2>
606_LIBCPP_ALWAYS_INLINE
607bool
608__libcpp_isunordered(_A1 __x, _A2 __y)
609{
610 return isunordered(__x, __y);
611}
612
613#undef isunordered
614
615template <class _A1, class _A2>
616inline _LIBCPP_INLINE_VISIBILITY
617typename std::enable_if
618<
619 std::is_floating_point<_A1>::value &&
620 std::is_floating_point<_A2>::value,
621 bool
622>::type
623isunordered(_A1 __x, _A2 __y)
624{
625 return __libcpp_isunordered(__x, __y);
626}
627
628#endif // isunordered
629
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000630_LIBCPP_BEGIN_NAMESPACE_STD
631
Howard Hinnant0a111112011-05-13 21:52:40 +0000632using ::signbit;
633using ::fpclassify;
634using ::isfinite;
635using ::isinf;
636using ::isnan;
637using ::isnormal;
638using ::isgreater;
639using ::isgreaterequal;
640using ::isless;
641using ::islessequal;
642using ::islessgreater;
643using ::isunordered;
644using ::isunordered;
645
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000646using ::float_t;
647using ::double_t;
648
David Chisnall997e4542012-02-29 13:05:08 +0000649#ifndef __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000650// abs
651
David Chisnall997e4542012-02-29 13:05:08 +0000652#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000653template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000654inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000655typename enable_if<is_floating_point<_A1>::value, _A1>::type
656abs(_A1 __x) {return fabs(__x);}
657
David Chisnall997e4542012-02-29 13:05:08 +0000658#ifndef __sun__
659
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000660// acos
661
662using ::acos;
663using ::acosf;
664
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000665#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000666inline _LIBCPP_INLINE_VISIBILITY float acos(float __x) {return acosf(__x);}
667inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) {return acosl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000668#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000669
670template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000671inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000672typename enable_if<is_integral<_A1>::value, double>::type
673acos(_A1 __x) {return acos((double)__x);}
674
675// asin
676
677using ::asin;
678using ::asinf;
679
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000680#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000681inline _LIBCPP_INLINE_VISIBILITY float asin(float __x) {return asinf(__x);}
682inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) {return asinl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000683#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000684
685template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000686inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000687typename enable_if<is_integral<_A1>::value, double>::type
688asin(_A1 __x) {return asin((double)__x);}
689
690// atan
691
692using ::atan;
693using ::atanf;
694
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000695#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000696inline _LIBCPP_INLINE_VISIBILITY float atan(float __x) {return atanf(__x);}
697inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) {return atanl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000698#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000699
700template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000701inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000702typename enable_if<is_integral<_A1>::value, double>::type
703atan(_A1 __x) {return atan((double)__x);}
704
705// atan2
706
707using ::atan2;
708using ::atan2f;
709
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000710#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000711inline _LIBCPP_INLINE_VISIBILITY float atan2(float __y, float __x) {return atan2f(__y, __x);}
712inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) {return atan2l(__y, __x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000713#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000714
715template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000716inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000717typename enable_if
718<
719 is_arithmetic<_A1>::value &&
720 is_arithmetic<_A2>::value,
721 typename __promote<_A1, _A2>::type
722>::type
723atan2(_A1 __y, _A2 __x)
724{
725 typedef typename __promote<_A1, _A2>::type __result_type;
726 static_assert((!(is_same<_A1, __result_type>::value &&
727 is_same<_A2, __result_type>::value)), "");
728 return atan2((__result_type)__y, (__result_type)__x);
729}
730
731// ceil
732
733using ::ceil;
734using ::ceilf;
735
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000736#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000737inline _LIBCPP_INLINE_VISIBILITY float ceil(float __x) {return ceilf(__x);}
738inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) {return ceill(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000739#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000740
741template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000742inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000743typename enable_if<is_integral<_A1>::value, double>::type
744ceil(_A1 __x) {return ceil((double)__x);}
745
746// cos
747
748using ::cos;
749using ::cosf;
750
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000751#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000752inline _LIBCPP_INLINE_VISIBILITY float cos(float __x) {return cosf(__x);}
753inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) {return cosl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000754#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000755
756template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000757inline _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000758typename enable_if<is_integral<_A1>::value, double>::type
759cos(_A1 __x) {return cos((double)__x);}
760
761// cosh
762
763using ::cosh;
764using ::coshf;
765
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000766#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000767inline _LIBCPP_INLINE_VISIBILITY float cosh(float __x) {return coshf(__x);}
768inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) {return coshl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000769#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000770
771template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000772inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000773typename enable_if<is_integral<_A1>::value, double>::type
774cosh(_A1 __x) {return cosh((double)__x);}
775
David Chisnall997e4542012-02-29 13:05:08 +0000776#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000777// exp
778
779using ::exp;
780using ::expf;
781
David Chisnall997e4542012-02-29 13:05:08 +0000782#ifndef __sun__
783
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000784#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000785inline _LIBCPP_INLINE_VISIBILITY float exp(float __x) {return expf(__x);}
786inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) {return expl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000787#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000788
David Chisnall997e4542012-02-29 13:05:08 +0000789
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000790template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000791inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000792typename enable_if<is_integral<_A1>::value, double>::type
793exp(_A1 __x) {return exp((double)__x);}
794
795// fabs
796
797using ::fabs;
798using ::fabsf;
799
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000800#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000801inline _LIBCPP_INLINE_VISIBILITY float fabs(float __x) {return fabsf(__x);}
802inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) {return fabsl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000803#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000804
805template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000806inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000807typename enable_if<is_integral<_A1>::value, double>::type
808fabs(_A1 __x) {return fabs((double)__x);}
809
810// floor
811
812using ::floor;
813using ::floorf;
814
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000815#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000816inline _LIBCPP_INLINE_VISIBILITY float floor(float __x) {return floorf(__x);}
817inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) {return floorl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000818#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000819
820template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000821inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000822typename enable_if<is_integral<_A1>::value, double>::type
823floor(_A1 __x) {return floor((double)__x);}
824
825// fmod
826
David Chisnall997e4542012-02-29 13:05:08 +0000827#endif //__sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000828using ::fmod;
829using ::fmodf;
David Chisnall997e4542012-02-29 13:05:08 +0000830#ifndef __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000831
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000832#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000833inline _LIBCPP_INLINE_VISIBILITY float fmod(float __x, float __y) {return fmodf(__x, __y);}
834inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) {return fmodl(__x, __y);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000835#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000836
837template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000838inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000839typename enable_if
840<
841 is_arithmetic<_A1>::value &&
842 is_arithmetic<_A2>::value,
843 typename __promote<_A1, _A2>::type
844>::type
845fmod(_A1 __x, _A2 __y)
846{
847 typedef typename __promote<_A1, _A2>::type __result_type;
848 static_assert((!(is_same<_A1, __result_type>::value &&
849 is_same<_A2, __result_type>::value)), "");
850 return fmod((__result_type)__x, (__result_type)__y);
851}
852
David Chisnall997e4542012-02-29 13:05:08 +0000853
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000854// frexp
855
856using ::frexp;
857using ::frexpf;
858
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000859#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000860inline _LIBCPP_INLINE_VISIBILITY float frexp(float __x, int* __e) {return frexpf(__x, __e);}
861inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) {return frexpl(__x, __e);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000862#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000863
864template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000865inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000866typename enable_if<is_integral<_A1>::value, double>::type
867frexp(_A1 __x, int* __e) {return frexp((double)__x, __e);}
868
869// ldexp
870
871using ::ldexp;
872using ::ldexpf;
873
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000874#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000875inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __x, int __e) {return ldexpf(__x, __e);}
876inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) {return ldexpl(__x, __e);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000877#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000878
879template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000880inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000881typename enable_if<is_integral<_A1>::value, double>::type
882ldexp(_A1 __x, int __e) {return ldexp((double)__x, __e);}
883
884// log
885
David Chisnall997e4542012-02-29 13:05:08 +0000886#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000887using ::log;
888using ::logf;
David Chisnall997e4542012-02-29 13:05:08 +0000889#ifndef __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000890
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000891#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000892inline _LIBCPP_INLINE_VISIBILITY float log(float __x) {return logf(__x);}
893inline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) {return logl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000894#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000895
896template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000897inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000898typename enable_if<is_integral<_A1>::value, double>::type
899log(_A1 __x) {return log((double)__x);}
900
David Chisnall997e4542012-02-29 13:05:08 +0000901
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000902// log10
903
904using ::log10;
905using ::log10f;
906
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000907#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000908inline _LIBCPP_INLINE_VISIBILITY float log10(float __x) {return log10f(__x);}
909inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) {return log10l(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000910#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000911
912template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000913inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000914typename enable_if<is_integral<_A1>::value, double>::type
915log10(_A1 __x) {return log10((double)__x);}
916
917// modf
918
919using ::modf;
920using ::modff;
921
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000922#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000923inline _LIBCPP_INLINE_VISIBILITY float modf(float __x, float* __y) {return modff(__x, __y);}
924inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) {return modfl(__x, __y);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000925#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000926
927// pow
928
David Chisnall997e4542012-02-29 13:05:08 +0000929#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000930using ::pow;
931using ::powf;
932
David Chisnall997e4542012-02-29 13:05:08 +0000933#ifndef __sun__
934
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000935#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000936inline _LIBCPP_INLINE_VISIBILITY float pow(float __x, float __y) {return powf(__x, __y);}
937inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) {return powl(__x, __y);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000938#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000939
940template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000941inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000942typename enable_if
943<
944 is_arithmetic<_A1>::value &&
945 is_arithmetic<_A2>::value,
946 typename __promote<_A1, _A2>::type
947>::type
948pow(_A1 __x, _A2 __y)
949{
950 typedef typename __promote<_A1, _A2>::type __result_type;
951 static_assert((!(is_same<_A1, __result_type>::value &&
952 is_same<_A2, __result_type>::value)), "");
953 return pow((__result_type)__x, (__result_type)__y);
954}
955
David Chisnall997e4542012-02-29 13:05:08 +0000956
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000957// sin
958
959using ::sin;
960using ::sinf;
961
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000962#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000963inline _LIBCPP_INLINE_VISIBILITY float sin(float __x) {return sinf(__x);}
964inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) {return sinl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000965#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000966
967template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000968inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000969typename enable_if<is_integral<_A1>::value, double>::type
970sin(_A1 __x) {return sin((double)__x);}
971
972// sinh
973
974using ::sinh;
975using ::sinhf;
976
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000977#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000978inline _LIBCPP_INLINE_VISIBILITY float sinh(float __x) {return sinhf(__x);}
979inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) {return sinhl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000980#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000981
982template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +0000983inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000984typename enable_if<is_integral<_A1>::value, double>::type
985sinh(_A1 __x) {return sinh((double)__x);}
986
987// sqrt
988
David Chisnall997e4542012-02-29 13:05:08 +0000989#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000990using ::sqrt;
991using ::sqrtf;
992
David Chisnall997e4542012-02-29 13:05:08 +0000993
994#if !(defined(_MSC_VER) || defined(__sun__))
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000995inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __x) {return sqrtf(__x);}
996inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) {return sqrtl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +0000997#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +0000998
999template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001000inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001001typename enable_if<is_integral<_A1>::value, double>::type
1002sqrt(_A1 __x) {return sqrt((double)__x);}
1003
David Chisnall997e4542012-02-29 13:05:08 +00001004#ifndef __sun__
1005
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001006// tan
1007
David Chisnall997e4542012-02-29 13:05:08 +00001008#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001009using ::tan;
1010using ::tanf;
David Chisnall997e4542012-02-29 13:05:08 +00001011#ifndef __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001012
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001013#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001014inline _LIBCPP_INLINE_VISIBILITY float tan(float __x) {return tanf(__x);}
1015inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) {return tanl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001016#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001017
1018template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001019inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001020typename enable_if<is_integral<_A1>::value, double>::type
1021tan(_A1 __x) {return tan((double)__x);}
1022
1023// tanh
1024
1025using ::tanh;
1026using ::tanhf;
1027
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001028#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001029inline _LIBCPP_INLINE_VISIBILITY float tanh(float __x) {return tanhf(__x);}
1030inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) {return tanhl(__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001031#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001032
1033template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001034inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001035typename enable_if<is_integral<_A1>::value, double>::type
1036tanh(_A1 __x) {return tanh((double)__x);}
1037
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001038// acosh
1039
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001040#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001041using ::acosh;
1042using ::acoshf;
1043
1044inline _LIBCPP_INLINE_VISIBILITY float acosh(float __x) {return acoshf(__x);}
1045inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) {return acoshl(__x);}
1046
1047template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001048inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001049typename enable_if<is_integral<_A1>::value, double>::type
1050acosh(_A1 __x) {return acosh((double)__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001051#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001052
1053// asinh
1054
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001055#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001056using ::asinh;
1057using ::asinhf;
1058
1059inline _LIBCPP_INLINE_VISIBILITY float asinh(float __x) {return asinhf(__x);}
1060inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) {return asinhl(__x);}
1061
1062template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001063inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001064typename enable_if<is_integral<_A1>::value, double>::type
1065asinh(_A1 __x) {return asinh((double)__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001066#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001067
1068// atanh
1069
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001070#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001071using ::atanh;
1072using ::atanhf;
1073
1074inline _LIBCPP_INLINE_VISIBILITY float atanh(float __x) {return atanhf(__x);}
1075inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) {return atanhl(__x);}
1076
1077template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001078inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001079typename enable_if<is_integral<_A1>::value, double>::type
1080atanh(_A1 __x) {return atanh((double)__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001081#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001082
1083// cbrt
1084
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001085#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001086using ::cbrt;
1087using ::cbrtf;
1088
1089inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __x) {return cbrtf(__x);}
1090inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) {return cbrtl(__x);}
1091
1092template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001093inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001094typename enable_if<is_integral<_A1>::value, double>::type
1095cbrt(_A1 __x) {return cbrt((double)__x);}
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001096#endif
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001097
1098// copysign
1099
1100using ::copysign;
1101using ::copysignf;
1102
1103inline _LIBCPP_INLINE_VISIBILITY float copysign(float __x, float __y) {return copysignf(__x, __y);}
1104inline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) {return copysignl(__x, __y);}
1105
1106template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001107inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001108typename enable_if
1109<
1110 is_arithmetic<_A1>::value &&
1111 is_arithmetic<_A2>::value,
1112 typename __promote<_A1, _A2>::type
1113>::type
1114copysign(_A1 __x, _A2 __y)
1115{
1116 typedef typename __promote<_A1, _A2>::type __result_type;
1117 static_assert((!(is_same<_A1, __result_type>::value &&
1118 is_same<_A2, __result_type>::value)), "");
1119 return copysign((__result_type)__x, (__result_type)__y);
1120}
1121
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001122#ifndef _MSC_VER
1123
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001124// erf
1125
1126using ::erf;
1127using ::erff;
1128
1129inline _LIBCPP_INLINE_VISIBILITY float erf(float __x) {return erff(__x);}
1130inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) {return erfl(__x);}
1131
1132template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001133inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001134typename enable_if<is_integral<_A1>::value, double>::type
1135erf(_A1 __x) {return erf((double)__x);}
1136
1137// erfc
1138
1139using ::erfc;
1140using ::erfcf;
1141
1142inline _LIBCPP_INLINE_VISIBILITY float erfc(float __x) {return erfcf(__x);}
1143inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) {return erfcl(__x);}
1144
1145template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001146inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001147typename enable_if<is_integral<_A1>::value, double>::type
1148erfc(_A1 __x) {return erfc((double)__x);}
1149
1150// exp2
1151
1152using ::exp2;
1153using ::exp2f;
1154
1155inline _LIBCPP_INLINE_VISIBILITY float exp2(float __x) {return exp2f(__x);}
1156inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) {return exp2l(__x);}
1157
1158template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001159inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001160typename enable_if<is_integral<_A1>::value, double>::type
1161exp2(_A1 __x) {return exp2((double)__x);}
1162
1163// expm1
1164
1165using ::expm1;
1166using ::expm1f;
1167
1168inline _LIBCPP_INLINE_VISIBILITY float expm1(float __x) {return expm1f(__x);}
1169inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) {return expm1l(__x);}
1170
1171template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001172inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001173typename enable_if<is_integral<_A1>::value, double>::type
1174expm1(_A1 __x) {return expm1((double)__x);}
1175
1176// fdim
1177
1178using ::fdim;
1179using ::fdimf;
1180
1181inline _LIBCPP_INLINE_VISIBILITY float fdim(float __x, float __y) {return fdimf(__x, __y);}
1182inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) {return fdiml(__x, __y);}
1183
1184template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001185inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001186typename enable_if
1187<
1188 is_arithmetic<_A1>::value &&
1189 is_arithmetic<_A2>::value,
1190 typename __promote<_A1, _A2>::type
1191>::type
1192fdim(_A1 __x, _A2 __y)
1193{
1194 typedef typename __promote<_A1, _A2>::type __result_type;
1195 static_assert((!(is_same<_A1, __result_type>::value &&
1196 is_same<_A2, __result_type>::value)), "");
1197 return fdim((__result_type)__x, (__result_type)__y);
1198}
1199
1200// fma
1201
1202inline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) {return (float)((double)__x*__y + __z);}
1203#define FP_FAST_FMAF
1204
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001205using ::fma;
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001206
1207inline _LIBCPP_INLINE_VISIBILITY float fma(float __x, float __y, float __z) {return fmaf(__x, __y, __z);}
1208inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) {return fmal(__x, __y, __z);}
1209
1210template <class _A1, class _A2, class _A3>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001211inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001212typename enable_if
1213<
1214 is_arithmetic<_A1>::value &&
1215 is_arithmetic<_A2>::value &&
1216 is_arithmetic<_A3>::value,
1217 typename __promote<_A1, _A2, _A3>::type
1218>::type
1219fma(_A1 __x, _A2 __y, _A3 __z)
1220{
1221 typedef typename __promote<_A1, _A2, _A3>::type __result_type;
1222 static_assert((!(is_same<_A1, __result_type>::value &&
1223 is_same<_A2, __result_type>::value &&
1224 is_same<_A3, __result_type>::value)), "");
1225 return fma((__result_type)__x, (__result_type)__y, (__result_type)__z);
1226}
1227
1228// fmax
1229
1230using ::fmax;
1231using ::fmaxf;
1232
1233inline _LIBCPP_INLINE_VISIBILITY float fmax(float __x, float __y) {return fmaxf(__x, __y);}
1234inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) {return fmaxl(__x, __y);}
1235
1236template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001237inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001238typename enable_if
1239<
1240 is_arithmetic<_A1>::value &&
1241 is_arithmetic<_A2>::value,
1242 typename __promote<_A1, _A2>::type
1243>::type
1244fmax(_A1 __x, _A2 __y)
1245{
1246 typedef typename __promote<_A1, _A2>::type __result_type;
1247 static_assert((!(is_same<_A1, __result_type>::value &&
1248 is_same<_A2, __result_type>::value)), "");
1249 return fmax((__result_type)__x, (__result_type)__y);
1250}
1251
1252// fmin
1253
1254using ::fmin;
1255using ::fminf;
1256
1257inline _LIBCPP_INLINE_VISIBILITY float fmin(float __x, float __y) {return fminf(__x, __y);}
1258inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) {return fminl(__x, __y);}
1259
1260template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001261inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001262typename enable_if
1263<
1264 is_arithmetic<_A1>::value &&
1265 is_arithmetic<_A2>::value,
1266 typename __promote<_A1, _A2>::type
1267>::type
1268fmin(_A1 __x, _A2 __y)
1269{
1270 typedef typename __promote<_A1, _A2>::type __result_type;
1271 static_assert((!(is_same<_A1, __result_type>::value &&
1272 is_same<_A2, __result_type>::value)), "");
1273 return fmin((__result_type)__x, (__result_type)__y);
1274}
1275
1276// hypot
1277
1278using ::hypot;
1279using ::hypotf;
1280
1281inline _LIBCPP_INLINE_VISIBILITY float hypot(float __x, float __y) {return hypotf(__x, __y);}
1282inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) {return hypotl(__x, __y);}
1283
1284template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001285inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001286typename enable_if
1287<
1288 is_arithmetic<_A1>::value &&
1289 is_arithmetic<_A2>::value,
1290 typename __promote<_A1, _A2>::type
1291>::type
1292hypot(_A1 __x, _A2 __y)
1293{
1294 typedef typename __promote<_A1, _A2>::type __result_type;
1295 static_assert((!(is_same<_A1, __result_type>::value &&
1296 is_same<_A2, __result_type>::value)), "");
1297 return hypot((__result_type)__x, (__result_type)__y);
1298}
1299
1300// ilogb
1301
1302using ::ilogb;
1303using ::ilogbf;
1304
1305inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x) {return ilogbf(__x);}
1306inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) {return ilogbl(__x);}
1307
1308template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001309inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001310typename enable_if<is_integral<_A1>::value, int>::type
1311ilogb(_A1 __x) {return ilogb((double)__x);}
1312
1313// lgamma
1314
1315using ::lgamma;
1316using ::lgammaf;
1317
1318inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __x) {return lgammaf(__x);}
1319inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) {return lgammal(__x);}
1320
David Chisnall997e4542012-02-29 13:05:08 +00001321
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001322template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001323inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001324typename enable_if<is_integral<_A1>::value, double>::type
1325lgamma(_A1 __x) {return lgamma((double)__x);}
1326
David Chisnall997e4542012-02-29 13:05:08 +00001327
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001328// llrint
1329
1330using ::llrint;
1331using ::llrintf;
1332
1333inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x) {return llrintf(__x);}
1334inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) {return llrintl(__x);}
1335
1336template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001337inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001338typename enable_if<is_integral<_A1>::value, long long>::type
1339llrint(_A1 __x) {return llrint((double)__x);}
1340
1341// llround
1342
1343using ::llround;
1344using ::llroundf;
1345
1346inline _LIBCPP_INLINE_VISIBILITY long long llround(float __x) {return llroundf(__x);}
1347inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) {return llroundl(__x);}
1348
1349template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001350inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001351typename enable_if<is_integral<_A1>::value, long long>::type
1352llround(_A1 __x) {return llround((double)__x);}
1353
1354// log1p
1355
1356using ::log1p;
1357using ::log1pf;
1358
1359inline _LIBCPP_INLINE_VISIBILITY float log1p(float __x) {return log1pf(__x);}
1360inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) {return log1pl(__x);}
1361
1362template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001363inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001364typename enable_if<is_integral<_A1>::value, double>::type
1365log1p(_A1 __x) {return log1p((double)__x);}
1366
1367// log2
1368
1369using ::log2;
1370using ::log2f;
1371
1372inline _LIBCPP_INLINE_VISIBILITY float log2(float __x) {return log2f(__x);}
1373inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) {return log2l(__x);}
1374
1375template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001376inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001377typename enable_if<is_integral<_A1>::value, double>::type
1378log2(_A1 __x) {return log2((double)__x);}
1379
1380// logb
1381
1382using ::logb;
1383using ::logbf;
1384
1385inline _LIBCPP_INLINE_VISIBILITY float logb(float __x) {return logbf(__x);}
1386inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) {return logbl(__x);}
1387
1388template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001389inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001390typename enable_if<is_integral<_A1>::value, double>::type
1391logb(_A1 __x) {return logb((double)__x);}
1392
1393// lrint
1394
1395using ::lrint;
1396using ::lrintf;
1397
1398inline _LIBCPP_INLINE_VISIBILITY long lrint(float __x) {return lrintf(__x);}
1399inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) {return lrintl(__x);}
1400
1401template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001402inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001403typename enable_if<is_integral<_A1>::value, long>::type
1404lrint(_A1 __x) {return lrint((double)__x);}
1405
1406// lround
1407
1408using ::lround;
1409using ::lroundf;
1410
1411inline _LIBCPP_INLINE_VISIBILITY long lround(float __x) {return lroundf(__x);}
1412inline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) {return lroundl(__x);}
1413
1414template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001415inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001416typename enable_if<is_integral<_A1>::value, long>::type
1417lround(_A1 __x) {return lround((double)__x);}
1418
1419// nan
1420
David Chisnall997e4542012-02-29 13:05:08 +00001421#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001422using ::nan;
1423using ::nanf;
David Chisnall997e4542012-02-29 13:05:08 +00001424#ifndef __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001425
1426// nearbyint
1427
1428using ::nearbyint;
1429using ::nearbyintf;
1430
1431inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __x) {return nearbyintf(__x);}
1432inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) {return nearbyintl(__x);}
1433
1434template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001435inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001436typename enable_if<is_integral<_A1>::value, double>::type
1437nearbyint(_A1 __x) {return nearbyint((double)__x);}
1438
1439// nextafter
1440
1441using ::nextafter;
1442using ::nextafterf;
1443
1444inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __x, float __y) {return nextafterf(__x, __y);}
1445inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) {return nextafterl(__x, __y);}
1446
1447template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001448inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001449typename enable_if
1450<
1451 is_arithmetic<_A1>::value &&
1452 is_arithmetic<_A2>::value,
1453 typename __promote<_A1, _A2>::type
1454>::type
1455nextafter(_A1 __x, _A2 __y)
1456{
1457 typedef typename __promote<_A1, _A2>::type __result_type;
1458 static_assert((!(is_same<_A1, __result_type>::value &&
1459 is_same<_A2, __result_type>::value)), "");
1460 return nextafter((__result_type)__x, (__result_type)__y);
1461}
1462
1463// nexttoward
1464
1465using ::nexttoward;
1466using ::nexttowardf;
1467
1468inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __x, long double __y) {return nexttowardf(__x, __y);}
1469inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);}
1470
1471template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001472inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001473typename enable_if<is_integral<_A1>::value, double>::type
1474nexttoward(_A1 __x, long double __y) {return nexttoward((double)__x, __y);}
1475
1476// remainder
1477
1478using ::remainder;
1479using ::remainderf;
1480
1481inline _LIBCPP_INLINE_VISIBILITY float remainder(float __x, float __y) {return remainderf(__x, __y);}
1482inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) {return remainderl(__x, __y);}
1483
1484template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001485inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001486typename enable_if
1487<
1488 is_arithmetic<_A1>::value &&
1489 is_arithmetic<_A2>::value,
1490 typename __promote<_A1, _A2>::type
1491>::type
1492remainder(_A1 __x, _A2 __y)
1493{
1494 typedef typename __promote<_A1, _A2>::type __result_type;
1495 static_assert((!(is_same<_A1, __result_type>::value &&
1496 is_same<_A2, __result_type>::value)), "");
1497 return remainder((__result_type)__x, (__result_type)__y);
1498}
1499
1500// remquo
1501
1502using ::remquo;
1503using ::remquof;
1504
1505inline _LIBCPP_INLINE_VISIBILITY float remquo(float __x, float __y, int* __z) {return remquof(__x, __y, __z);}
1506inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) {return remquol(__x, __y, __z);}
1507
1508template <class _A1, class _A2>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001509inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001510typename enable_if
1511<
1512 is_arithmetic<_A1>::value &&
1513 is_arithmetic<_A2>::value,
1514 typename __promote<_A1, _A2>::type
1515>::type
1516remquo(_A1 __x, _A2 __y, int* __z)
1517{
1518 typedef typename __promote<_A1, _A2>::type __result_type;
1519 static_assert((!(is_same<_A1, __result_type>::value &&
1520 is_same<_A2, __result_type>::value)), "");
1521 return remquo((__result_type)__x, (__result_type)__y, __z);
1522}
1523
1524// rint
1525
1526using ::rint;
1527using ::rintf;
1528
1529inline _LIBCPP_INLINE_VISIBILITY float rint(float __x) {return rintf(__x);}
1530inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) {return rintl(__x);}
1531
1532template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001533inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001534typename enable_if<is_integral<_A1>::value, double>::type
1535rint(_A1 __x) {return rint((double)__x);}
1536
1537// round
1538
1539using ::round;
1540using ::roundf;
1541
1542inline _LIBCPP_INLINE_VISIBILITY float round(float __x) {return roundf(__x);}
1543inline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) {return roundl(__x);}
1544
1545template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001546inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001547typename enable_if<is_integral<_A1>::value, double>::type
1548round(_A1 __x) {return round((double)__x);}
1549
1550// scalbln
1551
1552using ::scalbln;
1553using ::scalblnf;
1554
1555inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __x, long __y) {return scalblnf(__x, __y);}
1556inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) {return scalblnl(__x, __y);}
1557
1558template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001559inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001560typename enable_if<is_integral<_A1>::value, double>::type
1561scalbln(_A1 __x, long __y) {return scalbln((double)__x, __y);}
1562
1563// scalbn
1564
1565using ::scalbn;
1566using ::scalbnf;
1567
1568inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __x, int __y) {return scalbnf(__x, __y);}
1569inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) {return scalbnl(__x, __y);}
1570
1571template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001572inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001573typename enable_if<is_integral<_A1>::value, double>::type
1574scalbn(_A1 __x, int __y) {return scalbn((double)__x, __y);}
1575
1576// tgamma
1577
1578using ::tgamma;
1579using ::tgammaf;
1580
1581inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __x) {return tgammaf(__x);}
1582inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) {return tgammal(__x);}
1583
1584template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001585inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001586typename enable_if<is_integral<_A1>::value, double>::type
1587tgamma(_A1 __x) {return tgamma((double)__x);}
1588
1589// trunc
1590
1591using ::trunc;
1592using ::truncf;
1593
1594inline _LIBCPP_INLINE_VISIBILITY float trunc(float __x) {return truncf(__x);}
1595inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) {return truncl(__x);}
1596
1597template <class _A1>
Howard Hinnant422a53f2010-09-21 21:28:23 +00001598inline _LIBCPP_INLINE_VISIBILITY
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001599typename enable_if<is_integral<_A1>::value, double>::type
1600trunc(_A1 __x) {return trunc((double)__x);}
1601
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001602#endif // !_MSC_VER
1603
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001604using ::acosl;
1605using ::asinl;
1606using ::atanl;
1607using ::atan2l;
1608using ::ceill;
1609using ::cosl;
1610using ::coshl;
1611using ::expl;
1612using ::fabsl;
1613using ::floorl;
1614using ::fmodl;
1615using ::frexpl;
1616using ::ldexpl;
1617using ::logl;
1618using ::log10l;
1619using ::modfl;
1620using ::powl;
1621using ::sinl;
1622using ::sinhl;
1623using ::sqrtl;
1624using ::tanl;
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001625#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001626using ::tanhl;
1627using ::acoshl;
1628using ::asinhl;
1629using ::atanhl;
1630using ::cbrtl;
Howard Hinnantec3773c2011-12-01 20:21:04 +00001631#endif // !_MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001632using ::copysignl;
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001633#ifndef _MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001634using ::erfl;
1635using ::erfcl;
1636using ::exp2l;
1637using ::expm1l;
1638using ::fdiml;
1639using ::fmal;
1640using ::fmaxl;
1641using ::fminl;
1642using ::hypotl;
1643using ::ilogbl;
1644using ::lgammal;
1645using ::llrintl;
1646using ::llroundl;
1647using ::log1pl;
1648using ::log2l;
1649using ::logbl;
1650using ::lrintl;
1651using ::lroundl;
1652using ::nanl;
1653using ::nearbyintl;
1654using ::nextafterl;
1655using ::nexttowardl;
1656using ::remainderl;
1657using ::remquol;
1658using ::rintl;
1659using ::roundl;
1660using ::scalblnl;
1661using ::scalbnl;
1662using ::tgammal;
1663using ::truncl;
Howard Hinnant9f8884e2011-10-27 16:24:42 +00001664#endif // !_MSC_VER
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001665
David Chisnall997e4542012-02-29 13:05:08 +00001666#else
1667using ::lgamma;
1668using ::lgammaf;
1669#endif // __sun__
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001670_LIBCPP_END_NAMESPACE_STD
1671
Howard Hinnantbc8d3f92010-05-11 19:42:16 +00001672#endif // _LIBCPP_CMATH