cmath revision 227825
1227825Stheraven// -*- C++ -*-
2227825Stheraven//===---------------------------- cmath -----------------------------------===//
3227825Stheraven//
4227825Stheraven//                     The LLVM Compiler Infrastructure
5227825Stheraven//
6227825Stheraven// This file is dual licensed under the MIT and the University of Illinois Open
7227825Stheraven// Source Licenses. See LICENSE.TXT for details.
8227825Stheraven//
9227825Stheraven//===----------------------------------------------------------------------===//
10227825Stheraven
11227825Stheraven#ifndef _LIBCPP_CMATH
12227825Stheraven#define _LIBCPP_CMATH
13227825Stheraven
14227825Stheraven/*
15227825Stheraven    cmath synopsis
16227825Stheraven
17227825StheravenMacros:
18227825Stheraven
19227825Stheraven    HUGE_VAL
20227825Stheraven    HUGE_VALF               // C99
21227825Stheraven    HUGE_VALL               // C99
22227825Stheraven    INFINITY                // C99
23227825Stheraven    NAN                     // C99
24227825Stheraven    FP_INFINITE             // C99
25227825Stheraven    FP_NAN                  // C99
26227825Stheraven    FP_NORMAL               // C99
27227825Stheraven    FP_SUBNORMAL            // C99
28227825Stheraven    FP_ZERO                 // C99
29227825Stheraven    FP_FAST_FMA             // C99
30227825Stheraven    FP_FAST_FMAF            // C99
31227825Stheraven    FP_FAST_FMAL            // C99
32227825Stheraven    FP_ILOGB0               // C99
33227825Stheraven    FP_ILOGBNAN             // C99
34227825Stheraven    MATH_ERRNO              // C99
35227825Stheraven    MATH_ERREXCEPT          // C99
36227825Stheraven    math_errhandling        // C99
37227825Stheraven
38227825Stheravennamespace std
39227825Stheraven{
40227825Stheraven
41227825StheravenTypes:
42227825Stheraven
43227825Stheraven    float_t                 // C99
44227825Stheraven    double_t                // C99
45227825Stheraven
46227825Stheraven// C90
47227825Stheraven
48227825Stheravenfloating_point abs(floating_point x);
49227825Stheraven
50227825Stheravenfloating_point acos (arithmetic x);
51227825Stheravenfloat          acosf(float x);
52227825Stheravenlong double    acosl(long double x);
53227825Stheraven
54227825Stheravenfloating_point asin (arithmetic x);
55227825Stheravenfloat          asinf(float x);
56227825Stheravenlong double    asinl(long double x);
57227825Stheraven
58227825Stheravenfloating_point atan (arithmetic x);
59227825Stheravenfloat          atanf(float x);
60227825Stheravenlong double    atanl(long double x);
61227825Stheraven
62227825Stheravenfloating_point atan2 (arithmetic y, arithmetic x);
63227825Stheravenfloat          atan2f(float y, float x);
64227825Stheravenlong double    atan2l(long double y, long double x);
65227825Stheraven
66227825Stheravenfloating_point ceil (arithmetic x);
67227825Stheravenfloat          ceilf(float x);
68227825Stheravenlong double    ceill(long double x);
69227825Stheraven
70227825Stheravenfloating_point cos (arithmetic x);
71227825Stheravenfloat          cosf(float x);
72227825Stheravenlong double    cosl(long double x);
73227825Stheraven
74227825Stheravenfloating_point cosh (arithmetic x);
75227825Stheravenfloat          coshf(float x);
76227825Stheravenlong double    coshl(long double x);
77227825Stheraven
78227825Stheravenfloating_point exp (arithmetic x);
79227825Stheravenfloat          expf(float x);
80227825Stheravenlong double    expl(long double x);
81227825Stheraven
82227825Stheravenfloating_point fabs (arithmetic x);
83227825Stheravenfloat          fabsf(float x);
84227825Stheravenlong double    fabsl(long double x);
85227825Stheraven
86227825Stheravenfloating_point floor (arithmetic x);
87227825Stheravenfloat          floorf(float x);
88227825Stheravenlong double    floorl(long double x);
89227825Stheraven
90227825Stheravenfloating_point fmod (arithmetic x, arithmetic y);
91227825Stheravenfloat          fmodf(float x, float y);
92227825Stheravenlong double    fmodl(long double x, long double y);
93227825Stheraven
94227825Stheravenfloating_point frexp (arithmetic value, int* exp);
95227825Stheravenfloat          frexpf(float value, int* exp);
96227825Stheravenlong double    frexpl(long double value, int* exp);
97227825Stheraven
98227825Stheravenfloating_point ldexp (arithmetic value, int exp);
99227825Stheravenfloat          ldexpf(float value, int exp);
100227825Stheravenlong double    ldexpl(long double value, int exp);
101227825Stheraven
102227825Stheravenfloating_point log (arithmetic x);
103227825Stheravenfloat          logf(float x);
104227825Stheravenlong double    logl(long double x);
105227825Stheraven
106227825Stheravenfloating_point log10 (arithmetic x);
107227825Stheravenfloat          log10f(float x);
108227825Stheravenlong double    log10l(long double x);
109227825Stheraven
110227825Stheravenfloating_point modf (floating_point value, floating_point* iptr);
111227825Stheravenfloat          modff(float value, float* iptr);
112227825Stheravenlong double    modfl(long double value, long double* iptr);
113227825Stheraven
114227825Stheravenfloating_point pow (arithmetic x, arithmetic y);
115227825Stheravenfloat          powf(float x, float y);
116227825Stheravenlong double    powl(long double x, long double y);
117227825Stheraven
118227825Stheravenfloating_point sin (arithmetic x);
119227825Stheravenfloat          sinf(float x);
120227825Stheravenlong double    sinl(long double x);
121227825Stheraven
122227825Stheravenfloating_point sinh (arithmetic x);
123227825Stheravenfloat          sinhf(float x);
124227825Stheravenlong double    sinhl(long double x);
125227825Stheraven
126227825Stheravenfloating_point sqrt (arithmetic x);
127227825Stheravenfloat          sqrtf(float x);
128227825Stheravenlong double    sqrtl(long double x);
129227825Stheraven
130227825Stheravenfloating_point tan (arithmetic x);
131227825Stheravenfloat          tanf(float x);
132227825Stheravenlong double    tanl(long double x);
133227825Stheraven
134227825Stheravenfloating_point tanh (arithmetic x);
135227825Stheravenfloat          tanhf(float x);
136227825Stheravenlong double    tanhl(long double x);
137227825Stheraven
138227825Stheraven//  C99
139227825Stheraven
140227825Stheravenbool signbit(floating_point x);
141227825Stheraven
142227825Stheravenint fpclassify(floating_point x);
143227825Stheraven
144227825Stheravenbool isfinite(floating_point x);
145227825Stheravenbool isinf(floating_point x);
146227825Stheravenbool isnan(floating_point x);
147227825Stheravenbool isnormal(floating_point x);
148227825Stheraven
149227825Stheravenbool isgreater(floating_point x, floating_point y);
150227825Stheravenbool isgreaterequal(floating_point x, floating_point y);
151227825Stheravenbool isless(floating_point x, floating_point y);
152227825Stheravenbool islessequal(floating_point x, floating_point y);
153227825Stheravenbool islessgreater(floating_point x, floating_point y);
154227825Stheravenbool isunordered(floating_point x, floating_point y);
155227825Stheraven
156227825Stheravenfloating_point acosh (arithmetic x);
157227825Stheravenfloat          acoshf(float x);
158227825Stheravenlong double    acoshl(long double x);
159227825Stheraven
160227825Stheravenfloating_point asinh (arithmetic x);
161227825Stheravenfloat          asinhf(float x);
162227825Stheravenlong double    asinhl(long double x);
163227825Stheraven
164227825Stheravenfloating_point atanh (arithmetic x);
165227825Stheravenfloat          atanhf(float x);
166227825Stheravenlong double    atanhl(long double x);
167227825Stheraven
168227825Stheravenfloating_point cbrt (arithmetic x);
169227825Stheravenfloat          cbrtf(float x);
170227825Stheravenlong double    cbrtl(long double x);
171227825Stheraven
172227825Stheravenfloating_point copysign (arithmetic x, arithmetic y);
173227825Stheravenfloat          copysignf(float x, float y);
174227825Stheravenlong double    copysignl(long double x, long double y);
175227825Stheraven
176227825Stheravenfloating_point erf (arithmetic x);
177227825Stheravenfloat          erff(float x);
178227825Stheravenlong double    erfl(long double x);
179227825Stheraven
180227825Stheravenfloating_point erfc (arithmetic x);
181227825Stheravenfloat          erfcf(float x);
182227825Stheravenlong double    erfcl(long double x);
183227825Stheraven
184227825Stheravenfloating_point exp2 (arithmetic x);
185227825Stheravenfloat          exp2f(float x);
186227825Stheravenlong double    exp2l(long double x);
187227825Stheraven
188227825Stheravenfloating_point expm1 (arithmetic x);
189227825Stheravenfloat          expm1f(float x);
190227825Stheravenlong double    expm1l(long double x);
191227825Stheraven
192227825Stheravenfloating_point fdim (arithmetic x, arithmetic y);
193227825Stheravenfloat          fdimf(float x, float y);
194227825Stheravenlong double    fdiml(long double x, long double y);
195227825Stheraven
196227825Stheravenfloating_point fma (arithmetic x, arithmetic y, arithmetic z);
197227825Stheravenfloat          fmaf(float x, float y, float z);
198227825Stheravenlong double    fmal(long double x, long double y, long double z);
199227825Stheraven
200227825Stheravenfloating_point fmax (arithmetic x, arithmetic y);
201227825Stheravenfloat          fmaxf(float x, float y);
202227825Stheravenlong double    fmaxl(long double x, long double y);
203227825Stheraven
204227825Stheravenfloating_point fmin (arithmetic x, arithmetic y);
205227825Stheravenfloat          fminf(float x, float y);
206227825Stheravenlong double    fminl(long double x, long double y);
207227825Stheraven
208227825Stheravenfloating_point hypot (arithmetic x, arithmetic y);
209227825Stheravenfloat          hypotf(float x, float y);
210227825Stheravenlong double    hypotl(long double x, long double y);
211227825Stheraven
212227825Stheravenint ilogb (arithmetic x);
213227825Stheravenint ilogbf(float x);
214227825Stheravenint ilogbl(long double x);
215227825Stheraven
216227825Stheravenfloating_point lgamma (arithmetic x);
217227825Stheravenfloat          lgammaf(float x);
218227825Stheravenlong double    lgammal(long double x);
219227825Stheraven
220227825Stheravenlong long llrint (arithmetic x);
221227825Stheravenlong long llrintf(float x);
222227825Stheravenlong long llrintl(long double x);
223227825Stheraven
224227825Stheravenlong long llround (arithmetic x);
225227825Stheravenlong long llroundf(float x);
226227825Stheravenlong long llroundl(long double x);
227227825Stheraven
228227825Stheravenfloating_point log1p (arithmetic x);
229227825Stheravenfloat          log1pf(float x);
230227825Stheravenlong double    log1pl(long double x);
231227825Stheraven
232227825Stheravenfloating_point log2 (arithmetic x);
233227825Stheravenfloat          log2f(float x);
234227825Stheravenlong double    log2l(long double x);
235227825Stheraven
236227825Stheravenfloating_point logb (arithmetic x);
237227825Stheravenfloat          logbf(float x);
238227825Stheravenlong double    logbl(long double x);
239227825Stheraven
240227825Stheravenlong lrint (arithmetic x);
241227825Stheravenlong lrintf(float x);
242227825Stheravenlong lrintl(long double x);
243227825Stheraven
244227825Stheravenlong lround (arithmetic x);
245227825Stheravenlong lroundf(float x);
246227825Stheravenlong lroundl(long double x);
247227825Stheraven
248227825Stheravendouble      nan (const char* str);
249227825Stheravenfloat       nanf(const char* str);
250227825Stheravenlong double nanl(const char* str);
251227825Stheraven
252227825Stheravenfloating_point nearbyint (arithmetic x);
253227825Stheravenfloat          nearbyintf(float x);
254227825Stheravenlong double    nearbyintl(long double x);
255227825Stheraven
256227825Stheravenfloating_point nextafter (arithmetic x, arithmetic y);
257227825Stheravenfloat          nextafterf(float x, float y);
258227825Stheravenlong double    nextafterl(long double x, long double y);
259227825Stheraven
260227825Stheravenfloating_point nexttoward (arithmetic x, long double y);
261227825Stheravenfloat          nexttowardf(float x, long double y);
262227825Stheravenlong double    nexttowardl(long double x, long double y);
263227825Stheraven
264227825Stheravenfloating_point remainder (arithmetic x, arithmetic y);
265227825Stheravenfloat          remainderf(float x, float y);
266227825Stheravenlong double    remainderl(long double x, long double y);
267227825Stheraven
268227825Stheravenfloating_point remquo (arithmetic x, arithmetic y, int* pquo);
269227825Stheravenfloat          remquof(float x, float y, int* pquo);
270227825Stheravenlong double    remquol(long double x, long double y, int* pquo);
271227825Stheraven
272227825Stheravenfloating_point rint (arithmetic x);
273227825Stheravenfloat          rintf(float x);
274227825Stheravenlong double    rintl(long double x);
275227825Stheraven
276227825Stheravenfloating_point round (arithmetic x);
277227825Stheravenfloat          roundf(float x);
278227825Stheravenlong double    roundl(long double x);
279227825Stheraven
280227825Stheravenfloating_point scalbln (arithmetic x, long ex);
281227825Stheravenfloat          scalblnf(float x, long ex);
282227825Stheravenlong double    scalblnl(long double x, long ex);
283227825Stheraven
284227825Stheravenfloating_point scalbn (arithmetic x, int ex);
285227825Stheravenfloat          scalbnf(float x, int ex);
286227825Stheravenlong double    scalbnl(long double x, int ex);
287227825Stheraven
288227825Stheravenfloating_point tgamma (arithmetic x);
289227825Stheravenfloat          tgammaf(float x);
290227825Stheravenlong double    tgammal(long double x);
291227825Stheraven
292227825Stheravenfloating_point trunc (arithmetic x);
293227825Stheravenfloat          truncf(float x);
294227825Stheravenlong double    truncl(long double x);
295227825Stheraven
296227825Stheraven}  // std
297227825Stheraven
298227825Stheraven*/
299227825Stheraven
300227825Stheraven#include <__config>
301227825Stheraven#include <math.h>
302227825Stheraven#include <type_traits>
303227825Stheraven
304227825Stheraven#ifdef _MSC_VER
305227825Stheraven#include "support/win32/math_win32.h"
306227825Stheraven#endif
307227825Stheraven
308227825Stheraven#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
309227825Stheraven#pragma GCC system_header
310227825Stheraven#endif
311227825Stheraven
312227825Stheraven// signbit
313227825Stheraven
314227825Stheraven#ifdef signbit
315227825Stheraven
316227825Stheraventemplate <class _A1>
317227825Stheraven_LIBCPP_ALWAYS_INLINE
318227825Stheravenbool
319227825Stheraven__libcpp_signbit(_A1 __x)
320227825Stheraven{
321227825Stheraven    return signbit(__x);
322227825Stheraven}
323227825Stheraven
324227825Stheraven#undef signbit
325227825Stheraven
326227825Stheraventemplate <class _A1>
327227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
328227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
329227825Stheravensignbit(_A1 __x)
330227825Stheraven{
331227825Stheraven    return __libcpp_signbit(__x);
332227825Stheraven}
333227825Stheraven
334227825Stheraven#endif  // signbit
335227825Stheraven
336227825Stheraven// fpclassify
337227825Stheraven
338227825Stheraven#ifdef fpclassify
339227825Stheraven
340227825Stheraventemplate <class _A1>
341227825Stheraven_LIBCPP_ALWAYS_INLINE
342227825Stheravenint
343227825Stheraven__libcpp_fpclassify(_A1 __x)
344227825Stheraven{
345227825Stheraven    return fpclassify(__x);
346227825Stheraven}
347227825Stheraven
348227825Stheraven#undef fpclassify
349227825Stheraven
350227825Stheraventemplate <class _A1>
351227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
352227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, int>::type
353227825Stheravenfpclassify(_A1 __x)
354227825Stheraven{
355227825Stheraven    return __libcpp_fpclassify(__x);
356227825Stheraven}
357227825Stheraven
358227825Stheraven#endif  // fpclassify
359227825Stheraven
360227825Stheraven// isfinite
361227825Stheraven
362227825Stheraven#ifdef isfinite
363227825Stheraven
364227825Stheraventemplate <class _A1>
365227825Stheraven_LIBCPP_ALWAYS_INLINE
366227825Stheravenbool
367227825Stheraven__libcpp_isfinite(_A1 __x)
368227825Stheraven{
369227825Stheraven    return isfinite(__x);
370227825Stheraven}
371227825Stheraven
372227825Stheraven#undef isfinite
373227825Stheraven
374227825Stheraventemplate <class _A1>
375227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
376227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
377227825Stheravenisfinite(_A1 __x)
378227825Stheraven{
379227825Stheraven    return __libcpp_isfinite(__x);
380227825Stheraven}
381227825Stheraven
382227825Stheraven#endif  // isfinite
383227825Stheraven
384227825Stheraven// isinf
385227825Stheraven
386227825Stheraven#ifdef isinf
387227825Stheraven
388227825Stheraventemplate <class _A1>
389227825Stheraven_LIBCPP_ALWAYS_INLINE
390227825Stheravenbool
391227825Stheraven__libcpp_isinf(_A1 __x)
392227825Stheraven{
393227825Stheraven    return isinf(__x);
394227825Stheraven}
395227825Stheraven
396227825Stheraven#undef isinf
397227825Stheraven
398227825Stheraventemplate <class _A1>
399227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
400227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
401227825Stheravenisinf(_A1 __x)
402227825Stheraven{
403227825Stheraven    return __libcpp_isinf(__x);
404227825Stheraven}
405227825Stheraven
406227825Stheraven#endif  // isinf
407227825Stheraven
408227825Stheraven// isnan
409227825Stheraven
410227825Stheraven#ifdef isnan
411227825Stheraven
412227825Stheraventemplate <class _A1>
413227825Stheraven_LIBCPP_ALWAYS_INLINE
414227825Stheravenbool
415227825Stheraven__libcpp_isnan(_A1 __x)
416227825Stheraven{
417227825Stheraven    return isnan(__x);
418227825Stheraven}
419227825Stheraven
420227825Stheraven#undef isnan
421227825Stheraven
422227825Stheraventemplate <class _A1>
423227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
424227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
425227825Stheravenisnan(_A1 __x)
426227825Stheraven{
427227825Stheraven    return __libcpp_isnan(__x);
428227825Stheraven}
429227825Stheraven
430227825Stheraven#endif  // isnan
431227825Stheraven
432227825Stheraven// isnormal
433227825Stheraven
434227825Stheraven#ifdef isnormal
435227825Stheraven
436227825Stheraventemplate <class _A1>
437227825Stheraven_LIBCPP_ALWAYS_INLINE
438227825Stheravenbool
439227825Stheraven__libcpp_isnormal(_A1 __x)
440227825Stheraven{
441227825Stheraven    return isnormal(__x);
442227825Stheraven}
443227825Stheraven
444227825Stheraven#undef isnormal
445227825Stheraven
446227825Stheraventemplate <class _A1>
447227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
448227825Stheraventypename std::enable_if<std::is_floating_point<_A1>::value, bool>::type
449227825Stheravenisnormal(_A1 __x)
450227825Stheraven{
451227825Stheraven    return __libcpp_isnormal(__x);
452227825Stheraven}
453227825Stheraven
454227825Stheraven#endif  // isnormal
455227825Stheraven
456227825Stheraven// isgreater
457227825Stheraven
458227825Stheraven#ifdef isgreater
459227825Stheraven
460227825Stheraventemplate <class _A1, class _A2>
461227825Stheraven_LIBCPP_ALWAYS_INLINE
462227825Stheravenbool
463227825Stheraven__libcpp_isgreater(_A1 __x, _A2 __y)
464227825Stheraven{
465227825Stheraven    return isgreater(__x, __y);
466227825Stheraven}
467227825Stheraven
468227825Stheraven#undef isgreater
469227825Stheraven
470227825Stheraventemplate <class _A1, class _A2>
471227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
472227825Stheraventypename std::enable_if
473227825Stheraven<
474227825Stheraven    std::is_floating_point<_A1>::value &&
475227825Stheraven    std::is_floating_point<_A2>::value,
476227825Stheraven    bool
477227825Stheraven>::type
478227825Stheravenisgreater(_A1 __x, _A2 __y)
479227825Stheraven{
480227825Stheraven    return __libcpp_isgreater(__x, __y);
481227825Stheraven}
482227825Stheraven
483227825Stheraven#endif  // isgreater
484227825Stheraven
485227825Stheraven// isgreaterequal
486227825Stheraven
487227825Stheraven#ifdef isgreaterequal
488227825Stheraven
489227825Stheraventemplate <class _A1, class _A2>
490227825Stheraven_LIBCPP_ALWAYS_INLINE
491227825Stheravenbool
492227825Stheraven__libcpp_isgreaterequal(_A1 __x, _A2 __y)
493227825Stheraven{
494227825Stheraven    return isgreaterequal(__x, __y);
495227825Stheraven}
496227825Stheraven
497227825Stheraven#undef isgreaterequal
498227825Stheraven
499227825Stheraventemplate <class _A1, class _A2>
500227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
501227825Stheraventypename std::enable_if
502227825Stheraven<
503227825Stheraven    std::is_floating_point<_A1>::value &&
504227825Stheraven    std::is_floating_point<_A2>::value,
505227825Stheraven    bool
506227825Stheraven>::type
507227825Stheravenisgreaterequal(_A1 __x, _A2 __y)
508227825Stheraven{
509227825Stheraven    return __libcpp_isgreaterequal(__x, __y);
510227825Stheraven}
511227825Stheraven
512227825Stheraven#endif  // isgreaterequal
513227825Stheraven
514227825Stheraven// isless
515227825Stheraven
516227825Stheraven#ifdef isless
517227825Stheraven
518227825Stheraventemplate <class _A1, class _A2>
519227825Stheraven_LIBCPP_ALWAYS_INLINE
520227825Stheravenbool
521227825Stheraven__libcpp_isless(_A1 __x, _A2 __y)
522227825Stheraven{
523227825Stheraven    return isless(__x, __y);
524227825Stheraven}
525227825Stheraven
526227825Stheraven#undef isless
527227825Stheraven
528227825Stheraventemplate <class _A1, class _A2>
529227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
530227825Stheraventypename std::enable_if
531227825Stheraven<
532227825Stheraven    std::is_floating_point<_A1>::value &&
533227825Stheraven    std::is_floating_point<_A2>::value,
534227825Stheraven    bool
535227825Stheraven>::type
536227825Stheravenisless(_A1 __x, _A2 __y)
537227825Stheraven{
538227825Stheraven    return __libcpp_isless(__x, __y);
539227825Stheraven}
540227825Stheraven
541227825Stheraven#endif  // isless
542227825Stheraven
543227825Stheraven// islessequal
544227825Stheraven
545227825Stheraven#ifdef islessequal
546227825Stheraven
547227825Stheraventemplate <class _A1, class _A2>
548227825Stheraven_LIBCPP_ALWAYS_INLINE
549227825Stheravenbool
550227825Stheraven__libcpp_islessequal(_A1 __x, _A2 __y)
551227825Stheraven{
552227825Stheraven    return islessequal(__x, __y);
553227825Stheraven}
554227825Stheraven
555227825Stheraven#undef islessequal
556227825Stheraven
557227825Stheraventemplate <class _A1, class _A2>
558227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
559227825Stheraventypename std::enable_if
560227825Stheraven<
561227825Stheraven    std::is_floating_point<_A1>::value &&
562227825Stheraven    std::is_floating_point<_A2>::value,
563227825Stheraven    bool
564227825Stheraven>::type
565227825Stheravenislessequal(_A1 __x, _A2 __y)
566227825Stheraven{
567227825Stheraven    return __libcpp_islessequal(__x, __y);
568227825Stheraven}
569227825Stheraven
570227825Stheraven#endif  // islessequal
571227825Stheraven
572227825Stheraven// islessgreater
573227825Stheraven
574227825Stheraven#ifdef islessgreater
575227825Stheraven
576227825Stheraventemplate <class _A1, class _A2>
577227825Stheraven_LIBCPP_ALWAYS_INLINE
578227825Stheravenbool
579227825Stheraven__libcpp_islessgreater(_A1 __x, _A2 __y)
580227825Stheraven{
581227825Stheraven    return islessgreater(__x, __y);
582227825Stheraven}
583227825Stheraven
584227825Stheraven#undef islessgreater
585227825Stheraven
586227825Stheraventemplate <class _A1, class _A2>
587227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
588227825Stheraventypename std::enable_if
589227825Stheraven<
590227825Stheraven    std::is_floating_point<_A1>::value &&
591227825Stheraven    std::is_floating_point<_A2>::value,
592227825Stheraven    bool
593227825Stheraven>::type
594227825Stheravenislessgreater(_A1 __x, _A2 __y)
595227825Stheraven{
596227825Stheraven    return __libcpp_islessgreater(__x, __y);
597227825Stheraven}
598227825Stheraven
599227825Stheraven#endif  // islessgreater
600227825Stheraven
601227825Stheraven// isunordered
602227825Stheraven
603227825Stheraven#ifdef isunordered
604227825Stheraven
605227825Stheraventemplate <class _A1, class _A2>
606227825Stheraven_LIBCPP_ALWAYS_INLINE
607227825Stheravenbool
608227825Stheraven__libcpp_isunordered(_A1 __x, _A2 __y)
609227825Stheraven{
610227825Stheraven    return isunordered(__x, __y);
611227825Stheraven}
612227825Stheraven
613227825Stheraven#undef isunordered
614227825Stheraven
615227825Stheraventemplate <class _A1, class _A2>
616227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
617227825Stheraventypename std::enable_if
618227825Stheraven<
619227825Stheraven    std::is_floating_point<_A1>::value &&
620227825Stheraven    std::is_floating_point<_A2>::value,
621227825Stheraven    bool
622227825Stheraven>::type
623227825Stheravenisunordered(_A1 __x, _A2 __y)
624227825Stheraven{
625227825Stheraven    return __libcpp_isunordered(__x, __y);
626227825Stheraven}
627227825Stheraven
628227825Stheraven#endif  // isunordered
629227825Stheraven
630227825Stheraven_LIBCPP_BEGIN_NAMESPACE_STD
631227825Stheraven
632227825Stheravenusing ::signbit;
633227825Stheravenusing ::fpclassify;
634227825Stheravenusing ::isfinite;
635227825Stheravenusing ::isinf;
636227825Stheravenusing ::isnan;
637227825Stheravenusing ::isnormal;
638227825Stheravenusing ::isgreater;
639227825Stheravenusing ::isgreaterequal;
640227825Stheravenusing ::isless;
641227825Stheravenusing ::islessequal;
642227825Stheravenusing ::islessgreater;
643227825Stheravenusing ::isunordered;
644227825Stheravenusing ::isunordered;
645227825Stheraven
646227825Stheravenusing ::float_t;
647227825Stheravenusing ::double_t;
648227825Stheraven
649227825Stheraven// abs
650227825Stheraven
651227825Stheraventemplate <class _A1>
652227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
653227825Stheraventypename enable_if<is_floating_point<_A1>::value, _A1>::type
654227825Stheravenabs(_A1 __x) {return fabs(__x);}
655227825Stheraven
656227825Stheraven// acos
657227825Stheraven
658227825Stheravenusing ::acos;
659227825Stheravenusing ::acosf;
660227825Stheraven
661227825Stheraven#ifndef _MSC_VER
662227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       acos(float __x)       {return acosf(__x);}
663227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) {return acosl(__x);}
664227825Stheraven#endif
665227825Stheraven
666227825Stheraventemplate <class _A1>
667227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
668227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
669227825Stheravenacos(_A1 __x) {return acos((double)__x);}
670227825Stheraven
671227825Stheraven// asin
672227825Stheraven
673227825Stheravenusing ::asin;
674227825Stheravenusing ::asinf;
675227825Stheraven
676227825Stheraven#ifndef _MSC_VER
677227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       asin(float __x)       {return asinf(__x);}
678227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) {return asinl(__x);}
679227825Stheraven#endif
680227825Stheraven
681227825Stheraventemplate <class _A1>
682227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
683227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
684227825Stheravenasin(_A1 __x) {return asin((double)__x);}
685227825Stheraven
686227825Stheraven// atan
687227825Stheraven
688227825Stheravenusing ::atan;
689227825Stheravenusing ::atanf;
690227825Stheraven
691227825Stheraven#ifndef _MSC_VER
692227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       atan(float __x)       {return atanf(__x);}
693227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) {return atanl(__x);}
694227825Stheraven#endif
695227825Stheraven
696227825Stheraventemplate <class _A1>
697227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
698227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
699227825Stheravenatan(_A1 __x) {return atan((double)__x);}
700227825Stheraven
701227825Stheraven// atan2
702227825Stheraven
703227825Stheravenusing ::atan2;
704227825Stheravenusing ::atan2f;
705227825Stheraven
706227825Stheraven#ifndef _MSC_VER
707227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       atan2(float __y, float __x)             {return atan2f(__y, __x);}
708227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) {return atan2l(__y, __x);}
709227825Stheraven#endif
710227825Stheraven
711227825Stheraventemplate <class _A1, class _A2>
712227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
713227825Stheraventypename enable_if
714227825Stheraven<
715227825Stheraven    is_arithmetic<_A1>::value &&
716227825Stheraven    is_arithmetic<_A2>::value,
717227825Stheraven    typename __promote<_A1, _A2>::type
718227825Stheraven>::type
719227825Stheravenatan2(_A1 __y, _A2 __x)
720227825Stheraven{
721227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
722227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
723227825Stheraven                      is_same<_A2, __result_type>::value)), "");
724227825Stheraven    return atan2((__result_type)__y, (__result_type)__x);
725227825Stheraven}
726227825Stheraven
727227825Stheraven// ceil
728227825Stheraven
729227825Stheravenusing ::ceil;
730227825Stheravenusing ::ceilf;
731227825Stheraven
732227825Stheraven#ifndef _MSC_VER
733227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       ceil(float __x)       {return ceilf(__x);}
734227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) {return ceill(__x);}
735227825Stheraven#endif
736227825Stheraven
737227825Stheraventemplate <class _A1>
738227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
739227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
740227825Stheravenceil(_A1 __x) {return ceil((double)__x);}
741227825Stheraven
742227825Stheraven// cos
743227825Stheraven
744227825Stheravenusing ::cos;
745227825Stheravenusing ::cosf;
746227825Stheraven
747227825Stheraven#ifndef _MSC_VER
748227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       cos(float __x)       {return cosf(__x);}
749227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) {return cosl(__x);}
750227825Stheraven#endif
751227825Stheraven
752227825Stheraventemplate <class _A1>
753227825Stheraveninline _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
754227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
755227825Stheravencos(_A1 __x) {return cos((double)__x);}
756227825Stheraven
757227825Stheraven// cosh
758227825Stheraven
759227825Stheravenusing ::cosh;
760227825Stheravenusing ::coshf;
761227825Stheraven
762227825Stheraven#ifndef _MSC_VER
763227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       cosh(float __x)       {return coshf(__x);}
764227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) {return coshl(__x);}
765227825Stheraven#endif
766227825Stheraven
767227825Stheraventemplate <class _A1>
768227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
769227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
770227825Stheravencosh(_A1 __x) {return cosh((double)__x);}
771227825Stheraven
772227825Stheraven// exp
773227825Stheraven
774227825Stheravenusing ::exp;
775227825Stheravenusing ::expf;
776227825Stheraven
777227825Stheraven#ifndef _MSC_VER
778227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       exp(float __x)       {return expf(__x);}
779227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) {return expl(__x);}
780227825Stheraven#endif
781227825Stheraven
782227825Stheraventemplate <class _A1>
783227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
784227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
785227825Stheravenexp(_A1 __x) {return exp((double)__x);}
786227825Stheraven
787227825Stheraven// fabs
788227825Stheraven
789227825Stheravenusing ::fabs;
790227825Stheravenusing ::fabsf;
791227825Stheraven
792227825Stheraven#ifndef _MSC_VER
793227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fabs(float __x)       {return fabsf(__x);}
794227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) {return fabsl(__x);}
795227825Stheraven#endif
796227825Stheraven
797227825Stheraventemplate <class _A1>
798227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
799227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
800227825Stheravenfabs(_A1 __x) {return fabs((double)__x);}
801227825Stheraven
802227825Stheraven// floor
803227825Stheraven
804227825Stheravenusing ::floor;
805227825Stheravenusing ::floorf;
806227825Stheraven
807227825Stheraven#ifndef _MSC_VER
808227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       floor(float __x)       {return floorf(__x);}
809227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) {return floorl(__x);}
810227825Stheraven#endif
811227825Stheraven
812227825Stheraventemplate <class _A1>
813227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
814227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
815227825Stheravenfloor(_A1 __x) {return floor((double)__x);}
816227825Stheraven
817227825Stheraven// fmod
818227825Stheraven
819227825Stheravenusing ::fmod;
820227825Stheravenusing ::fmodf;
821227825Stheraven
822227825Stheraven#ifndef _MSC_VER
823227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fmod(float __x, float __y)             {return fmodf(__x, __y);}
824227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) {return fmodl(__x, __y);}
825227825Stheraven#endif
826227825Stheraven
827227825Stheraventemplate <class _A1, class _A2>
828227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
829227825Stheraventypename enable_if
830227825Stheraven<
831227825Stheraven    is_arithmetic<_A1>::value &&
832227825Stheraven    is_arithmetic<_A2>::value,
833227825Stheraven    typename __promote<_A1, _A2>::type
834227825Stheraven>::type
835227825Stheravenfmod(_A1 __x, _A2 __y)
836227825Stheraven{
837227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
838227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
839227825Stheraven                      is_same<_A2, __result_type>::value)), "");
840227825Stheraven    return fmod((__result_type)__x, (__result_type)__y);
841227825Stheraven}
842227825Stheraven
843227825Stheraven// frexp
844227825Stheraven
845227825Stheravenusing ::frexp;
846227825Stheravenusing ::frexpf;
847227825Stheraven
848227825Stheraven#ifndef _MSC_VER
849227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       frexp(float __x, int* __e)       {return frexpf(__x, __e);}
850227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) {return frexpl(__x, __e);}
851227825Stheraven#endif
852227825Stheraven
853227825Stheraventemplate <class _A1>
854227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
855227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
856227825Stheravenfrexp(_A1 __x, int* __e) {return frexp((double)__x, __e);}
857227825Stheraven
858227825Stheraven// ldexp
859227825Stheraven
860227825Stheravenusing ::ldexp;
861227825Stheravenusing ::ldexpf;
862227825Stheraven
863227825Stheraven#ifndef _MSC_VER
864227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       ldexp(float __x, int __e)       {return ldexpf(__x, __e);}
865227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) {return ldexpl(__x, __e);}
866227825Stheraven#endif
867227825Stheraven
868227825Stheraventemplate <class _A1>
869227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
870227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
871227825Stheravenldexp(_A1 __x, int __e) {return ldexp((double)__x, __e);}
872227825Stheraven
873227825Stheraven// log
874227825Stheraven
875227825Stheravenusing ::log;
876227825Stheravenusing ::logf;
877227825Stheraven
878227825Stheraven#ifndef _MSC_VER
879227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       log(float __x)       {return logf(__x);}
880227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) {return logl(__x);}
881227825Stheraven#endif
882227825Stheraven
883227825Stheraventemplate <class _A1>
884227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
885227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
886227825Stheravenlog(_A1 __x) {return log((double)__x);}
887227825Stheraven
888227825Stheraven// log10
889227825Stheraven
890227825Stheravenusing ::log10;
891227825Stheravenusing ::log10f;
892227825Stheraven
893227825Stheraven#ifndef _MSC_VER
894227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       log10(float __x)       {return log10f(__x);}
895227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) {return log10l(__x);}
896227825Stheraven#endif
897227825Stheraven
898227825Stheraventemplate <class _A1>
899227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
900227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
901227825Stheravenlog10(_A1 __x) {return log10((double)__x);}
902227825Stheraven
903227825Stheraven// modf
904227825Stheraven
905227825Stheravenusing ::modf;
906227825Stheravenusing ::modff;
907227825Stheraven
908227825Stheraven#ifndef _MSC_VER
909227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       modf(float __x, float* __y)             {return modff(__x, __y);}
910227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) {return modfl(__x, __y);}
911227825Stheraven#endif
912227825Stheraven
913227825Stheraven// pow
914227825Stheraven
915227825Stheravenusing ::pow;
916227825Stheravenusing ::powf;
917227825Stheraven
918227825Stheraven#ifndef _MSC_VER
919227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       pow(float __x, float __y)             {return powf(__x, __y);}
920227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) {return powl(__x, __y);}
921227825Stheraven#endif
922227825Stheraven
923227825Stheraventemplate <class _A1, class _A2>
924227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
925227825Stheraventypename enable_if
926227825Stheraven<
927227825Stheraven    is_arithmetic<_A1>::value &&
928227825Stheraven    is_arithmetic<_A2>::value,
929227825Stheraven    typename __promote<_A1, _A2>::type
930227825Stheraven>::type
931227825Stheravenpow(_A1 __x, _A2 __y)
932227825Stheraven{
933227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
934227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
935227825Stheraven                      is_same<_A2, __result_type>::value)), "");
936227825Stheraven    return pow((__result_type)__x, (__result_type)__y);
937227825Stheraven}
938227825Stheraven
939227825Stheraven// sin
940227825Stheraven
941227825Stheravenusing ::sin;
942227825Stheravenusing ::sinf;
943227825Stheraven
944227825Stheraven#ifndef _MSC_VER
945227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       sin(float __x)       {return sinf(__x);}
946227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) {return sinl(__x);}
947227825Stheraven#endif
948227825Stheraven
949227825Stheraventemplate <class _A1>
950227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
951227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
952227825Stheravensin(_A1 __x) {return sin((double)__x);}
953227825Stheraven
954227825Stheraven// sinh
955227825Stheraven
956227825Stheravenusing ::sinh;
957227825Stheravenusing ::sinhf;
958227825Stheraven
959227825Stheraven#ifndef _MSC_VER
960227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       sinh(float __x)       {return sinhf(__x);}
961227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) {return sinhl(__x);}
962227825Stheraven#endif
963227825Stheraven
964227825Stheraventemplate <class _A1>
965227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
966227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
967227825Stheravensinh(_A1 __x) {return sinh((double)__x);}
968227825Stheraven
969227825Stheraven// sqrt
970227825Stheraven
971227825Stheravenusing ::sqrt;
972227825Stheravenusing ::sqrtf;
973227825Stheraven
974227825Stheraven#ifndef _MSC_VER
975227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       sqrt(float __x)       {return sqrtf(__x);}
976227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) {return sqrtl(__x);}
977227825Stheraven#endif
978227825Stheraven
979227825Stheraventemplate <class _A1>
980227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
981227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
982227825Stheravensqrt(_A1 __x) {return sqrt((double)__x);}
983227825Stheraven
984227825Stheraven// tan
985227825Stheraven
986227825Stheravenusing ::tan;
987227825Stheravenusing ::tanf;
988227825Stheraven
989227825Stheraven#ifndef _MSC_VER
990227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       tan(float __x)       {return tanf(__x);}
991227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) {return tanl(__x);}
992227825Stheraven#endif
993227825Stheraven
994227825Stheraventemplate <class _A1>
995227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
996227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
997227825Stheraventan(_A1 __x) {return tan((double)__x);}
998227825Stheraven
999227825Stheraven// tanh
1000227825Stheraven
1001227825Stheravenusing ::tanh;
1002227825Stheravenusing ::tanhf;
1003227825Stheraven
1004227825Stheraven#ifndef _MSC_VER
1005227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       tanh(float __x)       {return tanhf(__x);}
1006227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) {return tanhl(__x);}
1007227825Stheraven#endif
1008227825Stheraven
1009227825Stheraventemplate <class _A1>
1010227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1011227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1012227825Stheraventanh(_A1 __x) {return tanh((double)__x);}
1013227825Stheraven
1014227825Stheraven// acosh
1015227825Stheraven
1016227825Stheraven#ifndef _MSC_VER
1017227825Stheravenusing ::acosh;
1018227825Stheravenusing ::acoshf;
1019227825Stheraven
1020227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       acosh(float __x)       {return acoshf(__x);}
1021227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) {return acoshl(__x);}
1022227825Stheraven
1023227825Stheraventemplate <class _A1>
1024227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1025227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1026227825Stheravenacosh(_A1 __x) {return acosh((double)__x);}
1027227825Stheraven#endif
1028227825Stheraven
1029227825Stheraven// asinh
1030227825Stheraven
1031227825Stheraven#ifndef _MSC_VER
1032227825Stheravenusing ::asinh;
1033227825Stheravenusing ::asinhf;
1034227825Stheraven
1035227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       asinh(float __x)       {return asinhf(__x);}
1036227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) {return asinhl(__x);}
1037227825Stheraven
1038227825Stheraventemplate <class _A1>
1039227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1040227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1041227825Stheravenasinh(_A1 __x) {return asinh((double)__x);}
1042227825Stheraven#endif
1043227825Stheraven
1044227825Stheraven// atanh
1045227825Stheraven
1046227825Stheraven#ifndef _MSC_VER
1047227825Stheravenusing ::atanh;
1048227825Stheravenusing ::atanhf;
1049227825Stheraven
1050227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       atanh(float __x)       {return atanhf(__x);}
1051227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) {return atanhl(__x);}
1052227825Stheraven
1053227825Stheraventemplate <class _A1>
1054227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1055227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1056227825Stheravenatanh(_A1 __x) {return atanh((double)__x);}
1057227825Stheraven#endif
1058227825Stheraven
1059227825Stheraven// cbrt
1060227825Stheraven
1061227825Stheraven#ifndef _MSC_VER
1062227825Stheravenusing ::cbrt;
1063227825Stheravenusing ::cbrtf;
1064227825Stheraven
1065227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       cbrt(float __x)       {return cbrtf(__x);}
1066227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) {return cbrtl(__x);}
1067227825Stheraven
1068227825Stheraventemplate <class _A1>
1069227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1070227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1071227825Stheravencbrt(_A1 __x) {return cbrt((double)__x);}
1072227825Stheraven#endif
1073227825Stheraven
1074227825Stheraven// copysign
1075227825Stheraven
1076227825Stheravenusing ::copysign;
1077227825Stheravenusing ::copysignf;
1078227825Stheraven
1079227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       copysign(float __x, float __y)             {return copysignf(__x, __y);}
1080227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) {return copysignl(__x, __y);}
1081227825Stheraven
1082227825Stheraventemplate <class _A1, class _A2>
1083227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1084227825Stheraventypename enable_if
1085227825Stheraven<
1086227825Stheraven    is_arithmetic<_A1>::value &&
1087227825Stheraven    is_arithmetic<_A2>::value,
1088227825Stheraven    typename __promote<_A1, _A2>::type
1089227825Stheraven>::type
1090227825Stheravencopysign(_A1 __x, _A2 __y)
1091227825Stheraven{
1092227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1093227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1094227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1095227825Stheraven    return copysign((__result_type)__x, (__result_type)__y);
1096227825Stheraven}
1097227825Stheraven
1098227825Stheraven#ifndef _MSC_VER
1099227825Stheraven
1100227825Stheraven// erf
1101227825Stheraven
1102227825Stheravenusing ::erf;
1103227825Stheravenusing ::erff;
1104227825Stheraven
1105227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       erf(float __x)       {return erff(__x);}
1106227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) {return erfl(__x);}
1107227825Stheraven
1108227825Stheraventemplate <class _A1>
1109227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1110227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1111227825Stheravenerf(_A1 __x) {return erf((double)__x);}
1112227825Stheraven
1113227825Stheraven// erfc
1114227825Stheraven
1115227825Stheravenusing ::erfc;
1116227825Stheravenusing ::erfcf;
1117227825Stheraven
1118227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       erfc(float __x)       {return erfcf(__x);}
1119227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) {return erfcl(__x);}
1120227825Stheraven
1121227825Stheraventemplate <class _A1>
1122227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1123227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1124227825Stheravenerfc(_A1 __x) {return erfc((double)__x);}
1125227825Stheraven
1126227825Stheraven// exp2
1127227825Stheraven
1128227825Stheravenusing ::exp2;
1129227825Stheravenusing ::exp2f;
1130227825Stheraven
1131227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       exp2(float __x)       {return exp2f(__x);}
1132227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) {return exp2l(__x);}
1133227825Stheraven
1134227825Stheraventemplate <class _A1>
1135227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1136227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1137227825Stheravenexp2(_A1 __x) {return exp2((double)__x);}
1138227825Stheraven
1139227825Stheraven// expm1
1140227825Stheraven
1141227825Stheravenusing ::expm1;
1142227825Stheravenusing ::expm1f;
1143227825Stheraven
1144227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       expm1(float __x)       {return expm1f(__x);}
1145227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) {return expm1l(__x);}
1146227825Stheraven
1147227825Stheraventemplate <class _A1>
1148227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1149227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1150227825Stheravenexpm1(_A1 __x) {return expm1((double)__x);}
1151227825Stheraven
1152227825Stheraven// fdim
1153227825Stheraven
1154227825Stheravenusing ::fdim;
1155227825Stheravenusing ::fdimf;
1156227825Stheraven
1157227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fdim(float __x, float __y)             {return fdimf(__x, __y);}
1158227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) {return fdiml(__x, __y);}
1159227825Stheraven
1160227825Stheraventemplate <class _A1, class _A2>
1161227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1162227825Stheraventypename enable_if
1163227825Stheraven<
1164227825Stheraven    is_arithmetic<_A1>::value &&
1165227825Stheraven    is_arithmetic<_A2>::value,
1166227825Stheraven    typename __promote<_A1, _A2>::type
1167227825Stheraven>::type
1168227825Stheravenfdim(_A1 __x, _A2 __y)
1169227825Stheraven{
1170227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1171227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1172227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1173227825Stheraven    return fdim((__result_type)__x, (__result_type)__y);
1174227825Stheraven}
1175227825Stheraven
1176227825Stheraven// fma
1177227825Stheraven
1178227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) {return (float)((double)__x*__y + __z);}
1179227825Stheraven#define FP_FAST_FMAF
1180227825Stheraven
1181227825Stheravenusing ::fma;
1182227825Stheraven
1183227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fma(float __x, float __y, float __z)                   {return fmaf(__x, __y, __z);}
1184227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) {return fmal(__x, __y, __z);}
1185227825Stheraven
1186227825Stheraventemplate <class _A1, class _A2, class _A3>
1187227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1188227825Stheraventypename enable_if
1189227825Stheraven<
1190227825Stheraven    is_arithmetic<_A1>::value &&
1191227825Stheraven    is_arithmetic<_A2>::value &&
1192227825Stheraven    is_arithmetic<_A3>::value,
1193227825Stheraven    typename __promote<_A1, _A2, _A3>::type
1194227825Stheraven>::type
1195227825Stheravenfma(_A1 __x, _A2 __y, _A3 __z)
1196227825Stheraven{
1197227825Stheraven    typedef typename __promote<_A1, _A2, _A3>::type __result_type;
1198227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1199227825Stheraven                      is_same<_A2, __result_type>::value &&
1200227825Stheraven                      is_same<_A3, __result_type>::value)), "");
1201227825Stheraven    return fma((__result_type)__x, (__result_type)__y, (__result_type)__z);
1202227825Stheraven}
1203227825Stheraven
1204227825Stheraven// fmax
1205227825Stheraven
1206227825Stheravenusing ::fmax;
1207227825Stheravenusing ::fmaxf;
1208227825Stheraven
1209227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fmax(float __x, float __y)             {return fmaxf(__x, __y);}
1210227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) {return fmaxl(__x, __y);}
1211227825Stheraven
1212227825Stheraventemplate <class _A1, class _A2>
1213227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1214227825Stheraventypename enable_if
1215227825Stheraven<
1216227825Stheraven    is_arithmetic<_A1>::value &&
1217227825Stheraven    is_arithmetic<_A2>::value,
1218227825Stheraven    typename __promote<_A1, _A2>::type
1219227825Stheraven>::type
1220227825Stheravenfmax(_A1 __x, _A2 __y)
1221227825Stheraven{
1222227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1223227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1224227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1225227825Stheraven    return fmax((__result_type)__x, (__result_type)__y);
1226227825Stheraven}
1227227825Stheraven
1228227825Stheraven// fmin
1229227825Stheraven
1230227825Stheravenusing ::fmin;
1231227825Stheravenusing ::fminf;
1232227825Stheraven
1233227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fmin(float __x, float __y)             {return fminf(__x, __y);}
1234227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) {return fminl(__x, __y);}
1235227825Stheraven
1236227825Stheraventemplate <class _A1, class _A2>
1237227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1238227825Stheraventypename enable_if
1239227825Stheraven<
1240227825Stheraven    is_arithmetic<_A1>::value &&
1241227825Stheraven    is_arithmetic<_A2>::value,
1242227825Stheraven    typename __promote<_A1, _A2>::type
1243227825Stheraven>::type
1244227825Stheravenfmin(_A1 __x, _A2 __y)
1245227825Stheraven{
1246227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1247227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1248227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1249227825Stheraven    return fmin((__result_type)__x, (__result_type)__y);
1250227825Stheraven}
1251227825Stheraven
1252227825Stheraven// hypot
1253227825Stheraven
1254227825Stheravenusing ::hypot;
1255227825Stheravenusing ::hypotf;
1256227825Stheraven
1257227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       hypot(float __x, float __y)             {return hypotf(__x, __y);}
1258227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) {return hypotl(__x, __y);}
1259227825Stheraven
1260227825Stheraventemplate <class _A1, class _A2>
1261227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1262227825Stheraventypename enable_if
1263227825Stheraven<
1264227825Stheraven    is_arithmetic<_A1>::value &&
1265227825Stheraven    is_arithmetic<_A2>::value,
1266227825Stheraven    typename __promote<_A1, _A2>::type
1267227825Stheraven>::type
1268227825Stheravenhypot(_A1 __x, _A2 __y)
1269227825Stheraven{
1270227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1271227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1272227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1273227825Stheraven    return hypot((__result_type)__x, (__result_type)__y);
1274227825Stheraven}
1275227825Stheraven
1276227825Stheraven// ilogb
1277227825Stheraven
1278227825Stheravenusing ::ilogb;
1279227825Stheravenusing ::ilogbf;
1280227825Stheraven
1281227825Stheraveninline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x)       {return ilogbf(__x);}
1282227825Stheraveninline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) {return ilogbl(__x);}
1283227825Stheraven
1284227825Stheraventemplate <class _A1>
1285227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1286227825Stheraventypename enable_if<is_integral<_A1>::value, int>::type
1287227825Stheravenilogb(_A1 __x) {return ilogb((double)__x);}
1288227825Stheraven
1289227825Stheraven// lgamma
1290227825Stheraven
1291227825Stheravenusing ::lgamma;
1292227825Stheravenusing ::lgammaf;
1293227825Stheraven
1294227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       lgamma(float __x)       {return lgammaf(__x);}
1295227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) {return lgammal(__x);}
1296227825Stheraven
1297227825Stheraventemplate <class _A1>
1298227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1299227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1300227825Stheravenlgamma(_A1 __x) {return lgamma((double)__x);}
1301227825Stheraven
1302227825Stheraven// llrint
1303227825Stheraven
1304227825Stheravenusing ::llrint;
1305227825Stheravenusing ::llrintf;
1306227825Stheraven
1307227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x)       {return llrintf(__x);}
1308227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) {return llrintl(__x);}
1309227825Stheraven
1310227825Stheraventemplate <class _A1>
1311227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1312227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type
1313227825Stheravenllrint(_A1 __x) {return llrint((double)__x);}
1314227825Stheraven
1315227825Stheraven// llround
1316227825Stheraven
1317227825Stheravenusing ::llround;
1318227825Stheravenusing ::llroundf;
1319227825Stheraven
1320227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llround(float __x)       {return llroundf(__x);}
1321227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) {return llroundl(__x);}
1322227825Stheraven
1323227825Stheraventemplate <class _A1>
1324227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1325227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type
1326227825Stheravenllround(_A1 __x) {return llround((double)__x);}
1327227825Stheraven
1328227825Stheraven// log1p
1329227825Stheraven
1330227825Stheravenusing ::log1p;
1331227825Stheravenusing ::log1pf;
1332227825Stheraven
1333227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       log1p(float __x)       {return log1pf(__x);}
1334227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) {return log1pl(__x);}
1335227825Stheraven
1336227825Stheraventemplate <class _A1>
1337227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1338227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1339227825Stheravenlog1p(_A1 __x) {return log1p((double)__x);}
1340227825Stheraven
1341227825Stheraven// log2
1342227825Stheraven
1343227825Stheravenusing ::log2;
1344227825Stheravenusing ::log2f;
1345227825Stheraven
1346227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       log2(float __x)       {return log2f(__x);}
1347227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) {return log2l(__x);}
1348227825Stheraven
1349227825Stheraventemplate <class _A1>
1350227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1351227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1352227825Stheravenlog2(_A1 __x) {return log2((double)__x);}
1353227825Stheraven
1354227825Stheraven// logb
1355227825Stheraven
1356227825Stheravenusing ::logb;
1357227825Stheravenusing ::logbf;
1358227825Stheraven
1359227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       logb(float __x)       {return logbf(__x);}
1360227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) {return logbl(__x);}
1361227825Stheraven
1362227825Stheraventemplate <class _A1>
1363227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1364227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1365227825Stheravenlogb(_A1 __x) {return logb((double)__x);}
1366227825Stheraven
1367227825Stheraven// lrint
1368227825Stheraven
1369227825Stheravenusing ::lrint;
1370227825Stheravenusing ::lrintf;
1371227825Stheraven
1372227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lrint(float __x)       {return lrintf(__x);}
1373227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) {return lrintl(__x);}
1374227825Stheraven
1375227825Stheraventemplate <class _A1>
1376227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1377227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type
1378227825Stheravenlrint(_A1 __x) {return lrint((double)__x);}
1379227825Stheraven
1380227825Stheraven// lround
1381227825Stheraven
1382227825Stheravenusing ::lround;
1383227825Stheravenusing ::lroundf;
1384227825Stheraven
1385227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lround(float __x)       {return lroundf(__x);}
1386227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) {return lroundl(__x);}
1387227825Stheraven
1388227825Stheraventemplate <class _A1>
1389227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1390227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type
1391227825Stheravenlround(_A1 __x) {return lround((double)__x);}
1392227825Stheraven
1393227825Stheraven// nan
1394227825Stheraven
1395227825Stheravenusing ::nan;
1396227825Stheravenusing ::nanf;
1397227825Stheraven
1398227825Stheraven// nearbyint
1399227825Stheraven
1400227825Stheravenusing ::nearbyint;
1401227825Stheravenusing ::nearbyintf;
1402227825Stheraven
1403227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       nearbyint(float __x)       {return nearbyintf(__x);}
1404227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) {return nearbyintl(__x);}
1405227825Stheraven
1406227825Stheraventemplate <class _A1>
1407227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1408227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1409227825Stheravennearbyint(_A1 __x) {return nearbyint((double)__x);}
1410227825Stheraven
1411227825Stheraven// nextafter
1412227825Stheraven
1413227825Stheravenusing ::nextafter;
1414227825Stheravenusing ::nextafterf;
1415227825Stheraven
1416227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       nextafter(float __x, float __y)             {return nextafterf(__x, __y);}
1417227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) {return nextafterl(__x, __y);}
1418227825Stheraven
1419227825Stheraventemplate <class _A1, class _A2>
1420227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1421227825Stheraventypename enable_if
1422227825Stheraven<
1423227825Stheraven    is_arithmetic<_A1>::value &&
1424227825Stheraven    is_arithmetic<_A2>::value,
1425227825Stheraven    typename __promote<_A1, _A2>::type
1426227825Stheraven>::type
1427227825Stheravennextafter(_A1 __x, _A2 __y)
1428227825Stheraven{
1429227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1430227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1431227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1432227825Stheraven    return nextafter((__result_type)__x, (__result_type)__y);
1433227825Stheraven}
1434227825Stheraven
1435227825Stheraven// nexttoward
1436227825Stheraven
1437227825Stheravenusing ::nexttoward;
1438227825Stheravenusing ::nexttowardf;
1439227825Stheraven
1440227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       nexttoward(float __x, long double __y)       {return nexttowardf(__x, __y);}
1441227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);}
1442227825Stheraven
1443227825Stheraventemplate <class _A1>
1444227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1445227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1446227825Stheravennexttoward(_A1 __x, long double __y) {return nexttoward((double)__x, __y);}
1447227825Stheraven
1448227825Stheraven// remainder
1449227825Stheraven
1450227825Stheravenusing ::remainder;
1451227825Stheravenusing ::remainderf;
1452227825Stheraven
1453227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       remainder(float __x, float __y)             {return remainderf(__x, __y);}
1454227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) {return remainderl(__x, __y);}
1455227825Stheraven
1456227825Stheraventemplate <class _A1, class _A2>
1457227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1458227825Stheraventypename enable_if
1459227825Stheraven<
1460227825Stheraven    is_arithmetic<_A1>::value &&
1461227825Stheraven    is_arithmetic<_A2>::value,
1462227825Stheraven    typename __promote<_A1, _A2>::type
1463227825Stheraven>::type
1464227825Stheravenremainder(_A1 __x, _A2 __y)
1465227825Stheraven{
1466227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1467227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1468227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1469227825Stheraven    return remainder((__result_type)__x, (__result_type)__y);
1470227825Stheraven}
1471227825Stheraven
1472227825Stheraven// remquo
1473227825Stheraven
1474227825Stheravenusing ::remquo;
1475227825Stheravenusing ::remquof;
1476227825Stheraven
1477227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       remquo(float __x, float __y, int* __z)             {return remquof(__x, __y, __z);}
1478227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) {return remquol(__x, __y, __z);}
1479227825Stheraven
1480227825Stheraventemplate <class _A1, class _A2>
1481227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1482227825Stheraventypename enable_if
1483227825Stheraven<
1484227825Stheraven    is_arithmetic<_A1>::value &&
1485227825Stheraven    is_arithmetic<_A2>::value,
1486227825Stheraven    typename __promote<_A1, _A2>::type
1487227825Stheraven>::type
1488227825Stheravenremquo(_A1 __x, _A2 __y, int* __z)
1489227825Stheraven{
1490227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1491227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1492227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1493227825Stheraven    return remquo((__result_type)__x, (__result_type)__y, __z);
1494227825Stheraven}
1495227825Stheraven
1496227825Stheraven// rint
1497227825Stheraven
1498227825Stheravenusing ::rint;
1499227825Stheravenusing ::rintf;
1500227825Stheraven
1501227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       rint(float __x)       {return rintf(__x);}
1502227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) {return rintl(__x);}
1503227825Stheraven
1504227825Stheraventemplate <class _A1>
1505227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1506227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1507227825Stheravenrint(_A1 __x) {return rint((double)__x);}
1508227825Stheraven
1509227825Stheraven// round
1510227825Stheraven
1511227825Stheravenusing ::round;
1512227825Stheravenusing ::roundf;
1513227825Stheraven
1514227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       round(float __x)       {return roundf(__x);}
1515227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) {return roundl(__x);}
1516227825Stheraven
1517227825Stheraventemplate <class _A1>
1518227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1519227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1520227825Stheravenround(_A1 __x) {return round((double)__x);}
1521227825Stheraven
1522227825Stheraven// scalbln
1523227825Stheraven
1524227825Stheravenusing ::scalbln;
1525227825Stheravenusing ::scalblnf;
1526227825Stheraven
1527227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       scalbln(float __x, long __y)       {return scalblnf(__x, __y);}
1528227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) {return scalblnl(__x, __y);}
1529227825Stheraven
1530227825Stheraventemplate <class _A1>
1531227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1532227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1533227825Stheravenscalbln(_A1 __x, long __y) {return scalbln((double)__x, __y);}
1534227825Stheraven
1535227825Stheraven// scalbn
1536227825Stheraven
1537227825Stheravenusing ::scalbn;
1538227825Stheravenusing ::scalbnf;
1539227825Stheraven
1540227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       scalbn(float __x, int __y)       {return scalbnf(__x, __y);}
1541227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) {return scalbnl(__x, __y);}
1542227825Stheraven
1543227825Stheraventemplate <class _A1>
1544227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1545227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1546227825Stheravenscalbn(_A1 __x, int __y) {return scalbn((double)__x, __y);}
1547227825Stheraven
1548227825Stheraven// tgamma
1549227825Stheraven
1550227825Stheravenusing ::tgamma;
1551227825Stheravenusing ::tgammaf;
1552227825Stheraven
1553227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       tgamma(float __x)       {return tgammaf(__x);}
1554227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) {return tgammal(__x);}
1555227825Stheraven
1556227825Stheraventemplate <class _A1>
1557227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1558227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1559227825Stheraventgamma(_A1 __x) {return tgamma((double)__x);}
1560227825Stheraven
1561227825Stheraven// trunc
1562227825Stheraven
1563227825Stheravenusing ::trunc;
1564227825Stheravenusing ::truncf;
1565227825Stheraven
1566227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       trunc(float __x)       {return truncf(__x);}
1567227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) {return truncl(__x);}
1568227825Stheraven
1569227825Stheraventemplate <class _A1>
1570227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1571227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1572227825Stheraventrunc(_A1 __x) {return trunc((double)__x);}
1573227825Stheraven
1574227825Stheraven#endif // !_MSC_VER
1575227825Stheraven
1576227825Stheravenusing ::acosl;
1577227825Stheravenusing ::asinl;
1578227825Stheravenusing ::atanl;
1579227825Stheravenusing ::atan2l;
1580227825Stheravenusing ::ceill;
1581227825Stheravenusing ::cosl;
1582227825Stheravenusing ::coshl;
1583227825Stheravenusing ::expl;
1584227825Stheravenusing ::fabsl;
1585227825Stheravenusing ::floorl;
1586227825Stheravenusing ::fmodl;
1587227825Stheravenusing ::frexpl;
1588227825Stheravenusing ::ldexpl;
1589227825Stheravenusing ::logl;
1590227825Stheravenusing ::log10l;
1591227825Stheravenusing ::modfl;
1592227825Stheravenusing ::powl;
1593227825Stheravenusing ::sinl;
1594227825Stheravenusing ::sinhl;
1595227825Stheravenusing ::sqrtl;
1596227825Stheravenusing ::tanl;
1597227825Stheraven#ifndef _MSC_VER
1598227825Stheravenusing ::tanhl;
1599227825Stheravenusing ::acoshl;
1600227825Stheravenusing ::asinhl;
1601227825Stheravenusing ::atanhl;
1602227825Stheravenusing ::cbrtl;
1603227825Stheraven#endif !_MSC_VER
1604227825Stheravenusing ::copysignl;
1605227825Stheraven#ifndef _MSC_VER
1606227825Stheravenusing ::erfl;
1607227825Stheravenusing ::erfcl;
1608227825Stheravenusing ::exp2l;
1609227825Stheravenusing ::expm1l;
1610227825Stheravenusing ::fdiml;
1611227825Stheravenusing ::fmal;
1612227825Stheravenusing ::fmaxl;
1613227825Stheravenusing ::fminl;
1614227825Stheravenusing ::hypotl;
1615227825Stheravenusing ::ilogbl;
1616227825Stheravenusing ::lgammal;
1617227825Stheravenusing ::llrintl;
1618227825Stheravenusing ::llroundl;
1619227825Stheravenusing ::log1pl;
1620227825Stheravenusing ::log2l;
1621227825Stheravenusing ::logbl;
1622227825Stheravenusing ::lrintl;
1623227825Stheravenusing ::lroundl;
1624227825Stheravenusing ::nanl;
1625227825Stheravenusing ::nearbyintl;
1626227825Stheravenusing ::nextafterl;
1627227825Stheravenusing ::nexttowardl;
1628227825Stheravenusing ::remainderl;
1629227825Stheravenusing ::remquol;
1630227825Stheravenusing ::rintl;
1631227825Stheravenusing ::roundl;
1632227825Stheravenusing ::scalblnl;
1633227825Stheravenusing ::scalbnl;
1634227825Stheravenusing ::tgammal;
1635227825Stheravenusing ::truncl;
1636227825Stheraven#endif // !_MSC_VER
1637227825Stheraven
1638227825Stheraven_LIBCPP_END_NAMESPACE_STD
1639227825Stheraven
1640227825Stheraven#endif  // _LIBCPP_CMATH
1641