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
140246487Stheravenbool signbit(arithmetic x);
141227825Stheraven
142246487Stheravenint fpclassify(arithmetic x);
143227825Stheraven
144246487Stheravenbool isfinite(arithmetic x);
145246487Stheravenbool isinf(arithmetic x);
146246487Stheravenbool isnan(arithmetic x);
147246487Stheravenbool isnormal(arithmetic x);
148227825Stheraven
149246487Stheravenbool isgreater(arithmetic x, arithmetic y);
150246487Stheravenbool isgreaterequal(arithmetic x, arithmetic y);
151246487Stheravenbool isless(arithmetic x, arithmetic y);
152246487Stheravenbool islessequal(arithmetic x, arithmetic y);
153246487Stheravenbool islessgreater(arithmetic x, arithmetic y);
154246487Stheravenbool isunordered(arithmetic x, arithmetic 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
304262801Sdim#ifdef _LIBCPP_MSVCRT
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
319278724Sdim__libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT
320227825Stheraven{
321278724Sdim    return signbit(__lcpp_x);
322227825Stheraven}
323227825Stheraven
324227825Stheraven#undef signbit
325227825Stheraven
326227825Stheraventemplate <class _A1>
327227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
328246487Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
329278724Sdimsignbit(_A1 __lcpp_x) _NOEXCEPT
330227825Stheraven{
331278724Sdim    return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x);
332227825Stheraven}
333227825Stheraven
334227825Stheraven#endif  // signbit
335227825Stheraven
336227825Stheraven// fpclassify
337227825Stheraven
338227825Stheraven#ifdef fpclassify
339227825Stheraven
340227825Stheraventemplate <class _A1>
341227825Stheraven_LIBCPP_ALWAYS_INLINE
342227825Stheravenint
343278724Sdim__libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT
344227825Stheraven{
345278724Sdim    return fpclassify(__lcpp_x);
346227825Stheraven}
347227825Stheraven
348227825Stheraven#undef fpclassify
349227825Stheraven
350227825Stheraventemplate <class _A1>
351227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
352246487Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, int>::type
353278724Sdimfpclassify(_A1 __lcpp_x) _NOEXCEPT
354227825Stheraven{
355278724Sdim    return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x);
356227825Stheraven}
357227825Stheraven
358227825Stheraven#endif  // fpclassify
359227825Stheraven
360227825Stheraven// isfinite
361227825Stheraven
362227825Stheraven#ifdef isfinite
363227825Stheraven
364227825Stheraventemplate <class _A1>
365227825Stheraven_LIBCPP_ALWAYS_INLINE
366227825Stheravenbool
367278724Sdim__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT
368227825Stheraven{
369278724Sdim    return isfinite(__lcpp_x);
370227825Stheraven}
371227825Stheraven
372227825Stheraven#undef isfinite
373227825Stheraven
374227825Stheraventemplate <class _A1>
375227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
376246487Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
377278724Sdimisfinite(_A1 __lcpp_x) _NOEXCEPT
378227825Stheraven{
379278724Sdim    return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x);
380227825Stheraven}
381227825Stheraven
382227825Stheraven#endif  // isfinite
383227825Stheraven
384227825Stheraven// isinf
385227825Stheraven
386227825Stheraven#ifdef isinf
387227825Stheraven
388227825Stheraventemplate <class _A1>
389227825Stheraven_LIBCPP_ALWAYS_INLINE
390227825Stheravenbool
391278724Sdim__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT
392227825Stheraven{
393278724Sdim    return isinf(__lcpp_x);
394227825Stheraven}
395227825Stheraven
396227825Stheraven#undef isinf
397227825Stheraven
398227825Stheraventemplate <class _A1>
399227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
400246487Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
401278724Sdimisinf(_A1 __lcpp_x) _NOEXCEPT
402227825Stheraven{
403278724Sdim    return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x);
404227825Stheraven}
405227825Stheraven
406227825Stheraven#endif  // isinf
407227825Stheraven
408227825Stheraven// isnan
409227825Stheraven
410227825Stheraven#ifdef isnan
411227825Stheraven
412227825Stheraventemplate <class _A1>
413227825Stheraven_LIBCPP_ALWAYS_INLINE
414227825Stheravenbool
415278724Sdim__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT
416227825Stheraven{
417278724Sdim    return isnan(__lcpp_x);
418227825Stheraven}
419227825Stheraven
420227825Stheraven#undef isnan
421227825Stheraven
422227825Stheraventemplate <class _A1>
423227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
424246487Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
425278724Sdimisnan(_A1 __lcpp_x) _NOEXCEPT
426227825Stheraven{
427278724Sdim    return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x);
428227825Stheraven}
429227825Stheraven
430227825Stheraven#endif  // isnan
431227825Stheraven
432227825Stheraven// isnormal
433227825Stheraven
434227825Stheraven#ifdef isnormal
435227825Stheraven
436227825Stheraventemplate <class _A1>
437227825Stheraven_LIBCPP_ALWAYS_INLINE
438227825Stheravenbool
439278724Sdim__libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT
440227825Stheraven{
441278724Sdim    return isnormal(__lcpp_x);
442227825Stheraven}
443227825Stheraven
444227825Stheraven#undef isnormal
445227825Stheraven
446227825Stheraventemplate <class _A1>
447227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
448246487Stheraventypename std::enable_if<std::is_arithmetic<_A1>::value, bool>::type
449278724Sdimisnormal(_A1 __lcpp_x) _NOEXCEPT
450227825Stheraven{
451278724Sdim    return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x);
452227825Stheraven}
453227825Stheraven
454227825Stheraven#endif  // isnormal
455227825Stheraven
456227825Stheraven// isgreater
457227825Stheraven
458227825Stheraven#ifdef isgreater
459227825Stheraven
460227825Stheraventemplate <class _A1, class _A2>
461227825Stheraven_LIBCPP_ALWAYS_INLINE
462227825Stheravenbool
463278724Sdim__libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
464227825Stheraven{
465278724Sdim    return isgreater(__lcpp_x, __lcpp_y);
466227825Stheraven}
467227825Stheraven
468227825Stheraven#undef isgreater
469227825Stheraven
470227825Stheraventemplate <class _A1, class _A2>
471227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
472227825Stheraventypename std::enable_if
473227825Stheraven<
474246487Stheraven    std::is_arithmetic<_A1>::value &&
475246487Stheraven    std::is_arithmetic<_A2>::value,
476227825Stheraven    bool
477227825Stheraven>::type
478278724Sdimisgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
479227825Stheraven{
480246487Stheraven    typedef typename std::__promote<_A1, _A2>::type type;
481278724Sdim    return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y);
482227825Stheraven}
483227825Stheraven
484227825Stheraven#endif  // isgreater
485227825Stheraven
486227825Stheraven// isgreaterequal
487227825Stheraven
488227825Stheraven#ifdef isgreaterequal
489227825Stheraven
490227825Stheraventemplate <class _A1, class _A2>
491227825Stheraven_LIBCPP_ALWAYS_INLINE
492227825Stheravenbool
493278724Sdim__libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
494227825Stheraven{
495278724Sdim    return isgreaterequal(__lcpp_x, __lcpp_y);
496227825Stheraven}
497227825Stheraven
498227825Stheraven#undef isgreaterequal
499227825Stheraven
500227825Stheraventemplate <class _A1, class _A2>
501227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
502227825Stheraventypename std::enable_if
503227825Stheraven<
504246487Stheraven    std::is_arithmetic<_A1>::value &&
505246487Stheraven    std::is_arithmetic<_A2>::value,
506227825Stheraven    bool
507227825Stheraven>::type
508278724Sdimisgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
509227825Stheraven{
510246487Stheraven    typedef typename std::__promote<_A1, _A2>::type type;
511278724Sdim    return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y);
512227825Stheraven}
513227825Stheraven
514227825Stheraven#endif  // isgreaterequal
515227825Stheraven
516227825Stheraven// isless
517227825Stheraven
518227825Stheraven#ifdef isless
519227825Stheraven
520227825Stheraventemplate <class _A1, class _A2>
521227825Stheraven_LIBCPP_ALWAYS_INLINE
522227825Stheravenbool
523278724Sdim__libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
524227825Stheraven{
525278724Sdim    return isless(__lcpp_x, __lcpp_y);
526227825Stheraven}
527227825Stheraven
528227825Stheraven#undef isless
529227825Stheraven
530227825Stheraventemplate <class _A1, class _A2>
531227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
532227825Stheraventypename std::enable_if
533227825Stheraven<
534246487Stheraven    std::is_arithmetic<_A1>::value &&
535246487Stheraven    std::is_arithmetic<_A2>::value,
536227825Stheraven    bool
537227825Stheraven>::type
538278724Sdimisless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
539227825Stheraven{
540246487Stheraven    typedef typename std::__promote<_A1, _A2>::type type;
541278724Sdim    return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y);
542227825Stheraven}
543227825Stheraven
544227825Stheraven#endif  // isless
545227825Stheraven
546227825Stheraven// islessequal
547227825Stheraven
548227825Stheraven#ifdef islessequal
549227825Stheraven
550227825Stheraventemplate <class _A1, class _A2>
551227825Stheraven_LIBCPP_ALWAYS_INLINE
552227825Stheravenbool
553278724Sdim__libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
554227825Stheraven{
555278724Sdim    return islessequal(__lcpp_x, __lcpp_y);
556227825Stheraven}
557227825Stheraven
558227825Stheraven#undef islessequal
559227825Stheraven
560227825Stheraventemplate <class _A1, class _A2>
561227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
562227825Stheraventypename std::enable_if
563227825Stheraven<
564246487Stheraven    std::is_arithmetic<_A1>::value &&
565246487Stheraven    std::is_arithmetic<_A2>::value,
566227825Stheraven    bool
567227825Stheraven>::type
568278724Sdimislessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
569227825Stheraven{
570246487Stheraven    typedef typename std::__promote<_A1, _A2>::type type;
571278724Sdim    return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y);
572227825Stheraven}
573227825Stheraven
574227825Stheraven#endif  // islessequal
575227825Stheraven
576227825Stheraven// islessgreater
577227825Stheraven
578227825Stheraven#ifdef islessgreater
579227825Stheraven
580227825Stheraventemplate <class _A1, class _A2>
581227825Stheraven_LIBCPP_ALWAYS_INLINE
582227825Stheravenbool
583278724Sdim__libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
584227825Stheraven{
585278724Sdim    return islessgreater(__lcpp_x, __lcpp_y);
586227825Stheraven}
587227825Stheraven
588227825Stheraven#undef islessgreater
589227825Stheraven
590227825Stheraventemplate <class _A1, class _A2>
591227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
592227825Stheraventypename std::enable_if
593227825Stheraven<
594246487Stheraven    std::is_arithmetic<_A1>::value &&
595246487Stheraven    std::is_arithmetic<_A2>::value,
596227825Stheraven    bool
597227825Stheraven>::type
598278724Sdimislessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
599227825Stheraven{
600246487Stheraven    typedef typename std::__promote<_A1, _A2>::type type;
601278724Sdim    return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y);
602227825Stheraven}
603227825Stheraven
604227825Stheraven#endif  // islessgreater
605227825Stheraven
606227825Stheraven// isunordered
607227825Stheraven
608227825Stheraven#ifdef isunordered
609227825Stheraven
610227825Stheraventemplate <class _A1, class _A2>
611227825Stheraven_LIBCPP_ALWAYS_INLINE
612227825Stheravenbool
613278724Sdim__libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
614227825Stheraven{
615278724Sdim    return isunordered(__lcpp_x, __lcpp_y);
616227825Stheraven}
617227825Stheraven
618227825Stheraven#undef isunordered
619227825Stheraven
620227825Stheraventemplate <class _A1, class _A2>
621227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
622227825Stheraventypename std::enable_if
623227825Stheraven<
624246487Stheraven    std::is_arithmetic<_A1>::value &&
625246487Stheraven    std::is_arithmetic<_A2>::value,
626227825Stheraven    bool
627227825Stheraven>::type
628278724Sdimisunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
629227825Stheraven{
630246487Stheraven    typedef typename std::__promote<_A1, _A2>::type type;
631278724Sdim    return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y);
632227825Stheraven}
633227825Stheraven
634227825Stheraven#endif  // isunordered
635227825Stheraven
636227825Stheraven_LIBCPP_BEGIN_NAMESPACE_STD
637227825Stheraven
638227825Stheravenusing ::signbit;
639227825Stheravenusing ::fpclassify;
640227825Stheravenusing ::isfinite;
641227825Stheravenusing ::isinf;
642227825Stheravenusing ::isnan;
643227825Stheravenusing ::isnormal;
644227825Stheravenusing ::isgreater;
645227825Stheravenusing ::isgreaterequal;
646227825Stheravenusing ::isless;
647227825Stheravenusing ::islessequal;
648227825Stheravenusing ::islessgreater;
649227825Stheravenusing ::isunordered;
650227825Stheravenusing ::isunordered;
651227825Stheraven
652227825Stheravenusing ::float_t;
653227825Stheravenusing ::double_t;
654227825Stheraven
655227825Stheraven// abs
656227825Stheraven
657262801Sdim#if !defined(_AIX)
658227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
659234976Stheravenfloat
660278724Sdimabs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);}
661227825Stheraven
662234976Stheraveninline _LIBCPP_INLINE_VISIBILITY
663234976Stheravendouble
664278724Sdimabs(double __lcpp_x) _NOEXCEPT {return fabs(__lcpp_x);}
665234976Stheraven
666234976Stheraveninline _LIBCPP_INLINE_VISIBILITY
667234976Stheravenlong double
668278724Sdimabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
669262801Sdim#endif // !defined(_AIX)
670234976Stheraven
671232950Stheraven#ifndef __sun__
672232950Stheraven
673227825Stheraven// acos
674227825Stheraven
675227825Stheravenusing ::acos;
676227825Stheravenusing ::acosf;
677227825Stheraven
678262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
679278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       acos(float __lcpp_x) _NOEXCEPT       {return acosf(__lcpp_x);}
680278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);}
681227825Stheraven#endif
682227825Stheraven
683227825Stheraventemplate <class _A1>
684227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
685227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
686278724Sdimacos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);}
687227825Stheraven
688227825Stheraven// asin
689227825Stheraven
690227825Stheravenusing ::asin;
691227825Stheravenusing ::asinf;
692227825Stheraven
693262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
694278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       asin(float __lcpp_x) _NOEXCEPT       {return asinf(__lcpp_x);}
695278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return asinl(__lcpp_x);}
696227825Stheraven#endif
697227825Stheraven
698227825Stheraventemplate <class _A1>
699227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
700227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
701278724Sdimasin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);}
702227825Stheraven
703227825Stheraven// atan
704227825Stheraven
705227825Stheravenusing ::atan;
706227825Stheravenusing ::atanf;
707227825Stheraven
708262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
709278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       atan(float __lcpp_x) _NOEXCEPT       {return atanf(__lcpp_x);}
710278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return atanl(__lcpp_x);}
711227825Stheraven#endif
712227825Stheraven
713227825Stheraventemplate <class _A1>
714227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
715227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
716278724Sdimatan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);}
717227825Stheraven
718227825Stheraven// atan2
719227825Stheraven
720227825Stheravenusing ::atan2;
721227825Stheravenusing ::atan2f;
722227825Stheraven
723262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
724278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT             {return atan2f(__lcpp_y, __lcpp_x);}
725278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return atan2l(__lcpp_y, __lcpp_x);}
726227825Stheraven#endif
727227825Stheraven
728227825Stheraventemplate <class _A1, class _A2>
729227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
730278724Sdimtypename __lazy_enable_if
731227825Stheraven<
732227825Stheraven    is_arithmetic<_A1>::value &&
733227825Stheraven    is_arithmetic<_A2>::value,
734278724Sdim    __promote<_A1, _A2>
735227825Stheraven>::type
736278724Sdimatan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT
737227825Stheraven{
738227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
739227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
740227825Stheraven                      is_same<_A2, __result_type>::value)), "");
741278724Sdim    return atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x);
742227825Stheraven}
743227825Stheraven
744227825Stheraven// ceil
745227825Stheraven
746227825Stheravenusing ::ceil;
747227825Stheravenusing ::ceilf;
748227825Stheraven
749262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
750278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       ceil(float __lcpp_x) _NOEXCEPT       {return ceilf(__lcpp_x);}
751278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ceill(__lcpp_x);}
752227825Stheraven#endif
753227825Stheraven
754227825Stheraventemplate <class _A1>
755227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
756227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
757278724Sdimceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);}
758227825Stheraven
759227825Stheraven// cos
760227825Stheraven
761227825Stheravenusing ::cos;
762227825Stheravenusing ::cosf;
763227825Stheraven
764262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
765278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       cos(float __lcpp_x) _NOEXCEPT       {return cosf(__lcpp_x);}
766278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return cosl(__lcpp_x);}
767227825Stheraven#endif
768227825Stheraven
769227825Stheraventemplate <class _A1>
770262801Sdiminline _LIBCPP_INLINE_VISIBILITY
771227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
772278724Sdimcos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);}
773227825Stheraven
774227825Stheraven// cosh
775227825Stheraven
776227825Stheravenusing ::cosh;
777227825Stheravenusing ::coshf;
778227825Stheraven
779262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
780278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       cosh(float __lcpp_x) _NOEXCEPT       {return coshf(__lcpp_x);}
781278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return coshl(__lcpp_x);}
782227825Stheraven#endif
783227825Stheraven
784227825Stheraventemplate <class _A1>
785227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
786227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
787278724Sdimcosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);}
788227825Stheraven
789232950Stheraven#endif // __sun__
790227825Stheraven// exp
791227825Stheraven
792227825Stheravenusing ::exp;
793227825Stheravenusing ::expf;
794227825Stheraven
795232950Stheraven#ifndef __sun__
796232950Stheraven
797262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
798278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       exp(float __lcpp_x) _NOEXCEPT       {return expf(__lcpp_x);}
799278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return expl(__lcpp_x);}
800227825Stheraven#endif
801227825Stheraven
802232950Stheraven
803227825Stheraventemplate <class _A1>
804227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
805227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
806278724Sdimexp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);}
807227825Stheraven
808227825Stheraven// fabs
809227825Stheraven
810227825Stheravenusing ::fabs;
811227825Stheravenusing ::fabsf;
812227825Stheraven
813262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
814278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       fabs(float __lcpp_x) _NOEXCEPT       {return fabsf(__lcpp_x);}
815278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);}
816227825Stheraven#endif
817227825Stheraven
818227825Stheraventemplate <class _A1>
819227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
820227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
821278724Sdimfabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);}
822227825Stheraven
823227825Stheraven// floor
824227825Stheraven
825227825Stheravenusing ::floor;
826227825Stheravenusing ::floorf;
827227825Stheraven
828262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
829278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       floor(float __lcpp_x) _NOEXCEPT       {return floorf(__lcpp_x);}
830278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return floorl(__lcpp_x);}
831227825Stheraven#endif
832227825Stheraven
833227825Stheraventemplate <class _A1>
834227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
835227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
836278724Sdimfloor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);}
837227825Stheraven
838227825Stheraven// fmod
839227825Stheraven
840232950Stheraven#endif //__sun__
841227825Stheravenusing ::fmod;
842227825Stheravenusing ::fmodf;
843232950Stheraven#ifndef __sun__
844227825Stheraven
845262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
846278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return fmodf(__lcpp_x, __lcpp_y);}
847278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmodl(__lcpp_x, __lcpp_y);}
848227825Stheraven#endif
849227825Stheraven
850227825Stheraventemplate <class _A1, class _A2>
851227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
852278724Sdimtypename __lazy_enable_if
853227825Stheraven<
854227825Stheraven    is_arithmetic<_A1>::value &&
855227825Stheraven    is_arithmetic<_A2>::value,
856278724Sdim    __promote<_A1, _A2>
857227825Stheraven>::type
858278724Sdimfmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
859227825Stheraven{
860227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
861227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
862227825Stheraven                      is_same<_A2, __result_type>::value)), "");
863278724Sdim    return fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y);
864227825Stheraven}
865227825Stheraven
866232950Stheraven
867227825Stheraven// frexp
868227825Stheraven
869227825Stheravenusing ::frexp;
870227825Stheravenusing ::frexpf;
871227825Stheraven
872262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
873278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT       {return frexpf(__lcpp_x, __lcpp_e);}
874278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpl(__lcpp_x, __lcpp_e);}
875227825Stheraven#endif
876227825Stheraven
877227825Stheraventemplate <class _A1>
878227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
879227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
880278724Sdimfrexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __lcpp_e);}
881227825Stheraven
882227825Stheraven// ldexp
883227825Stheraven
884227825Stheravenusing ::ldexp;
885227825Stheravenusing ::ldexpf;
886227825Stheraven
887262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
888278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT       {return ldexpf(__lcpp_x, __lcpp_e);}
889278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpl(__lcpp_x, __lcpp_e);}
890227825Stheraven#endif
891227825Stheraven
892227825Stheraventemplate <class _A1>
893227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
894227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
895278724Sdimldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lcpp_e);}
896227825Stheraven
897227825Stheraven// log
898227825Stheraven
899232950Stheraven#endif // __sun__
900227825Stheravenusing ::log;
901227825Stheravenusing ::logf;
902232950Stheraven#ifndef __sun__
903227825Stheraven
904262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
905278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       log(float __lcpp_x) _NOEXCEPT       {return logf(__lcpp_x);}
906278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return logl(__lcpp_x);}
907227825Stheraven#endif
908227825Stheraven
909227825Stheraventemplate <class _A1>
910227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
911227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
912278724Sdimlog(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);}
913227825Stheraven
914232950Stheraven
915227825Stheraven// log10
916227825Stheraven
917227825Stheravenusing ::log10;
918227825Stheravenusing ::log10f;
919227825Stheraven
920262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
921278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       log10(float __lcpp_x) _NOEXCEPT       {return log10f(__lcpp_x);}
922278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return log10l(__lcpp_x);}
923227825Stheraven#endif
924227825Stheraven
925227825Stheraventemplate <class _A1>
926227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
927227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
928278724Sdimlog10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);}
929227825Stheraven
930227825Stheraven// modf
931227825Stheraven
932227825Stheravenusing ::modf;
933227825Stheravenusing ::modff;
934227825Stheraven
935262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
936278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT             {return modff(__lcpp_x, __lcpp_y);}
937278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return modfl(__lcpp_x, __lcpp_y);}
938227825Stheraven#endif
939227825Stheraven
940227825Stheraven// pow
941227825Stheraven
942232950Stheraven#endif // __sun__ 
943227825Stheravenusing ::pow;
944227825Stheravenusing ::powf;
945227825Stheraven
946232950Stheraven#ifndef __sun__
947232950Stheraven
948262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
949278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return powf(__lcpp_x, __lcpp_y);}
950278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return powl(__lcpp_x, __lcpp_y);}
951227825Stheraven#endif
952227825Stheraven
953227825Stheraventemplate <class _A1, class _A2>
954227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
955278724Sdimtypename __lazy_enable_if
956227825Stheraven<
957227825Stheraven    is_arithmetic<_A1>::value &&
958227825Stheraven    is_arithmetic<_A2>::value,
959278724Sdim    __promote<_A1, _A2>
960227825Stheraven>::type
961278724Sdimpow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
962227825Stheraven{
963227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
964227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
965227825Stheraven                      is_same<_A2, __result_type>::value)), "");
966278724Sdim    return pow((__result_type)__lcpp_x, (__result_type)__lcpp_y);
967227825Stheraven}
968227825Stheraven
969227825Stheraven// sin
970227825Stheraven
971227825Stheravenusing ::sin;
972227825Stheravenusing ::sinf;
973227825Stheraven
974262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
975278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       sin(float __lcpp_x) _NOEXCEPT       {return sinf(__lcpp_x);}
976278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return sinl(__lcpp_x);}
977227825Stheraven#endif
978227825Stheraven
979227825Stheraventemplate <class _A1>
980227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
981227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
982278724Sdimsin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);}
983227825Stheraven
984227825Stheraven// sinh
985227825Stheraven
986227825Stheravenusing ::sinh;
987227825Stheravenusing ::sinhf;
988227825Stheraven
989262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
990278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       sinh(float __lcpp_x) _NOEXCEPT       {return sinhf(__lcpp_x);}
991278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return sinhl(__lcpp_x);}
992227825Stheraven#endif
993227825Stheraven
994227825Stheraventemplate <class _A1>
995227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
996227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
997278724Sdimsinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);}
998227825Stheraven
999227825Stheraven// sqrt
1000227825Stheraven
1001232950Stheraven#endif // __sun__
1002227825Stheravenusing ::sqrt;
1003227825Stheravenusing ::sqrtf;
1004227825Stheraven
1005232950Stheraven
1006262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX))
1007278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       sqrt(float __lcpp_x) _NOEXCEPT       {return sqrtf(__lcpp_x);}
1008278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return sqrtl(__lcpp_x);}
1009227825Stheraven#endif
1010227825Stheraven
1011227825Stheraventemplate <class _A1>
1012227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1013227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1014278724Sdimsqrt(_A1 __lcpp_x) _NOEXCEPT {return sqrt((double)__lcpp_x);}
1015227825Stheraven
1016227825Stheraven// tan
1017227825Stheraven
1018227825Stheravenusing ::tan;
1019227825Stheravenusing ::tanf;
1020232950Stheraven#ifndef __sun__
1021227825Stheraven
1022262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
1023278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       tan(float __lcpp_x) _NOEXCEPT       {return tanf(__lcpp_x);}
1024278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return tanl(__lcpp_x);}
1025227825Stheraven#endif
1026227825Stheraven
1027227825Stheraventemplate <class _A1>
1028227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1029227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1030278724Sdimtan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);}
1031227825Stheraven
1032227825Stheraven// tanh
1033227825Stheraven
1034227825Stheravenusing ::tanh;
1035227825Stheravenusing ::tanhf;
1036227825Stheraven
1037262801Sdim#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX))
1038278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       tanh(float __lcpp_x) _NOEXCEPT       {return tanhf(__lcpp_x);}
1039278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return tanhl(__lcpp_x);}
1040227825Stheraven#endif
1041227825Stheraven
1042227825Stheraventemplate <class _A1>
1043227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1044227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1045278724Sdimtanh(_A1 __lcpp_x) _NOEXCEPT {return tanh((double)__lcpp_x);}
1046227825Stheraven
1047227825Stheraven// acosh
1048227825Stheraven
1049262801Sdim#ifndef _LIBCPP_MSVCRT
1050227825Stheravenusing ::acosh;
1051227825Stheravenusing ::acoshf;
1052227825Stheraven
1053278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       acosh(float __lcpp_x) _NOEXCEPT       {return acoshf(__lcpp_x);}
1054278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return acoshl(__lcpp_x);}
1055227825Stheraven
1056227825Stheraventemplate <class _A1>
1057227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1058227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1059278724Sdimacosh(_A1 __lcpp_x) _NOEXCEPT {return acosh((double)__lcpp_x);}
1060227825Stheraven#endif
1061227825Stheraven
1062227825Stheraven// asinh
1063227825Stheraven
1064262801Sdim#ifndef _LIBCPP_MSVCRT
1065227825Stheravenusing ::asinh;
1066227825Stheravenusing ::asinhf;
1067227825Stheraven
1068278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       asinh(float __lcpp_x) _NOEXCEPT       {return asinhf(__lcpp_x);}
1069278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return asinhl(__lcpp_x);}
1070227825Stheraven
1071227825Stheraventemplate <class _A1>
1072227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1073227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1074278724Sdimasinh(_A1 __lcpp_x) _NOEXCEPT {return asinh((double)__lcpp_x);}
1075227825Stheraven#endif
1076227825Stheraven
1077227825Stheraven// atanh
1078227825Stheraven
1079262801Sdim#ifndef _LIBCPP_MSVCRT
1080227825Stheravenusing ::atanh;
1081227825Stheravenusing ::atanhf;
1082227825Stheraven
1083278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       atanh(float __lcpp_x) _NOEXCEPT       {return atanhf(__lcpp_x);}
1084278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return atanhl(__lcpp_x);}
1085227825Stheraven
1086227825Stheraventemplate <class _A1>
1087227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1088227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1089278724Sdimatanh(_A1 __lcpp_x) _NOEXCEPT {return atanh((double)__lcpp_x);}
1090227825Stheraven#endif
1091227825Stheraven
1092227825Stheraven// cbrt
1093227825Stheraven
1094262801Sdim#ifndef _LIBCPP_MSVCRT
1095227825Stheravenusing ::cbrt;
1096227825Stheravenusing ::cbrtf;
1097227825Stheraven
1098278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       cbrt(float __lcpp_x) _NOEXCEPT       {return cbrtf(__lcpp_x);}
1099278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return cbrtl(__lcpp_x);}
1100227825Stheraven
1101227825Stheraventemplate <class _A1>
1102227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1103227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1104278724Sdimcbrt(_A1 __lcpp_x) _NOEXCEPT {return cbrt((double)__lcpp_x);}
1105227825Stheraven#endif
1106227825Stheraven
1107227825Stheraven// copysign
1108227825Stheraven
1109227825Stheravenusing ::copysign;
1110227825Stheravenusing ::copysignf;
1111227825Stheraven
1112278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       copysign(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return copysignf(__lcpp_x, __lcpp_y);}
1113278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return copysignl(__lcpp_x, __lcpp_y);}
1114227825Stheraven
1115227825Stheraventemplate <class _A1, class _A2>
1116227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1117278724Sdimtypename __lazy_enable_if
1118227825Stheraven<
1119227825Stheraven    is_arithmetic<_A1>::value &&
1120227825Stheraven    is_arithmetic<_A2>::value,
1121278724Sdim    __promote<_A1, _A2>
1122227825Stheraven>::type
1123278724Sdimcopysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1124227825Stheraven{
1125227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1126227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1127227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1128278724Sdim    return copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1129227825Stheraven}
1130227825Stheraven
1131262801Sdim#ifndef _LIBCPP_MSVCRT
1132227825Stheraven
1133227825Stheraven// erf
1134227825Stheraven
1135227825Stheravenusing ::erf;
1136227825Stheravenusing ::erff;
1137227825Stheraven
1138278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       erf(float __lcpp_x) _NOEXCEPT       {return erff(__lcpp_x);}
1139278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return erfl(__lcpp_x);}
1140227825Stheraven
1141227825Stheraventemplate <class _A1>
1142227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1143227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1144278724Sdimerf(_A1 __lcpp_x) _NOEXCEPT {return erf((double)__lcpp_x);}
1145227825Stheraven
1146227825Stheraven// erfc
1147227825Stheraven
1148227825Stheravenusing ::erfc;
1149227825Stheravenusing ::erfcf;
1150227825Stheraven
1151278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       erfc(float __lcpp_x) _NOEXCEPT       {return erfcf(__lcpp_x);}
1152278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return erfcl(__lcpp_x);}
1153227825Stheraven
1154227825Stheraventemplate <class _A1>
1155227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1156227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1157278724Sdimerfc(_A1 __lcpp_x) _NOEXCEPT {return erfc((double)__lcpp_x);}
1158227825Stheraven
1159227825Stheraven// exp2
1160227825Stheraven
1161227825Stheravenusing ::exp2;
1162227825Stheravenusing ::exp2f;
1163227825Stheraven
1164278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       exp2(float __lcpp_x) _NOEXCEPT       {return exp2f(__lcpp_x);}
1165278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return exp2l(__lcpp_x);}
1166227825Stheraven
1167227825Stheraventemplate <class _A1>
1168227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1169227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1170278724Sdimexp2(_A1 __lcpp_x) _NOEXCEPT {return exp2((double)__lcpp_x);}
1171227825Stheraven
1172227825Stheraven// expm1
1173227825Stheraven
1174227825Stheravenusing ::expm1;
1175227825Stheravenusing ::expm1f;
1176227825Stheraven
1177278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       expm1(float __lcpp_x) _NOEXCEPT       {return expm1f(__lcpp_x);}
1178278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return expm1l(__lcpp_x);}
1179227825Stheraven
1180227825Stheraventemplate <class _A1>
1181227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1182227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1183278724Sdimexpm1(_A1 __lcpp_x) _NOEXCEPT {return expm1((double)__lcpp_x);}
1184227825Stheraven
1185227825Stheraven// fdim
1186227825Stheraven
1187227825Stheravenusing ::fdim;
1188227825Stheravenusing ::fdimf;
1189227825Stheraven
1190278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return fdimf(__lcpp_x, __lcpp_y);}
1191278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fdiml(__lcpp_x, __lcpp_y);}
1192227825Stheraven
1193227825Stheraventemplate <class _A1, class _A2>
1194227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1195278724Sdimtypename __lazy_enable_if
1196227825Stheraven<
1197227825Stheraven    is_arithmetic<_A1>::value &&
1198227825Stheraven    is_arithmetic<_A2>::value,
1199278724Sdim    __promote<_A1, _A2>
1200227825Stheraven>::type
1201278724Sdimfdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1202227825Stheraven{
1203227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1204227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1205227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1206278724Sdim    return fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1207227825Stheraven}
1208227825Stheraven
1209227825Stheraven// fma
1210227825Stheraven
1211278724Sdimusing ::fmaf;
1212227825Stheravenusing ::fma;
1213227825Stheraven
1214278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT                   {return fmaf(__lcpp_x, __lcpp_y, __lcpp_z);}
1215278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return fmal(__lcpp_x, __lcpp_y, __lcpp_z);}
1216227825Stheraven
1217227825Stheraventemplate <class _A1, class _A2, class _A3>
1218227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1219278724Sdimtypename __lazy_enable_if
1220227825Stheraven<
1221227825Stheraven    is_arithmetic<_A1>::value &&
1222227825Stheraven    is_arithmetic<_A2>::value &&
1223227825Stheraven    is_arithmetic<_A3>::value,
1224278724Sdim    __promote<_A1, _A2, _A3>
1225227825Stheraven>::type
1226278724Sdimfma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT
1227227825Stheraven{
1228227825Stheraven    typedef typename __promote<_A1, _A2, _A3>::type __result_type;
1229227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1230227825Stheraven                      is_same<_A2, __result_type>::value &&
1231227825Stheraven                      is_same<_A3, __result_type>::value)), "");
1232278724Sdim    return fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z);
1233227825Stheraven}
1234227825Stheraven
1235227825Stheraven// fmax
1236227825Stheraven
1237227825Stheravenusing ::fmax;
1238227825Stheravenusing ::fmaxf;
1239227825Stheraven
1240278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return fmaxf(__lcpp_x, __lcpp_y);}
1241278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmaxl(__lcpp_x, __lcpp_y);}
1242227825Stheraven
1243227825Stheraventemplate <class _A1, class _A2>
1244227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1245278724Sdimtypename __lazy_enable_if
1246227825Stheraven<
1247227825Stheraven    is_arithmetic<_A1>::value &&
1248227825Stheraven    is_arithmetic<_A2>::value,
1249278724Sdim    __promote<_A1, _A2>
1250227825Stheraven>::type
1251278724Sdimfmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1252227825Stheraven{
1253227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1254227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1255227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1256278724Sdim    return fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1257227825Stheraven}
1258227825Stheraven
1259227825Stheraven// fmin
1260227825Stheraven
1261227825Stheravenusing ::fmin;
1262227825Stheravenusing ::fminf;
1263227825Stheraven
1264278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return fminf(__lcpp_x, __lcpp_y);}
1265278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fminl(__lcpp_x, __lcpp_y);}
1266227825Stheraven
1267227825Stheraventemplate <class _A1, class _A2>
1268227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1269278724Sdimtypename __lazy_enable_if
1270227825Stheraven<
1271227825Stheraven    is_arithmetic<_A1>::value &&
1272227825Stheraven    is_arithmetic<_A2>::value,
1273278724Sdim    __promote<_A1, _A2>
1274227825Stheraven>::type
1275278724Sdimfmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1276227825Stheraven{
1277227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1278227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1279227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1280278724Sdim    return fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1281227825Stheraven}
1282227825Stheraven
1283227825Stheraven// hypot
1284227825Stheraven
1285227825Stheravenusing ::hypot;
1286227825Stheravenusing ::hypotf;
1287227825Stheraven
1288278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return hypotf(__lcpp_x, __lcpp_y);}
1289278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return hypotl(__lcpp_x, __lcpp_y);}
1290227825Stheraven
1291227825Stheraventemplate <class _A1, class _A2>
1292227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1293278724Sdimtypename __lazy_enable_if
1294227825Stheraven<
1295227825Stheraven    is_arithmetic<_A1>::value &&
1296227825Stheraven    is_arithmetic<_A2>::value,
1297278724Sdim    __promote<_A1, _A2>
1298227825Stheraven>::type
1299278724Sdimhypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1300227825Stheraven{
1301227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1302227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1303227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1304278724Sdim    return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1305227825Stheraven}
1306227825Stheraven
1307227825Stheraven// ilogb
1308227825Stheraven
1309227825Stheravenusing ::ilogb;
1310227825Stheravenusing ::ilogbf;
1311227825Stheraven
1312278724Sdiminline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT       {return ilogbf(__lcpp_x);}
1313278724Sdiminline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ilogbl(__lcpp_x);}
1314227825Stheraven
1315227825Stheraventemplate <class _A1>
1316227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1317227825Stheraventypename enable_if<is_integral<_A1>::value, int>::type
1318278724Sdimilogb(_A1 __lcpp_x) _NOEXCEPT {return ilogb((double)__lcpp_x);}
1319227825Stheraven
1320227825Stheraven// lgamma
1321227825Stheraven
1322227825Stheravenusing ::lgamma;
1323227825Stheravenusing ::lgammaf;
1324227825Stheraven
1325278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       lgamma(float __lcpp_x) _NOEXCEPT       {return lgammaf(__lcpp_x);}
1326278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return lgammal(__lcpp_x);}
1327227825Stheraven
1328232950Stheraven
1329227825Stheraventemplate <class _A1>
1330227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1331227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1332278724Sdimlgamma(_A1 __lcpp_x) _NOEXCEPT {return lgamma((double)__lcpp_x);}
1333227825Stheraven
1334232950Stheraven
1335227825Stheraven// llrint
1336227825Stheraven
1337227825Stheravenusing ::llrint;
1338227825Stheravenusing ::llrintf;
1339227825Stheraven
1340278724Sdiminline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT       {return llrintf(__lcpp_x);}
1341278724Sdiminline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return llrintl(__lcpp_x);}
1342227825Stheraven
1343227825Stheraventemplate <class _A1>
1344227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1345227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type
1346278724Sdimllrint(_A1 __lcpp_x) _NOEXCEPT {return llrint((double)__lcpp_x);}
1347227825Stheraven
1348227825Stheraven// llround
1349227825Stheraven
1350227825Stheravenusing ::llround;
1351227825Stheravenusing ::llroundf;
1352227825Stheraven
1353278724Sdiminline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT       {return llroundf(__lcpp_x);}
1354278724Sdiminline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return llroundl(__lcpp_x);}
1355227825Stheraven
1356227825Stheraventemplate <class _A1>
1357227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1358227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type
1359278724Sdimllround(_A1 __lcpp_x) _NOEXCEPT {return llround((double)__lcpp_x);}
1360227825Stheraven
1361227825Stheraven// log1p
1362227825Stheraven
1363227825Stheravenusing ::log1p;
1364227825Stheravenusing ::log1pf;
1365227825Stheraven
1366278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       log1p(float __lcpp_x) _NOEXCEPT       {return log1pf(__lcpp_x);}
1367278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return log1pl(__lcpp_x);}
1368227825Stheraven
1369227825Stheraventemplate <class _A1>
1370227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1371227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1372278724Sdimlog1p(_A1 __lcpp_x) _NOEXCEPT {return log1p((double)__lcpp_x);}
1373227825Stheraven
1374227825Stheraven// log2
1375227825Stheraven
1376227825Stheravenusing ::log2;
1377227825Stheravenusing ::log2f;
1378227825Stheraven
1379278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       log2(float __lcpp_x) _NOEXCEPT       {return log2f(__lcpp_x);}
1380278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return log2l(__lcpp_x);}
1381227825Stheraven
1382227825Stheraventemplate <class _A1>
1383227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1384227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1385278724Sdimlog2(_A1 __lcpp_x) _NOEXCEPT {return log2((double)__lcpp_x);}
1386227825Stheraven
1387227825Stheraven// logb
1388227825Stheraven
1389227825Stheravenusing ::logb;
1390227825Stheravenusing ::logbf;
1391227825Stheraven
1392278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       logb(float __lcpp_x) _NOEXCEPT       {return logbf(__lcpp_x);}
1393278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return logbl(__lcpp_x);}
1394227825Stheraven
1395227825Stheraventemplate <class _A1>
1396227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1397227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1398278724Sdimlogb(_A1 __lcpp_x) _NOEXCEPT {return logb((double)__lcpp_x);}
1399227825Stheraven
1400227825Stheraven// lrint
1401227825Stheraven
1402227825Stheravenusing ::lrint;
1403227825Stheravenusing ::lrintf;
1404227825Stheraven
1405278724Sdiminline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT       {return lrintf(__lcpp_x);}
1406278724Sdiminline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return lrintl(__lcpp_x);}
1407227825Stheraven
1408227825Stheraventemplate <class _A1>
1409227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1410227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type
1411278724Sdimlrint(_A1 __lcpp_x) _NOEXCEPT {return lrint((double)__lcpp_x);}
1412227825Stheraven
1413227825Stheraven// lround
1414227825Stheraven
1415227825Stheravenusing ::lround;
1416227825Stheravenusing ::lroundf;
1417227825Stheraven
1418278724Sdiminline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT       {return lroundf(__lcpp_x);}
1419278724Sdiminline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return lroundl(__lcpp_x);}
1420227825Stheraven
1421227825Stheraventemplate <class _A1>
1422227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1423227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type
1424278724Sdimlround(_A1 __lcpp_x) _NOEXCEPT {return lround((double)__lcpp_x);}
1425227825Stheraven
1426262801Sdim#endif // _LIBCPP_MSVCRT
1427262801Sdim#endif // __sun__
1428262801Sdim
1429227825Stheraven// nan
1430262801Sdim
1431262801Sdim#ifndef _LIBCPP_MSVCRT
1432227825Stheravenusing ::nan;
1433227825Stheravenusing ::nanf;
1434262801Sdim#endif // _LIBCPP_MSVCRT
1435262801Sdim
1436232950Stheraven#ifndef __sun__
1437262801Sdim#ifndef _LIBCPP_MSVCRT
1438227825Stheraven
1439227825Stheraven// nearbyint
1440227825Stheraven
1441227825Stheravenusing ::nearbyint;
1442227825Stheravenusing ::nearbyintf;
1443227825Stheraven
1444278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       nearbyint(float __lcpp_x) _NOEXCEPT       {return nearbyintf(__lcpp_x);}
1445278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return nearbyintl(__lcpp_x);}
1446227825Stheraven
1447227825Stheraventemplate <class _A1>
1448227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1449227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1450278724Sdimnearbyint(_A1 __lcpp_x) _NOEXCEPT {return nearbyint((double)__lcpp_x);}
1451227825Stheraven
1452227825Stheraven// nextafter
1453227825Stheraven
1454227825Stheravenusing ::nextafter;
1455227825Stheravenusing ::nextafterf;
1456227825Stheraven
1457278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return nextafterf(__lcpp_x, __lcpp_y);}
1458278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nextafterl(__lcpp_x, __lcpp_y);}
1459227825Stheraven
1460227825Stheraventemplate <class _A1, class _A2>
1461227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1462278724Sdimtypename __lazy_enable_if
1463227825Stheraven<
1464227825Stheraven    is_arithmetic<_A1>::value &&
1465227825Stheraven    is_arithmetic<_A2>::value,
1466278724Sdim    __promote<_A1, _A2>
1467227825Stheraven>::type
1468278724Sdimnextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1469227825Stheraven{
1470227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1471227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1472227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1473278724Sdim    return nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1474227825Stheraven}
1475227825Stheraven
1476227825Stheraven// nexttoward
1477227825Stheraven
1478227825Stheravenusing ::nexttoward;
1479227825Stheravenusing ::nexttowardf;
1480227825Stheraven
1481278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT       {return nexttowardf(__lcpp_x, __lcpp_y);}
1482278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardl(__lcpp_x, __lcpp_y);}
1483227825Stheraven
1484227825Stheraventemplate <class _A1>
1485227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1486227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1487278724Sdimnexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttoward((double)__lcpp_x, __lcpp_y);}
1488227825Stheraven
1489227825Stheraven// remainder
1490227825Stheraven
1491227825Stheravenusing ::remainder;
1492227825Stheravenusing ::remainderf;
1493227825Stheraven
1494278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT             {return remainderf(__lcpp_x, __lcpp_y);}
1495278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return remainderl(__lcpp_x, __lcpp_y);}
1496227825Stheraven
1497227825Stheraventemplate <class _A1, class _A2>
1498227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1499278724Sdimtypename __lazy_enable_if
1500227825Stheraven<
1501227825Stheraven    is_arithmetic<_A1>::value &&
1502227825Stheraven    is_arithmetic<_A2>::value,
1503278724Sdim    __promote<_A1, _A2>
1504227825Stheraven>::type
1505278724Sdimremainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT
1506227825Stheraven{
1507227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1508227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1509227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1510278724Sdim    return remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y);
1511227825Stheraven}
1512227825Stheraven
1513227825Stheraven// remquo
1514227825Stheraven
1515227825Stheravenusing ::remquo;
1516227825Stheravenusing ::remquof;
1517227825Stheraven
1518278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT             {return remquof(__lcpp_x, __lcpp_y, __lcpp_z);}
1519278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquol(__lcpp_x, __lcpp_y, __lcpp_z);}
1520227825Stheraven
1521227825Stheraventemplate <class _A1, class _A2>
1522227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1523278724Sdimtypename __lazy_enable_if
1524227825Stheraven<
1525227825Stheraven    is_arithmetic<_A1>::value &&
1526227825Stheraven    is_arithmetic<_A2>::value,
1527278724Sdim    __promote<_A1, _A2>
1528227825Stheraven>::type
1529278724Sdimremquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT
1530227825Stheraven{
1531227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1532227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1533227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1534278724Sdim    return remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z);
1535227825Stheraven}
1536227825Stheraven
1537227825Stheraven// rint
1538227825Stheraven
1539227825Stheravenusing ::rint;
1540227825Stheravenusing ::rintf;
1541227825Stheraven
1542278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       rint(float __lcpp_x) _NOEXCEPT       {return rintf(__lcpp_x);}
1543278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return rintl(__lcpp_x);}
1544227825Stheraven
1545227825Stheraventemplate <class _A1>
1546227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1547227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1548278724Sdimrint(_A1 __lcpp_x) _NOEXCEPT {return rint((double)__lcpp_x);}
1549227825Stheraven
1550227825Stheraven// round
1551227825Stheraven
1552227825Stheravenusing ::round;
1553227825Stheravenusing ::roundf;
1554227825Stheraven
1555278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       round(float __lcpp_x) _NOEXCEPT       {return roundf(__lcpp_x);}
1556278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return roundl(__lcpp_x);}
1557227825Stheraven
1558227825Stheraventemplate <class _A1>
1559227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1560227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1561278724Sdimround(_A1 __lcpp_x) _NOEXCEPT {return round((double)__lcpp_x);}
1562227825Stheraven
1563227825Stheraven// scalbln
1564227825Stheraven
1565227825Stheravenusing ::scalbln;
1566227825Stheravenusing ::scalblnf;
1567227825Stheraven
1568278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT       {return scalblnf(__lcpp_x, __lcpp_y);}
1569278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnl(__lcpp_x, __lcpp_y);}
1570227825Stheraven
1571227825Stheraventemplate <class _A1>
1572227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1573227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1574278724Sdimscalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalbln((double)__lcpp_x, __lcpp_y);}
1575227825Stheraven
1576227825Stheraven// scalbn
1577227825Stheraven
1578227825Stheravenusing ::scalbn;
1579227825Stheravenusing ::scalbnf;
1580227825Stheraven
1581278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT       {return scalbnf(__lcpp_x, __lcpp_y);}
1582278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnl(__lcpp_x, __lcpp_y);}
1583227825Stheraven
1584227825Stheraventemplate <class _A1>
1585227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1586227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1587278724Sdimscalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbn((double)__lcpp_x, __lcpp_y);}
1588227825Stheraven
1589227825Stheraven// tgamma
1590227825Stheraven
1591227825Stheravenusing ::tgamma;
1592227825Stheravenusing ::tgammaf;
1593227825Stheraven
1594278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       tgamma(float __lcpp_x) _NOEXCEPT       {return tgammaf(__lcpp_x);}
1595278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return tgammal(__lcpp_x);}
1596227825Stheraven
1597227825Stheraventemplate <class _A1>
1598227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1599227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1600278724Sdimtgamma(_A1 __lcpp_x) _NOEXCEPT {return tgamma((double)__lcpp_x);}
1601227825Stheraven
1602227825Stheraven// trunc
1603227825Stheraven
1604227825Stheravenusing ::trunc;
1605227825Stheravenusing ::truncf;
1606227825Stheraven
1607278724Sdiminline _LIBCPP_INLINE_VISIBILITY float       trunc(float __lcpp_x) _NOEXCEPT       {return truncf(__lcpp_x);}
1608278724Sdiminline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return truncl(__lcpp_x);}
1609227825Stheraven
1610227825Stheraventemplate <class _A1>
1611227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1612227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1613278724Sdimtrunc(_A1 __lcpp_x) _NOEXCEPT {return trunc((double)__lcpp_x);}
1614227825Stheraven
1615262801Sdim#endif // !_LIBCPP_MSVCRT
1616227825Stheraven
1617227825Stheravenusing ::acosl;
1618227825Stheravenusing ::asinl;
1619227825Stheravenusing ::atanl;
1620227825Stheravenusing ::atan2l;
1621227825Stheravenusing ::ceill;
1622227825Stheravenusing ::cosl;
1623227825Stheravenusing ::coshl;
1624227825Stheravenusing ::expl;
1625227825Stheravenusing ::fabsl;
1626227825Stheravenusing ::floorl;
1627227825Stheravenusing ::fmodl;
1628227825Stheravenusing ::frexpl;
1629227825Stheravenusing ::ldexpl;
1630227825Stheravenusing ::logl;
1631227825Stheravenusing ::log10l;
1632227825Stheravenusing ::modfl;
1633227825Stheravenusing ::powl;
1634227825Stheravenusing ::sinl;
1635227825Stheravenusing ::sinhl;
1636227825Stheravenusing ::sqrtl;
1637227825Stheravenusing ::tanl;
1638262801Sdim#ifndef _LIBCPP_MSVCRT
1639227825Stheravenusing ::tanhl;
1640227825Stheravenusing ::acoshl;
1641227825Stheravenusing ::asinhl;
1642227825Stheravenusing ::atanhl;
1643227825Stheravenusing ::cbrtl;
1644262801Sdim#endif  // !_LIBCPP_MSVCRT
1645227825Stheravenusing ::copysignl;
1646262801Sdim#ifndef _LIBCPP_MSVCRT
1647227825Stheravenusing ::erfl;
1648227825Stheravenusing ::erfcl;
1649227825Stheravenusing ::exp2l;
1650227825Stheravenusing ::expm1l;
1651227825Stheravenusing ::fdiml;
1652227825Stheravenusing ::fmal;
1653227825Stheravenusing ::fmaxl;
1654227825Stheravenusing ::fminl;
1655227825Stheravenusing ::hypotl;
1656227825Stheravenusing ::ilogbl;
1657227825Stheravenusing ::lgammal;
1658227825Stheravenusing ::llrintl;
1659227825Stheravenusing ::llroundl;
1660227825Stheravenusing ::log1pl;
1661227825Stheravenusing ::log2l;
1662227825Stheravenusing ::logbl;
1663227825Stheravenusing ::lrintl;
1664227825Stheravenusing ::lroundl;
1665227825Stheravenusing ::nanl;
1666227825Stheravenusing ::nearbyintl;
1667227825Stheravenusing ::nextafterl;
1668227825Stheravenusing ::nexttowardl;
1669227825Stheravenusing ::remainderl;
1670227825Stheravenusing ::remquol;
1671227825Stheravenusing ::rintl;
1672227825Stheravenusing ::roundl;
1673227825Stheravenusing ::scalblnl;
1674227825Stheravenusing ::scalbnl;
1675227825Stheravenusing ::tgammal;
1676227825Stheravenusing ::truncl;
1677262801Sdim#endif // !_LIBCPP_MSVCRT
1678227825Stheraven
1679232950Stheraven#else 
1680232950Stheravenusing ::lgamma;
1681232950Stheravenusing ::lgammaf;
1682232950Stheraven#endif // __sun__
1683227825Stheraven_LIBCPP_END_NAMESPACE_STD
1684227825Stheraven
1685227825Stheraven#endif  // _LIBCPP_CMATH
1686