cmath revision 234976
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
651227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
652234976Stheravenfloat
653234976Stheravenabs(float __x) {return fabsf(__x);}
654227825Stheraven
655234976Stheraveninline _LIBCPP_INLINE_VISIBILITY
656234976Stheravendouble
657234976Stheravenabs(double __x) {return fabs(__x);}
658234976Stheraven
659234976Stheraveninline _LIBCPP_INLINE_VISIBILITY
660234976Stheravenlong double
661234976Stheravenabs(long double __x) {return fabsl(__x);}
662234976Stheraven
663232950Stheraven#ifndef __sun__
664232950Stheraven
665227825Stheraven// acos
666227825Stheraven
667227825Stheravenusing ::acos;
668227825Stheravenusing ::acosf;
669227825Stheraven
670227825Stheraven#ifndef _MSC_VER
671227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       acos(float __x)       {return acosf(__x);}
672227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double acos(long double __x) {return acosl(__x);}
673227825Stheraven#endif
674227825Stheraven
675227825Stheraventemplate <class _A1>
676227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
677227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
678227825Stheravenacos(_A1 __x) {return acos((double)__x);}
679227825Stheraven
680227825Stheraven// asin
681227825Stheraven
682227825Stheravenusing ::asin;
683227825Stheravenusing ::asinf;
684227825Stheraven
685227825Stheraven#ifndef _MSC_VER
686227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       asin(float __x)       {return asinf(__x);}
687227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double asin(long double __x) {return asinl(__x);}
688227825Stheraven#endif
689227825Stheraven
690227825Stheraventemplate <class _A1>
691227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
692227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
693227825Stheravenasin(_A1 __x) {return asin((double)__x);}
694227825Stheraven
695227825Stheraven// atan
696227825Stheraven
697227825Stheravenusing ::atan;
698227825Stheravenusing ::atanf;
699227825Stheraven
700227825Stheraven#ifndef _MSC_VER
701227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       atan(float __x)       {return atanf(__x);}
702227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atan(long double __x) {return atanl(__x);}
703227825Stheraven#endif
704227825Stheraven
705227825Stheraventemplate <class _A1>
706227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
707227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
708227825Stheravenatan(_A1 __x) {return atan((double)__x);}
709227825Stheraven
710227825Stheraven// atan2
711227825Stheraven
712227825Stheravenusing ::atan2;
713227825Stheravenusing ::atan2f;
714227825Stheraven
715227825Stheraven#ifndef _MSC_VER
716227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       atan2(float __y, float __x)             {return atan2f(__y, __x);}
717227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __y, long double __x) {return atan2l(__y, __x);}
718227825Stheraven#endif
719227825Stheraven
720227825Stheraventemplate <class _A1, class _A2>
721227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
722227825Stheraventypename enable_if
723227825Stheraven<
724227825Stheraven    is_arithmetic<_A1>::value &&
725227825Stheraven    is_arithmetic<_A2>::value,
726227825Stheraven    typename __promote<_A1, _A2>::type
727227825Stheraven>::type
728227825Stheravenatan2(_A1 __y, _A2 __x)
729227825Stheraven{
730227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
731227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
732227825Stheraven                      is_same<_A2, __result_type>::value)), "");
733227825Stheraven    return atan2((__result_type)__y, (__result_type)__x);
734227825Stheraven}
735227825Stheraven
736227825Stheraven// ceil
737227825Stheraven
738227825Stheravenusing ::ceil;
739227825Stheravenusing ::ceilf;
740227825Stheraven
741227825Stheraven#ifndef _MSC_VER
742227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       ceil(float __x)       {return ceilf(__x);}
743227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __x) {return ceill(__x);}
744227825Stheraven#endif
745227825Stheraven
746227825Stheraventemplate <class _A1>
747227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
748227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
749227825Stheravenceil(_A1 __x) {return ceil((double)__x);}
750227825Stheraven
751227825Stheraven// cos
752227825Stheraven
753227825Stheravenusing ::cos;
754227825Stheravenusing ::cosf;
755227825Stheraven
756227825Stheraven#ifndef _MSC_VER
757227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       cos(float __x)       {return cosf(__x);}
758227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cos(long double __x) {return cosl(__x);}
759227825Stheraven#endif
760227825Stheraven
761227825Stheraventemplate <class _A1>
762227825Stheraveninline _LIBCPP_ALWAYS_INLINE _LIBCPP_INLINE_VISIBILITY
763227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
764227825Stheravencos(_A1 __x) {return cos((double)__x);}
765227825Stheraven
766227825Stheraven// cosh
767227825Stheraven
768227825Stheravenusing ::cosh;
769227825Stheravenusing ::coshf;
770227825Stheraven
771227825Stheraven#ifndef _MSC_VER
772227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       cosh(float __x)       {return coshf(__x);}
773227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __x) {return coshl(__x);}
774227825Stheraven#endif
775227825Stheraven
776227825Stheraventemplate <class _A1>
777227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
778227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
779227825Stheravencosh(_A1 __x) {return cosh((double)__x);}
780227825Stheraven
781232950Stheraven#endif // __sun__
782227825Stheraven// exp
783227825Stheraven
784227825Stheravenusing ::exp;
785227825Stheravenusing ::expf;
786227825Stheraven
787232950Stheraven#ifndef __sun__
788232950Stheraven
789227825Stheraven#ifndef _MSC_VER
790227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       exp(float __x)       {return expf(__x);}
791227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double exp(long double __x) {return expl(__x);}
792227825Stheraven#endif
793227825Stheraven
794232950Stheraven
795227825Stheraventemplate <class _A1>
796227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
797227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
798227825Stheravenexp(_A1 __x) {return exp((double)__x);}
799227825Stheraven
800227825Stheraven// fabs
801227825Stheraven
802227825Stheravenusing ::fabs;
803227825Stheravenusing ::fabsf;
804227825Stheraven
805227825Stheraven#ifndef _MSC_VER
806227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fabs(float __x)       {return fabsf(__x);}
807227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __x) {return fabsl(__x);}
808227825Stheraven#endif
809227825Stheraven
810227825Stheraventemplate <class _A1>
811227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
812227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
813227825Stheravenfabs(_A1 __x) {return fabs((double)__x);}
814227825Stheraven
815227825Stheraven// floor
816227825Stheraven
817227825Stheravenusing ::floor;
818227825Stheravenusing ::floorf;
819227825Stheraven
820227825Stheraven#ifndef _MSC_VER
821227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       floor(float __x)       {return floorf(__x);}
822227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double floor(long double __x) {return floorl(__x);}
823227825Stheraven#endif
824227825Stheraven
825227825Stheraventemplate <class _A1>
826227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
827227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
828227825Stheravenfloor(_A1 __x) {return floor((double)__x);}
829227825Stheraven
830227825Stheraven// fmod
831227825Stheraven
832232950Stheraven#endif //__sun__
833227825Stheravenusing ::fmod;
834227825Stheravenusing ::fmodf;
835232950Stheraven#ifndef __sun__
836227825Stheraven
837227825Stheraven#ifndef _MSC_VER
838227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fmod(float __x, float __y)             {return fmodf(__x, __y);}
839227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __x, long double __y) {return fmodl(__x, __y);}
840227825Stheraven#endif
841227825Stheraven
842227825Stheraventemplate <class _A1, class _A2>
843227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
844227825Stheraventypename enable_if
845227825Stheraven<
846227825Stheraven    is_arithmetic<_A1>::value &&
847227825Stheraven    is_arithmetic<_A2>::value,
848227825Stheraven    typename __promote<_A1, _A2>::type
849227825Stheraven>::type
850227825Stheravenfmod(_A1 __x, _A2 __y)
851227825Stheraven{
852227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
853227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
854227825Stheraven                      is_same<_A2, __result_type>::value)), "");
855227825Stheraven    return fmod((__result_type)__x, (__result_type)__y);
856227825Stheraven}
857227825Stheraven
858232950Stheraven
859227825Stheraven// frexp
860227825Stheraven
861227825Stheravenusing ::frexp;
862227825Stheravenusing ::frexpf;
863227825Stheraven
864227825Stheraven#ifndef _MSC_VER
865227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       frexp(float __x, int* __e)       {return frexpf(__x, __e);}
866227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __x, int* __e) {return frexpl(__x, __e);}
867227825Stheraven#endif
868227825Stheraven
869227825Stheraventemplate <class _A1>
870227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
871227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
872227825Stheravenfrexp(_A1 __x, int* __e) {return frexp((double)__x, __e);}
873227825Stheraven
874227825Stheraven// ldexp
875227825Stheraven
876227825Stheravenusing ::ldexp;
877227825Stheravenusing ::ldexpf;
878227825Stheraven
879227825Stheraven#ifndef _MSC_VER
880227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       ldexp(float __x, int __e)       {return ldexpf(__x, __e);}
881227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __x, int __e) {return ldexpl(__x, __e);}
882227825Stheraven#endif
883227825Stheraven
884227825Stheraventemplate <class _A1>
885227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
886227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
887227825Stheravenldexp(_A1 __x, int __e) {return ldexp((double)__x, __e);}
888227825Stheraven
889227825Stheraven// log
890227825Stheraven
891232950Stheraven#endif // __sun__
892227825Stheravenusing ::log;
893227825Stheravenusing ::logf;
894232950Stheraven#ifndef __sun__
895227825Stheraven
896227825Stheraven#ifndef _MSC_VER
897227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       log(float __x)       {return logf(__x);}
898227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log(long double __x) {return logl(__x);}
899227825Stheraven#endif
900227825Stheraven
901227825Stheraventemplate <class _A1>
902227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
903227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
904227825Stheravenlog(_A1 __x) {return log((double)__x);}
905227825Stheraven
906232950Stheraven
907227825Stheraven// log10
908227825Stheraven
909227825Stheravenusing ::log10;
910227825Stheravenusing ::log10f;
911227825Stheraven
912227825Stheraven#ifndef _MSC_VER
913227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       log10(float __x)       {return log10f(__x);}
914227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log10(long double __x) {return log10l(__x);}
915227825Stheraven#endif
916227825Stheraven
917227825Stheraventemplate <class _A1>
918227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
919227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
920227825Stheravenlog10(_A1 __x) {return log10((double)__x);}
921227825Stheraven
922227825Stheraven// modf
923227825Stheraven
924227825Stheravenusing ::modf;
925227825Stheravenusing ::modff;
926227825Stheraven
927227825Stheraven#ifndef _MSC_VER
928227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       modf(float __x, float* __y)             {return modff(__x, __y);}
929227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double modf(long double __x, long double* __y) {return modfl(__x, __y);}
930227825Stheraven#endif
931227825Stheraven
932227825Stheraven// pow
933227825Stheraven
934232950Stheraven#endif // __sun__ 
935227825Stheravenusing ::pow;
936227825Stheravenusing ::powf;
937227825Stheraven
938232950Stheraven#ifndef __sun__
939232950Stheraven
940227825Stheraven#ifndef _MSC_VER
941227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       pow(float __x, float __y)             {return powf(__x, __y);}
942227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double pow(long double __x, long double __y) {return powl(__x, __y);}
943227825Stheraven#endif
944227825Stheraven
945227825Stheraventemplate <class _A1, class _A2>
946227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
947227825Stheraventypename enable_if
948227825Stheraven<
949227825Stheraven    is_arithmetic<_A1>::value &&
950227825Stheraven    is_arithmetic<_A2>::value,
951227825Stheraven    typename __promote<_A1, _A2>::type
952227825Stheraven>::type
953227825Stheravenpow(_A1 __x, _A2 __y)
954227825Stheraven{
955227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
956227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
957227825Stheraven                      is_same<_A2, __result_type>::value)), "");
958227825Stheraven    return pow((__result_type)__x, (__result_type)__y);
959227825Stheraven}
960227825Stheraven
961232950Stheraven
962227825Stheraven// sin
963227825Stheraven
964227825Stheravenusing ::sin;
965227825Stheravenusing ::sinf;
966227825Stheraven
967227825Stheraven#ifndef _MSC_VER
968227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       sin(float __x)       {return sinf(__x);}
969227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sin(long double __x) {return sinl(__x);}
970227825Stheraven#endif
971227825Stheraven
972227825Stheraventemplate <class _A1>
973227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
974227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
975227825Stheravensin(_A1 __x) {return sin((double)__x);}
976227825Stheraven
977227825Stheraven// sinh
978227825Stheraven
979227825Stheravenusing ::sinh;
980227825Stheravenusing ::sinhf;
981227825Stheraven
982227825Stheraven#ifndef _MSC_VER
983227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       sinh(float __x)       {return sinhf(__x);}
984227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __x) {return sinhl(__x);}
985227825Stheraven#endif
986227825Stheraven
987227825Stheraventemplate <class _A1>
988227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
989227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
990227825Stheravensinh(_A1 __x) {return sinh((double)__x);}
991227825Stheraven
992227825Stheraven// sqrt
993227825Stheraven
994232950Stheraven#endif // __sun__
995227825Stheravenusing ::sqrt;
996227825Stheravenusing ::sqrtf;
997227825Stheraven
998232950Stheraven
999232950Stheraven#if !(defined(_MSC_VER) || defined(__sun__))
1000227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       sqrt(float __x)       {return sqrtf(__x);}
1001227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __x) {return sqrtl(__x);}
1002227825Stheraven#endif
1003227825Stheraven
1004227825Stheraventemplate <class _A1>
1005227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1006227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1007227825Stheravensqrt(_A1 __x) {return sqrt((double)__x);}
1008227825Stheraven
1009227825Stheraven// tan
1010227825Stheraven
1011227825Stheravenusing ::tan;
1012227825Stheravenusing ::tanf;
1013232950Stheraven#ifndef __sun__
1014227825Stheraven
1015227825Stheraven#ifndef _MSC_VER
1016227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       tan(float __x)       {return tanf(__x);}
1017227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tan(long double __x) {return tanl(__x);}
1018227825Stheraven#endif
1019227825Stheraven
1020227825Stheraventemplate <class _A1>
1021227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1022227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1023227825Stheraventan(_A1 __x) {return tan((double)__x);}
1024227825Stheraven
1025227825Stheraven// tanh
1026227825Stheraven
1027227825Stheravenusing ::tanh;
1028227825Stheravenusing ::tanhf;
1029227825Stheraven
1030227825Stheraven#ifndef _MSC_VER
1031227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       tanh(float __x)       {return tanhf(__x);}
1032227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __x) {return tanhl(__x);}
1033227825Stheraven#endif
1034227825Stheraven
1035227825Stheraventemplate <class _A1>
1036227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1037227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1038227825Stheraventanh(_A1 __x) {return tanh((double)__x);}
1039227825Stheraven
1040227825Stheraven// acosh
1041227825Stheraven
1042227825Stheraven#ifndef _MSC_VER
1043227825Stheravenusing ::acosh;
1044227825Stheravenusing ::acoshf;
1045227825Stheraven
1046227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       acosh(float __x)       {return acoshf(__x);}
1047227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __x) {return acoshl(__x);}
1048227825Stheraven
1049227825Stheraventemplate <class _A1>
1050227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1051227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1052227825Stheravenacosh(_A1 __x) {return acosh((double)__x);}
1053227825Stheraven#endif
1054227825Stheraven
1055227825Stheraven// asinh
1056227825Stheraven
1057227825Stheraven#ifndef _MSC_VER
1058227825Stheravenusing ::asinh;
1059227825Stheravenusing ::asinhf;
1060227825Stheraven
1061227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       asinh(float __x)       {return asinhf(__x);}
1062227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __x) {return asinhl(__x);}
1063227825Stheraven
1064227825Stheraventemplate <class _A1>
1065227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1066227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1067227825Stheravenasinh(_A1 __x) {return asinh((double)__x);}
1068227825Stheraven#endif
1069227825Stheraven
1070227825Stheraven// atanh
1071227825Stheraven
1072227825Stheraven#ifndef _MSC_VER
1073227825Stheravenusing ::atanh;
1074227825Stheravenusing ::atanhf;
1075227825Stheraven
1076227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       atanh(float __x)       {return atanhf(__x);}
1077227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __x) {return atanhl(__x);}
1078227825Stheraven
1079227825Stheraventemplate <class _A1>
1080227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1081227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1082227825Stheravenatanh(_A1 __x) {return atanh((double)__x);}
1083227825Stheraven#endif
1084227825Stheraven
1085227825Stheraven// cbrt
1086227825Stheraven
1087227825Stheraven#ifndef _MSC_VER
1088227825Stheravenusing ::cbrt;
1089227825Stheravenusing ::cbrtf;
1090227825Stheraven
1091227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       cbrt(float __x)       {return cbrtf(__x);}
1092227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __x) {return cbrtl(__x);}
1093227825Stheraven
1094227825Stheraventemplate <class _A1>
1095227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1096227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1097227825Stheravencbrt(_A1 __x) {return cbrt((double)__x);}
1098227825Stheraven#endif
1099227825Stheraven
1100227825Stheraven// copysign
1101227825Stheraven
1102227825Stheravenusing ::copysign;
1103227825Stheravenusing ::copysignf;
1104227825Stheraven
1105227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       copysign(float __x, float __y)             {return copysignf(__x, __y);}
1106227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double copysign(long double __x, long double __y) {return copysignl(__x, __y);}
1107227825Stheraven
1108227825Stheraventemplate <class _A1, class _A2>
1109227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1110227825Stheraventypename enable_if
1111227825Stheraven<
1112227825Stheraven    is_arithmetic<_A1>::value &&
1113227825Stheraven    is_arithmetic<_A2>::value,
1114227825Stheraven    typename __promote<_A1, _A2>::type
1115227825Stheraven>::type
1116227825Stheravencopysign(_A1 __x, _A2 __y)
1117227825Stheraven{
1118227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1119227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1120227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1121227825Stheraven    return copysign((__result_type)__x, (__result_type)__y);
1122227825Stheraven}
1123227825Stheraven
1124227825Stheraven#ifndef _MSC_VER
1125227825Stheraven
1126227825Stheraven// erf
1127227825Stheraven
1128227825Stheravenusing ::erf;
1129227825Stheravenusing ::erff;
1130227825Stheraven
1131227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       erf(float __x)       {return erff(__x);}
1132227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double erf(long double __x) {return erfl(__x);}
1133227825Stheraven
1134227825Stheraventemplate <class _A1>
1135227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1136227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1137227825Stheravenerf(_A1 __x) {return erf((double)__x);}
1138227825Stheraven
1139227825Stheraven// erfc
1140227825Stheraven
1141227825Stheravenusing ::erfc;
1142227825Stheravenusing ::erfcf;
1143227825Stheraven
1144227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       erfc(float __x)       {return erfcf(__x);}
1145227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __x) {return erfcl(__x);}
1146227825Stheraven
1147227825Stheraventemplate <class _A1>
1148227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1149227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1150227825Stheravenerfc(_A1 __x) {return erfc((double)__x);}
1151227825Stheraven
1152227825Stheraven// exp2
1153227825Stheraven
1154227825Stheravenusing ::exp2;
1155227825Stheravenusing ::exp2f;
1156227825Stheraven
1157227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       exp2(float __x)       {return exp2f(__x);}
1158227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __x) {return exp2l(__x);}
1159227825Stheraven
1160227825Stheraventemplate <class _A1>
1161227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1162227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1163227825Stheravenexp2(_A1 __x) {return exp2((double)__x);}
1164227825Stheraven
1165227825Stheraven// expm1
1166227825Stheraven
1167227825Stheravenusing ::expm1;
1168227825Stheravenusing ::expm1f;
1169227825Stheraven
1170227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       expm1(float __x)       {return expm1f(__x);}
1171227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __x) {return expm1l(__x);}
1172227825Stheraven
1173227825Stheraventemplate <class _A1>
1174227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1175227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1176227825Stheravenexpm1(_A1 __x) {return expm1((double)__x);}
1177227825Stheraven
1178227825Stheraven// fdim
1179227825Stheraven
1180227825Stheravenusing ::fdim;
1181227825Stheravenusing ::fdimf;
1182227825Stheraven
1183227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fdim(float __x, float __y)             {return fdimf(__x, __y);}
1184227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __x, long double __y) {return fdiml(__x, __y);}
1185227825Stheraven
1186227825Stheraventemplate <class _A1, class _A2>
1187227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1188227825Stheraventypename enable_if
1189227825Stheraven<
1190227825Stheraven    is_arithmetic<_A1>::value &&
1191227825Stheraven    is_arithmetic<_A2>::value,
1192227825Stheraven    typename __promote<_A1, _A2>::type
1193227825Stheraven>::type
1194227825Stheravenfdim(_A1 __x, _A2 __y)
1195227825Stheraven{
1196227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1197227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1198227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1199227825Stheraven    return fdim((__result_type)__x, (__result_type)__y);
1200227825Stheraven}
1201227825Stheraven
1202227825Stheraven// fma
1203227825Stheraven
1204227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float fmaf(float __x, float __y, float __z) {return (float)((double)__x*__y + __z);}
1205227825Stheraven#define FP_FAST_FMAF
1206227825Stheraven
1207227825Stheravenusing ::fma;
1208227825Stheraven
1209227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fma(float __x, float __y, float __z)                   {return fmaf(__x, __y, __z);}
1210227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fma(long double __x, long double __y, long double __z) {return fmal(__x, __y, __z);}
1211227825Stheraven
1212227825Stheraventemplate <class _A1, class _A2, class _A3>
1213227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1214227825Stheraventypename enable_if
1215227825Stheraven<
1216227825Stheraven    is_arithmetic<_A1>::value &&
1217227825Stheraven    is_arithmetic<_A2>::value &&
1218227825Stheraven    is_arithmetic<_A3>::value,
1219227825Stheraven    typename __promote<_A1, _A2, _A3>::type
1220227825Stheraven>::type
1221227825Stheravenfma(_A1 __x, _A2 __y, _A3 __z)
1222227825Stheraven{
1223227825Stheraven    typedef typename __promote<_A1, _A2, _A3>::type __result_type;
1224227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1225227825Stheraven                      is_same<_A2, __result_type>::value &&
1226227825Stheraven                      is_same<_A3, __result_type>::value)), "");
1227227825Stheraven    return fma((__result_type)__x, (__result_type)__y, (__result_type)__z);
1228227825Stheraven}
1229227825Stheraven
1230227825Stheraven// fmax
1231227825Stheraven
1232227825Stheravenusing ::fmax;
1233227825Stheravenusing ::fmaxf;
1234227825Stheraven
1235227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fmax(float __x, float __y)             {return fmaxf(__x, __y);}
1236227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __x, long double __y) {return fmaxl(__x, __y);}
1237227825Stheraven
1238227825Stheraventemplate <class _A1, class _A2>
1239227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1240227825Stheraventypename enable_if
1241227825Stheraven<
1242227825Stheraven    is_arithmetic<_A1>::value &&
1243227825Stheraven    is_arithmetic<_A2>::value,
1244227825Stheraven    typename __promote<_A1, _A2>::type
1245227825Stheraven>::type
1246227825Stheravenfmax(_A1 __x, _A2 __y)
1247227825Stheraven{
1248227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1249227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1250227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1251227825Stheraven    return fmax((__result_type)__x, (__result_type)__y);
1252227825Stheraven}
1253227825Stheraven
1254227825Stheraven// fmin
1255227825Stheraven
1256227825Stheravenusing ::fmin;
1257227825Stheravenusing ::fminf;
1258227825Stheraven
1259227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       fmin(float __x, float __y)             {return fminf(__x, __y);}
1260227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __x, long double __y) {return fminl(__x, __y);}
1261227825Stheraven
1262227825Stheraventemplate <class _A1, class _A2>
1263227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1264227825Stheraventypename enable_if
1265227825Stheraven<
1266227825Stheraven    is_arithmetic<_A1>::value &&
1267227825Stheraven    is_arithmetic<_A2>::value,
1268227825Stheraven    typename __promote<_A1, _A2>::type
1269227825Stheraven>::type
1270227825Stheravenfmin(_A1 __x, _A2 __y)
1271227825Stheraven{
1272227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1273227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1274227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1275227825Stheraven    return fmin((__result_type)__x, (__result_type)__y);
1276227825Stheraven}
1277227825Stheraven
1278227825Stheraven// hypot
1279227825Stheraven
1280227825Stheravenusing ::hypot;
1281227825Stheravenusing ::hypotf;
1282227825Stheraven
1283227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       hypot(float __x, float __y)             {return hypotf(__x, __y);}
1284227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __x, long double __y) {return hypotl(__x, __y);}
1285227825Stheraven
1286227825Stheraventemplate <class _A1, class _A2>
1287227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1288227825Stheraventypename enable_if
1289227825Stheraven<
1290227825Stheraven    is_arithmetic<_A1>::value &&
1291227825Stheraven    is_arithmetic<_A2>::value,
1292227825Stheraven    typename __promote<_A1, _A2>::type
1293227825Stheraven>::type
1294227825Stheravenhypot(_A1 __x, _A2 __y)
1295227825Stheraven{
1296227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1297227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1298227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1299227825Stheraven    return hypot((__result_type)__x, (__result_type)__y);
1300227825Stheraven}
1301227825Stheraven
1302227825Stheraven// ilogb
1303227825Stheraven
1304227825Stheravenusing ::ilogb;
1305227825Stheravenusing ::ilogbf;
1306227825Stheraven
1307227825Stheraveninline _LIBCPP_INLINE_VISIBILITY int ilogb(float __x)       {return ilogbf(__x);}
1308227825Stheraveninline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __x) {return ilogbl(__x);}
1309227825Stheraven
1310227825Stheraventemplate <class _A1>
1311227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1312227825Stheraventypename enable_if<is_integral<_A1>::value, int>::type
1313227825Stheravenilogb(_A1 __x) {return ilogb((double)__x);}
1314227825Stheraven
1315227825Stheraven// lgamma
1316227825Stheraven
1317227825Stheravenusing ::lgamma;
1318227825Stheravenusing ::lgammaf;
1319227825Stheraven
1320227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       lgamma(float __x)       {return lgammaf(__x);}
1321227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __x) {return lgammal(__x);}
1322227825Stheraven
1323232950Stheraven
1324227825Stheraventemplate <class _A1>
1325227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1326227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1327227825Stheravenlgamma(_A1 __x) {return lgamma((double)__x);}
1328227825Stheraven
1329232950Stheraven
1330227825Stheraven// llrint
1331227825Stheraven
1332227825Stheravenusing ::llrint;
1333227825Stheravenusing ::llrintf;
1334227825Stheraven
1335227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llrint(float __x)       {return llrintf(__x);}
1336227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __x) {return llrintl(__x);}
1337227825Stheraven
1338227825Stheraventemplate <class _A1>
1339227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1340227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type
1341227825Stheravenllrint(_A1 __x) {return llrint((double)__x);}
1342227825Stheraven
1343227825Stheraven// llround
1344227825Stheraven
1345227825Stheravenusing ::llround;
1346227825Stheravenusing ::llroundf;
1347227825Stheraven
1348227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llround(float __x)       {return llroundf(__x);}
1349227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long long llround(long double __x) {return llroundl(__x);}
1350227825Stheraven
1351227825Stheraventemplate <class _A1>
1352227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1353227825Stheraventypename enable_if<is_integral<_A1>::value, long long>::type
1354227825Stheravenllround(_A1 __x) {return llround((double)__x);}
1355227825Stheraven
1356227825Stheraven// log1p
1357227825Stheraven
1358227825Stheravenusing ::log1p;
1359227825Stheravenusing ::log1pf;
1360227825Stheraven
1361227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       log1p(float __x)       {return log1pf(__x);}
1362227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __x) {return log1pl(__x);}
1363227825Stheraven
1364227825Stheraventemplate <class _A1>
1365227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1366227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1367227825Stheravenlog1p(_A1 __x) {return log1p((double)__x);}
1368227825Stheraven
1369227825Stheraven// log2
1370227825Stheraven
1371227825Stheravenusing ::log2;
1372227825Stheravenusing ::log2f;
1373227825Stheraven
1374227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       log2(float __x)       {return log2f(__x);}
1375227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double log2(long double __x) {return log2l(__x);}
1376227825Stheraven
1377227825Stheraventemplate <class _A1>
1378227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1379227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1380227825Stheravenlog2(_A1 __x) {return log2((double)__x);}
1381227825Stheraven
1382227825Stheraven// logb
1383227825Stheraven
1384227825Stheravenusing ::logb;
1385227825Stheravenusing ::logbf;
1386227825Stheraven
1387227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       logb(float __x)       {return logbf(__x);}
1388227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double logb(long double __x) {return logbl(__x);}
1389227825Stheraven
1390227825Stheraventemplate <class _A1>
1391227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1392227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1393227825Stheravenlogb(_A1 __x) {return logb((double)__x);}
1394227825Stheraven
1395227825Stheraven// lrint
1396227825Stheraven
1397227825Stheravenusing ::lrint;
1398227825Stheravenusing ::lrintf;
1399227825Stheraven
1400227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lrint(float __x)       {return lrintf(__x);}
1401227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lrint(long double __x) {return lrintl(__x);}
1402227825Stheraven
1403227825Stheraventemplate <class _A1>
1404227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1405227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type
1406227825Stheravenlrint(_A1 __x) {return lrint((double)__x);}
1407227825Stheraven
1408227825Stheraven// lround
1409227825Stheraven
1410227825Stheravenusing ::lround;
1411227825Stheravenusing ::lroundf;
1412227825Stheraven
1413227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lround(float __x)       {return lroundf(__x);}
1414227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long lround(long double __x) {return lroundl(__x);}
1415227825Stheraven
1416227825Stheraventemplate <class _A1>
1417227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1418227825Stheraventypename enable_if<is_integral<_A1>::value, long>::type
1419227825Stheravenlround(_A1 __x) {return lround((double)__x);}
1420227825Stheraven
1421227825Stheraven// nan
1422232950Stheraven#endif // _MSC_VER
1423232950Stheraven#endif // __sun__
1424227825Stheravenusing ::nan;
1425227825Stheravenusing ::nanf;
1426232950Stheraven#ifndef __sun__
1427232950Stheraven#ifndef _MSC_VER
1428227825Stheraven
1429227825Stheraven// nearbyint
1430227825Stheraven
1431227825Stheravenusing ::nearbyint;
1432227825Stheravenusing ::nearbyintf;
1433227825Stheraven
1434227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       nearbyint(float __x)       {return nearbyintf(__x);}
1435227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __x) {return nearbyintl(__x);}
1436227825Stheraven
1437227825Stheraventemplate <class _A1>
1438227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1439227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1440227825Stheravennearbyint(_A1 __x) {return nearbyint((double)__x);}
1441227825Stheraven
1442227825Stheraven// nextafter
1443227825Stheraven
1444227825Stheravenusing ::nextafter;
1445227825Stheravenusing ::nextafterf;
1446227825Stheraven
1447227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       nextafter(float __x, float __y)             {return nextafterf(__x, __y);}
1448227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __x, long double __y) {return nextafterl(__x, __y);}
1449227825Stheraven
1450227825Stheraventemplate <class _A1, class _A2>
1451227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1452227825Stheraventypename enable_if
1453227825Stheraven<
1454227825Stheraven    is_arithmetic<_A1>::value &&
1455227825Stheraven    is_arithmetic<_A2>::value,
1456227825Stheraven    typename __promote<_A1, _A2>::type
1457227825Stheraven>::type
1458227825Stheravennextafter(_A1 __x, _A2 __y)
1459227825Stheraven{
1460227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1461227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1462227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1463227825Stheraven    return nextafter((__result_type)__x, (__result_type)__y);
1464227825Stheraven}
1465227825Stheraven
1466227825Stheraven// nexttoward
1467227825Stheraven
1468227825Stheravenusing ::nexttoward;
1469227825Stheravenusing ::nexttowardf;
1470227825Stheraven
1471227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       nexttoward(float __x, long double __y)       {return nexttowardf(__x, __y);}
1472227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);}
1473227825Stheraven
1474227825Stheraventemplate <class _A1>
1475227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1476227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1477227825Stheravennexttoward(_A1 __x, long double __y) {return nexttoward((double)__x, __y);}
1478227825Stheraven
1479227825Stheraven// remainder
1480227825Stheraven
1481227825Stheravenusing ::remainder;
1482227825Stheravenusing ::remainderf;
1483227825Stheraven
1484227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       remainder(float __x, float __y)             {return remainderf(__x, __y);}
1485227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __x, long double __y) {return remainderl(__x, __y);}
1486227825Stheraven
1487227825Stheraventemplate <class _A1, class _A2>
1488227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1489227825Stheraventypename enable_if
1490227825Stheraven<
1491227825Stheraven    is_arithmetic<_A1>::value &&
1492227825Stheraven    is_arithmetic<_A2>::value,
1493227825Stheraven    typename __promote<_A1, _A2>::type
1494227825Stheraven>::type
1495227825Stheravenremainder(_A1 __x, _A2 __y)
1496227825Stheraven{
1497227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1498227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1499227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1500227825Stheraven    return remainder((__result_type)__x, (__result_type)__y);
1501227825Stheraven}
1502227825Stheraven
1503227825Stheraven// remquo
1504227825Stheraven
1505227825Stheravenusing ::remquo;
1506227825Stheravenusing ::remquof;
1507227825Stheraven
1508227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       remquo(float __x, float __y, int* __z)             {return remquof(__x, __y, __z);}
1509227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __x, long double __y, int* __z) {return remquol(__x, __y, __z);}
1510227825Stheraven
1511227825Stheraventemplate <class _A1, class _A2>
1512227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1513227825Stheraventypename enable_if
1514227825Stheraven<
1515227825Stheraven    is_arithmetic<_A1>::value &&
1516227825Stheraven    is_arithmetic<_A2>::value,
1517227825Stheraven    typename __promote<_A1, _A2>::type
1518227825Stheraven>::type
1519227825Stheravenremquo(_A1 __x, _A2 __y, int* __z)
1520227825Stheraven{
1521227825Stheraven    typedef typename __promote<_A1, _A2>::type __result_type;
1522227825Stheraven    static_assert((!(is_same<_A1, __result_type>::value &&
1523227825Stheraven                      is_same<_A2, __result_type>::value)), "");
1524227825Stheraven    return remquo((__result_type)__x, (__result_type)__y, __z);
1525227825Stheraven}
1526227825Stheraven
1527227825Stheraven// rint
1528227825Stheraven
1529227825Stheravenusing ::rint;
1530227825Stheravenusing ::rintf;
1531227825Stheraven
1532227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       rint(float __x)       {return rintf(__x);}
1533227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double rint(long double __x) {return rintl(__x);}
1534227825Stheraven
1535227825Stheraventemplate <class _A1>
1536227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1537227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1538227825Stheravenrint(_A1 __x) {return rint((double)__x);}
1539227825Stheraven
1540227825Stheraven// round
1541227825Stheraven
1542227825Stheravenusing ::round;
1543227825Stheravenusing ::roundf;
1544227825Stheraven
1545227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       round(float __x)       {return roundf(__x);}
1546227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double round(long double __x) {return roundl(__x);}
1547227825Stheraven
1548227825Stheraventemplate <class _A1>
1549227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1550227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1551227825Stheravenround(_A1 __x) {return round((double)__x);}
1552227825Stheraven
1553227825Stheraven// scalbln
1554227825Stheraven
1555227825Stheravenusing ::scalbln;
1556227825Stheravenusing ::scalblnf;
1557227825Stheraven
1558227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       scalbln(float __x, long __y)       {return scalblnf(__x, __y);}
1559227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __x, long __y) {return scalblnl(__x, __y);}
1560227825Stheraven
1561227825Stheraventemplate <class _A1>
1562227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1563227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1564227825Stheravenscalbln(_A1 __x, long __y) {return scalbln((double)__x, __y);}
1565227825Stheraven
1566227825Stheraven// scalbn
1567227825Stheraven
1568227825Stheravenusing ::scalbn;
1569227825Stheravenusing ::scalbnf;
1570227825Stheraven
1571227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       scalbn(float __x, int __y)       {return scalbnf(__x, __y);}
1572227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __x, int __y) {return scalbnl(__x, __y);}
1573227825Stheraven
1574227825Stheraventemplate <class _A1>
1575227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1576227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1577227825Stheravenscalbn(_A1 __x, int __y) {return scalbn((double)__x, __y);}
1578227825Stheraven
1579227825Stheraven// tgamma
1580227825Stheraven
1581227825Stheravenusing ::tgamma;
1582227825Stheravenusing ::tgammaf;
1583227825Stheraven
1584227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       tgamma(float __x)       {return tgammaf(__x);}
1585227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __x) {return tgammal(__x);}
1586227825Stheraven
1587227825Stheraventemplate <class _A1>
1588227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1589227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1590227825Stheraventgamma(_A1 __x) {return tgamma((double)__x);}
1591227825Stheraven
1592227825Stheraven// trunc
1593227825Stheraven
1594227825Stheravenusing ::trunc;
1595227825Stheravenusing ::truncf;
1596227825Stheraven
1597227825Stheraveninline _LIBCPP_INLINE_VISIBILITY float       trunc(float __x)       {return truncf(__x);}
1598227825Stheraveninline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __x) {return truncl(__x);}
1599227825Stheraven
1600227825Stheraventemplate <class _A1>
1601227825Stheraveninline _LIBCPP_INLINE_VISIBILITY
1602227825Stheraventypename enable_if<is_integral<_A1>::value, double>::type
1603227825Stheraventrunc(_A1 __x) {return trunc((double)__x);}
1604227825Stheraven
1605227825Stheraven#endif // !_MSC_VER
1606227825Stheraven
1607227825Stheravenusing ::acosl;
1608227825Stheravenusing ::asinl;
1609227825Stheravenusing ::atanl;
1610227825Stheravenusing ::atan2l;
1611227825Stheravenusing ::ceill;
1612227825Stheravenusing ::cosl;
1613227825Stheravenusing ::coshl;
1614227825Stheravenusing ::expl;
1615227825Stheravenusing ::fabsl;
1616227825Stheravenusing ::floorl;
1617227825Stheravenusing ::fmodl;
1618227825Stheravenusing ::frexpl;
1619227825Stheravenusing ::ldexpl;
1620227825Stheravenusing ::logl;
1621227825Stheravenusing ::log10l;
1622227825Stheravenusing ::modfl;
1623227825Stheravenusing ::powl;
1624227825Stheravenusing ::sinl;
1625227825Stheravenusing ::sinhl;
1626227825Stheravenusing ::sqrtl;
1627227825Stheravenusing ::tanl;
1628227825Stheraven#ifndef _MSC_VER
1629227825Stheravenusing ::tanhl;
1630227825Stheravenusing ::acoshl;
1631227825Stheravenusing ::asinhl;
1632227825Stheravenusing ::atanhl;
1633227825Stheravenusing ::cbrtl;
1634232950Stheraven#endif  // !_MSC_VER
1635227825Stheravenusing ::copysignl;
1636227825Stheraven#ifndef _MSC_VER
1637227825Stheravenusing ::erfl;
1638227825Stheravenusing ::erfcl;
1639227825Stheravenusing ::exp2l;
1640227825Stheravenusing ::expm1l;
1641227825Stheravenusing ::fdiml;
1642227825Stheravenusing ::fmal;
1643227825Stheravenusing ::fmaxl;
1644227825Stheravenusing ::fminl;
1645227825Stheravenusing ::hypotl;
1646227825Stheravenusing ::ilogbl;
1647227825Stheravenusing ::lgammal;
1648227825Stheravenusing ::llrintl;
1649227825Stheravenusing ::llroundl;
1650227825Stheravenusing ::log1pl;
1651227825Stheravenusing ::log2l;
1652227825Stheravenusing ::logbl;
1653227825Stheravenusing ::lrintl;
1654227825Stheravenusing ::lroundl;
1655227825Stheravenusing ::nanl;
1656227825Stheravenusing ::nearbyintl;
1657227825Stheravenusing ::nextafterl;
1658227825Stheravenusing ::nexttowardl;
1659227825Stheravenusing ::remainderl;
1660227825Stheravenusing ::remquol;
1661227825Stheravenusing ::rintl;
1662227825Stheravenusing ::roundl;
1663227825Stheravenusing ::scalblnl;
1664227825Stheravenusing ::scalbnl;
1665227825Stheravenusing ::tgammal;
1666227825Stheravenusing ::truncl;
1667227825Stheraven#endif // !_MSC_VER
1668227825Stheraven
1669232950Stheraven#else 
1670232950Stheravenusing ::lgamma;
1671232950Stheravenusing ::lgammaf;
1672232950Stheraven#endif // __sun__
1673227825Stheraven_LIBCPP_END_NAMESPACE_STD
1674227825Stheraven
1675227825Stheraven#endif  // _LIBCPP_CMATH
1676