xref: /freebsd/contrib/llvm-project/libcxx/include/__cxx03/cmath (revision 700637cbb5e582861067a11aaca4d053546871d2)
1*700637cbSDimitry Andric// -*- C++ -*-
2*700637cbSDimitry Andric//===----------------------------------------------------------------------===//
3*700637cbSDimitry Andric//
4*700637cbSDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5*700637cbSDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
6*700637cbSDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7*700637cbSDimitry Andric//
8*700637cbSDimitry Andric//===----------------------------------------------------------------------===//
9*700637cbSDimitry Andric
10*700637cbSDimitry Andric#ifndef _LIBCPP___CXX03_CMATH
11*700637cbSDimitry Andric#define _LIBCPP___CXX03_CMATH
12*700637cbSDimitry Andric
13*700637cbSDimitry Andric/*
14*700637cbSDimitry Andric    cmath synopsis
15*700637cbSDimitry Andric
16*700637cbSDimitry AndricMacros:
17*700637cbSDimitry Andric
18*700637cbSDimitry Andric    HUGE_VAL
19*700637cbSDimitry Andric    HUGE_VALF               // C99
20*700637cbSDimitry Andric    HUGE_VALL               // C99
21*700637cbSDimitry Andric    INFINITY                // C99
22*700637cbSDimitry Andric    NAN                     // C99
23*700637cbSDimitry Andric    FP_INFINITE             // C99
24*700637cbSDimitry Andric    FP_NAN                  // C99
25*700637cbSDimitry Andric    FP_NORMAL               // C99
26*700637cbSDimitry Andric    FP_SUBNORMAL            // C99
27*700637cbSDimitry Andric    FP_ZERO                 // C99
28*700637cbSDimitry Andric    FP_FAST_FMA             // C99
29*700637cbSDimitry Andric    FP_FAST_FMAF            // C99
30*700637cbSDimitry Andric    FP_FAST_FMAL            // C99
31*700637cbSDimitry Andric    FP_ILOGB0               // C99
32*700637cbSDimitry Andric    FP_ILOGBNAN             // C99
33*700637cbSDimitry Andric    MATH_ERRNO              // C99
34*700637cbSDimitry Andric    MATH_ERREXCEPT          // C99
35*700637cbSDimitry Andric    math_errhandling        // C99
36*700637cbSDimitry Andric
37*700637cbSDimitry Andricnamespace std
38*700637cbSDimitry Andric{
39*700637cbSDimitry Andric
40*700637cbSDimitry AndricTypes:
41*700637cbSDimitry Andric
42*700637cbSDimitry Andric    float_t                 // C99
43*700637cbSDimitry Andric    double_t                // C99
44*700637cbSDimitry Andric
45*700637cbSDimitry Andric// C90
46*700637cbSDimitry Andric
47*700637cbSDimitry Andricfloating_point abs(floating_point x);
48*700637cbSDimitry Andric
49*700637cbSDimitry Andricfloating_point acos (arithmetic x);
50*700637cbSDimitry Andricfloat          acosf(float x);
51*700637cbSDimitry Andriclong double    acosl(long double x);
52*700637cbSDimitry Andric
53*700637cbSDimitry Andricfloating_point asin (arithmetic x);
54*700637cbSDimitry Andricfloat          asinf(float x);
55*700637cbSDimitry Andriclong double    asinl(long double x);
56*700637cbSDimitry Andric
57*700637cbSDimitry Andricfloating_point atan (arithmetic x);
58*700637cbSDimitry Andricfloat          atanf(float x);
59*700637cbSDimitry Andriclong double    atanl(long double x);
60*700637cbSDimitry Andric
61*700637cbSDimitry Andricfloating_point atan2 (arithmetic y, arithmetic x);
62*700637cbSDimitry Andricfloat          atan2f(float y, float x);
63*700637cbSDimitry Andriclong double    atan2l(long double y, long double x);
64*700637cbSDimitry Andric
65*700637cbSDimitry Andricfloating_point ceil (arithmetic x);
66*700637cbSDimitry Andricfloat          ceilf(float x);
67*700637cbSDimitry Andriclong double    ceill(long double x);
68*700637cbSDimitry Andric
69*700637cbSDimitry Andricfloating_point cos (arithmetic x);
70*700637cbSDimitry Andricfloat          cosf(float x);
71*700637cbSDimitry Andriclong double    cosl(long double x);
72*700637cbSDimitry Andric
73*700637cbSDimitry Andricfloating_point cosh (arithmetic x);
74*700637cbSDimitry Andricfloat          coshf(float x);
75*700637cbSDimitry Andriclong double    coshl(long double x);
76*700637cbSDimitry Andric
77*700637cbSDimitry Andricfloating_point exp (arithmetic x);
78*700637cbSDimitry Andricfloat          expf(float x);
79*700637cbSDimitry Andriclong double    expl(long double x);
80*700637cbSDimitry Andric
81*700637cbSDimitry Andricfloating_point fabs (arithmetic x);
82*700637cbSDimitry Andricfloat          fabsf(float x);
83*700637cbSDimitry Andriclong double    fabsl(long double x);
84*700637cbSDimitry Andric
85*700637cbSDimitry Andricfloating_point floor (arithmetic x);
86*700637cbSDimitry Andricfloat          floorf(float x);
87*700637cbSDimitry Andriclong double    floorl(long double x);
88*700637cbSDimitry Andric
89*700637cbSDimitry Andricfloating_point fmod (arithmetic x, arithmetic y);
90*700637cbSDimitry Andricfloat          fmodf(float x, float y);
91*700637cbSDimitry Andriclong double    fmodl(long double x, long double y);
92*700637cbSDimitry Andric
93*700637cbSDimitry Andricfloating_point frexp (arithmetic value, int* exp);
94*700637cbSDimitry Andricfloat          frexpf(float value, int* exp);
95*700637cbSDimitry Andriclong double    frexpl(long double value, int* exp);
96*700637cbSDimitry Andric
97*700637cbSDimitry Andricfloating_point ldexp (arithmetic value, int exp);
98*700637cbSDimitry Andricfloat          ldexpf(float value, int exp);
99*700637cbSDimitry Andriclong double    ldexpl(long double value, int exp);
100*700637cbSDimitry Andric
101*700637cbSDimitry Andricfloating_point log (arithmetic x);
102*700637cbSDimitry Andricfloat          logf(float x);
103*700637cbSDimitry Andriclong double    logl(long double x);
104*700637cbSDimitry Andric
105*700637cbSDimitry Andricfloating_point log10 (arithmetic x);
106*700637cbSDimitry Andricfloat          log10f(float x);
107*700637cbSDimitry Andriclong double    log10l(long double x);
108*700637cbSDimitry Andric
109*700637cbSDimitry Andricfloating_point modf (floating_point value, floating_point* iptr);
110*700637cbSDimitry Andricfloat          modff(float value, float* iptr);
111*700637cbSDimitry Andriclong double    modfl(long double value, long double* iptr);
112*700637cbSDimitry Andric
113*700637cbSDimitry Andricfloating_point pow (arithmetic x, arithmetic y);
114*700637cbSDimitry Andricfloat          powf(float x, float y);
115*700637cbSDimitry Andriclong double    powl(long double x, long double y);
116*700637cbSDimitry Andric
117*700637cbSDimitry Andricfloating_point sin (arithmetic x);
118*700637cbSDimitry Andricfloat          sinf(float x);
119*700637cbSDimitry Andriclong double    sinl(long double x);
120*700637cbSDimitry Andric
121*700637cbSDimitry Andricfloating_point sinh (arithmetic x);
122*700637cbSDimitry Andricfloat          sinhf(float x);
123*700637cbSDimitry Andriclong double    sinhl(long double x);
124*700637cbSDimitry Andric
125*700637cbSDimitry Andricfloating_point sqrt (arithmetic x);
126*700637cbSDimitry Andricfloat          sqrtf(float x);
127*700637cbSDimitry Andriclong double    sqrtl(long double x);
128*700637cbSDimitry Andric
129*700637cbSDimitry Andricfloating_point tan (arithmetic x);
130*700637cbSDimitry Andricfloat          tanf(float x);
131*700637cbSDimitry Andriclong double    tanl(long double x);
132*700637cbSDimitry Andric
133*700637cbSDimitry Andricfloating_point tanh (arithmetic x);
134*700637cbSDimitry Andricfloat          tanhf(float x);
135*700637cbSDimitry Andriclong double    tanhl(long double x);
136*700637cbSDimitry Andric
137*700637cbSDimitry Andric//  C99
138*700637cbSDimitry Andric
139*700637cbSDimitry Andricbool signbit(arithmetic x);
140*700637cbSDimitry Andric
141*700637cbSDimitry Andricint fpclassify(arithmetic x);
142*700637cbSDimitry Andric
143*700637cbSDimitry Andricbool isfinite(arithmetic x);
144*700637cbSDimitry Andricbool isinf(arithmetic x);
145*700637cbSDimitry Andricbool isnan(arithmetic x);
146*700637cbSDimitry Andricbool isnormal(arithmetic x);
147*700637cbSDimitry Andric
148*700637cbSDimitry Andricbool isgreater(arithmetic x, arithmetic y);
149*700637cbSDimitry Andricbool isgreaterequal(arithmetic x, arithmetic y);
150*700637cbSDimitry Andricbool isless(arithmetic x, arithmetic y);
151*700637cbSDimitry Andricbool islessequal(arithmetic x, arithmetic y);
152*700637cbSDimitry Andricbool islessgreater(arithmetic x, arithmetic y);
153*700637cbSDimitry Andricbool isunordered(arithmetic x, arithmetic y);
154*700637cbSDimitry Andric
155*700637cbSDimitry Andricfloating_point acosh (arithmetic x);
156*700637cbSDimitry Andricfloat          acoshf(float x);
157*700637cbSDimitry Andriclong double    acoshl(long double x);
158*700637cbSDimitry Andric
159*700637cbSDimitry Andricfloating_point asinh (arithmetic x);
160*700637cbSDimitry Andricfloat          asinhf(float x);
161*700637cbSDimitry Andriclong double    asinhl(long double x);
162*700637cbSDimitry Andric
163*700637cbSDimitry Andricfloating_point atanh (arithmetic x);
164*700637cbSDimitry Andricfloat          atanhf(float x);
165*700637cbSDimitry Andriclong double    atanhl(long double x);
166*700637cbSDimitry Andric
167*700637cbSDimitry Andricfloating_point cbrt (arithmetic x);
168*700637cbSDimitry Andricfloat          cbrtf(float x);
169*700637cbSDimitry Andriclong double    cbrtl(long double x);
170*700637cbSDimitry Andric
171*700637cbSDimitry Andricfloating_point copysign (arithmetic x, arithmetic y);
172*700637cbSDimitry Andricfloat          copysignf(float x, float y);
173*700637cbSDimitry Andriclong double    copysignl(long double x, long double y);
174*700637cbSDimitry Andric
175*700637cbSDimitry Andricfloating_point erf (arithmetic x);
176*700637cbSDimitry Andricfloat          erff(float x);
177*700637cbSDimitry Andriclong double    erfl(long double x);
178*700637cbSDimitry Andric
179*700637cbSDimitry Andricfloating_point erfc (arithmetic x);
180*700637cbSDimitry Andricfloat          erfcf(float x);
181*700637cbSDimitry Andriclong double    erfcl(long double x);
182*700637cbSDimitry Andric
183*700637cbSDimitry Andricfloating_point exp2 (arithmetic x);
184*700637cbSDimitry Andricfloat          exp2f(float x);
185*700637cbSDimitry Andriclong double    exp2l(long double x);
186*700637cbSDimitry Andric
187*700637cbSDimitry Andricfloating_point expm1 (arithmetic x);
188*700637cbSDimitry Andricfloat          expm1f(float x);
189*700637cbSDimitry Andriclong double    expm1l(long double x);
190*700637cbSDimitry Andric
191*700637cbSDimitry Andricfloating_point fdim (arithmetic x, arithmetic y);
192*700637cbSDimitry Andricfloat          fdimf(float x, float y);
193*700637cbSDimitry Andriclong double    fdiml(long double x, long double y);
194*700637cbSDimitry Andric
195*700637cbSDimitry Andricfloating_point fma (arithmetic x, arithmetic y, arithmetic z);
196*700637cbSDimitry Andricfloat          fmaf(float x, float y, float z);
197*700637cbSDimitry Andriclong double    fmal(long double x, long double y, long double z);
198*700637cbSDimitry Andric
199*700637cbSDimitry Andricfloating_point fmax (arithmetic x, arithmetic y);
200*700637cbSDimitry Andricfloat          fmaxf(float x, float y);
201*700637cbSDimitry Andriclong double    fmaxl(long double x, long double y);
202*700637cbSDimitry Andric
203*700637cbSDimitry Andricfloating_point fmin (arithmetic x, arithmetic y);
204*700637cbSDimitry Andricfloat          fminf(float x, float y);
205*700637cbSDimitry Andriclong double    fminl(long double x, long double y);
206*700637cbSDimitry Andric
207*700637cbSDimitry Andricdouble         hermite(unsigned n, double x);                    // C++17
208*700637cbSDimitry Andricfloat          hermite(unsigned n, float x);                     // C++17
209*700637cbSDimitry Andriclong double    hermite(unsigned n, long double x);               // C++17
210*700637cbSDimitry Andricfloat          hermitef(unsigned n, float x);                    // C++17
211*700637cbSDimitry Andriclong double    hermitel(unsigned n, long double x);              // C++17
212*700637cbSDimitry Andrictemplate <class Integer>
213*700637cbSDimitry Andricdouble         hermite(unsigned n, Integer x);                   // C++17
214*700637cbSDimitry Andric
215*700637cbSDimitry Andricfloating_point hypot (arithmetic x, arithmetic y);
216*700637cbSDimitry Andricfloat          hypotf(float x, float y);
217*700637cbSDimitry Andriclong double    hypotl(long double x, long double y);
218*700637cbSDimitry Andric
219*700637cbSDimitry Andricdouble       hypot(double x, double y, double z);                // C++17
220*700637cbSDimitry Andricfloat        hypot(float x, float y, float z);                   // C++17
221*700637cbSDimitry Andriclong double  hypot(long double x, long double y, long double z); // C++17
222*700637cbSDimitry Andric
223*700637cbSDimitry Andricint ilogb (arithmetic x);
224*700637cbSDimitry Andricint ilogbf(float x);
225*700637cbSDimitry Andricint ilogbl(long double x);
226*700637cbSDimitry Andric
227*700637cbSDimitry Andricfloating_point lgamma (arithmetic x);
228*700637cbSDimitry Andricfloat          lgammaf(float x);
229*700637cbSDimitry Andriclong double    lgammal(long double x);
230*700637cbSDimitry Andric
231*700637cbSDimitry Andriclong long llrint (arithmetic x);
232*700637cbSDimitry Andriclong long llrintf(float x);
233*700637cbSDimitry Andriclong long llrintl(long double x);
234*700637cbSDimitry Andric
235*700637cbSDimitry Andriclong long llround (arithmetic x);
236*700637cbSDimitry Andriclong long llroundf(float x);
237*700637cbSDimitry Andriclong long llroundl(long double x);
238*700637cbSDimitry Andric
239*700637cbSDimitry Andricfloating_point log1p (arithmetic x);
240*700637cbSDimitry Andricfloat          log1pf(float x);
241*700637cbSDimitry Andriclong double    log1pl(long double x);
242*700637cbSDimitry Andric
243*700637cbSDimitry Andricfloating_point log2 (arithmetic x);
244*700637cbSDimitry Andricfloat          log2f(float x);
245*700637cbSDimitry Andriclong double    log2l(long double x);
246*700637cbSDimitry Andric
247*700637cbSDimitry Andricfloating_point logb (arithmetic x);
248*700637cbSDimitry Andricfloat          logbf(float x);
249*700637cbSDimitry Andriclong double    logbl(long double x);
250*700637cbSDimitry Andric
251*700637cbSDimitry Andriclong lrint (arithmetic x);
252*700637cbSDimitry Andriclong lrintf(float x);
253*700637cbSDimitry Andriclong lrintl(long double x);
254*700637cbSDimitry Andric
255*700637cbSDimitry Andriclong lround (arithmetic x);
256*700637cbSDimitry Andriclong lroundf(float x);
257*700637cbSDimitry Andriclong lroundl(long double x);
258*700637cbSDimitry Andric
259*700637cbSDimitry Andricdouble      nan (const char* str);
260*700637cbSDimitry Andricfloat       nanf(const char* str);
261*700637cbSDimitry Andriclong double nanl(const char* str);
262*700637cbSDimitry Andric
263*700637cbSDimitry Andricfloating_point nearbyint (arithmetic x);
264*700637cbSDimitry Andricfloat          nearbyintf(float x);
265*700637cbSDimitry Andriclong double    nearbyintl(long double x);
266*700637cbSDimitry Andric
267*700637cbSDimitry Andricfloating_point nextafter (arithmetic x, arithmetic y);
268*700637cbSDimitry Andricfloat          nextafterf(float x, float y);
269*700637cbSDimitry Andriclong double    nextafterl(long double x, long double y);
270*700637cbSDimitry Andric
271*700637cbSDimitry Andricfloating_point nexttoward (arithmetic x, long double y);
272*700637cbSDimitry Andricfloat          nexttowardf(float x, long double y);
273*700637cbSDimitry Andriclong double    nexttowardl(long double x, long double y);
274*700637cbSDimitry Andric
275*700637cbSDimitry Andricfloating_point remainder (arithmetic x, arithmetic y);
276*700637cbSDimitry Andricfloat          remainderf(float x, float y);
277*700637cbSDimitry Andriclong double    remainderl(long double x, long double y);
278*700637cbSDimitry Andric
279*700637cbSDimitry Andricfloating_point remquo (arithmetic x, arithmetic y, int* pquo);
280*700637cbSDimitry Andricfloat          remquof(float x, float y, int* pquo);
281*700637cbSDimitry Andriclong double    remquol(long double x, long double y, int* pquo);
282*700637cbSDimitry Andric
283*700637cbSDimitry Andricfloating_point rint (arithmetic x);
284*700637cbSDimitry Andricfloat          rintf(float x);
285*700637cbSDimitry Andriclong double    rintl(long double x);
286*700637cbSDimitry Andric
287*700637cbSDimitry Andricfloating_point round (arithmetic x);
288*700637cbSDimitry Andricfloat          roundf(float x);
289*700637cbSDimitry Andriclong double    roundl(long double x);
290*700637cbSDimitry Andric
291*700637cbSDimitry Andricfloating_point scalbln (arithmetic x, long ex);
292*700637cbSDimitry Andricfloat          scalblnf(float x, long ex);
293*700637cbSDimitry Andriclong double    scalblnl(long double x, long ex);
294*700637cbSDimitry Andric
295*700637cbSDimitry Andricfloating_point scalbn (arithmetic x, int ex);
296*700637cbSDimitry Andricfloat          scalbnf(float x, int ex);
297*700637cbSDimitry Andriclong double    scalbnl(long double x, int ex);
298*700637cbSDimitry Andric
299*700637cbSDimitry Andricfloating_point tgamma (arithmetic x);
300*700637cbSDimitry Andricfloat          tgammaf(float x);
301*700637cbSDimitry Andriclong double    tgammal(long double x);
302*700637cbSDimitry Andric
303*700637cbSDimitry Andricfloating_point trunc (arithmetic x);
304*700637cbSDimitry Andricfloat          truncf(float x);
305*700637cbSDimitry Andriclong double    truncl(long double x);
306*700637cbSDimitry Andric
307*700637cbSDimitry Andricconstexpr float       lerp(float a, float b, float t) noexcept;                   // C++20
308*700637cbSDimitry Andricconstexpr double      lerp(double a, double b, double t) noexcept;                // C++20
309*700637cbSDimitry Andricconstexpr long double lerp(long double a, long double b, long double t) noexcept; // C++20
310*700637cbSDimitry Andric
311*700637cbSDimitry Andric}  // std
312*700637cbSDimitry Andric
313*700637cbSDimitry Andric*/
314*700637cbSDimitry Andric
315*700637cbSDimitry Andric#include <__cxx03/__config>
316*700637cbSDimitry Andric#include <__cxx03/__math/hypot.h>
317*700637cbSDimitry Andric#include <__cxx03/__type_traits/enable_if.h>
318*700637cbSDimitry Andric#include <__cxx03/__type_traits/is_arithmetic.h>
319*700637cbSDimitry Andric#include <__cxx03/__type_traits/is_constant_evaluated.h>
320*700637cbSDimitry Andric#include <__cxx03/__type_traits/is_floating_point.h>
321*700637cbSDimitry Andric#include <__cxx03/__type_traits/is_same.h>
322*700637cbSDimitry Andric#include <__cxx03/__type_traits/promote.h>
323*700637cbSDimitry Andric#include <__cxx03/__type_traits/remove_cv.h>
324*700637cbSDimitry Andric#include <__cxx03/limits>
325*700637cbSDimitry Andric#include <__cxx03/version>
326*700637cbSDimitry Andric
327*700637cbSDimitry Andric#include <__cxx03/math.h>
328*700637cbSDimitry Andric
329*700637cbSDimitry Andric#ifndef _LIBCPP___CXX03_MATH_H
330*700637cbSDimitry Andric#   error <cmath> tried including <math.h> but didn't find libc++'s <math.h> header. \
331*700637cbSDimitry Andric          This usually means that your header search paths are not configured properly. \
332*700637cbSDimitry Andric          The header search paths should contain the C++ Standard Library headers before \
333*700637cbSDimitry Andric          any C Standard Library, and you are probably using compiler flags that make that \
334*700637cbSDimitry Andric          not be the case.
335*700637cbSDimitry Andric#endif
336*700637cbSDimitry Andric
337*700637cbSDimitry Andric#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
338*700637cbSDimitry Andric#  pragma GCC system_header
339*700637cbSDimitry Andric#endif
340*700637cbSDimitry Andric
341*700637cbSDimitry Andric_LIBCPP_PUSH_MACROS
342*700637cbSDimitry Andric#include <__cxx03/__undef_macros>
343*700637cbSDimitry Andric
344*700637cbSDimitry Andric_LIBCPP_BEGIN_NAMESPACE_STD
345*700637cbSDimitry Andric
346*700637cbSDimitry Andricusing ::signbit _LIBCPP_USING_IF_EXISTS;
347*700637cbSDimitry Andricusing ::fpclassify _LIBCPP_USING_IF_EXISTS;
348*700637cbSDimitry Andricusing ::isfinite _LIBCPP_USING_IF_EXISTS;
349*700637cbSDimitry Andricusing ::isinf _LIBCPP_USING_IF_EXISTS;
350*700637cbSDimitry Andricusing ::isnan _LIBCPP_USING_IF_EXISTS;
351*700637cbSDimitry Andricusing ::isnormal _LIBCPP_USING_IF_EXISTS;
352*700637cbSDimitry Andricusing ::isgreater _LIBCPP_USING_IF_EXISTS;
353*700637cbSDimitry Andricusing ::isgreaterequal _LIBCPP_USING_IF_EXISTS;
354*700637cbSDimitry Andricusing ::isless _LIBCPP_USING_IF_EXISTS;
355*700637cbSDimitry Andricusing ::islessequal _LIBCPP_USING_IF_EXISTS;
356*700637cbSDimitry Andricusing ::islessgreater _LIBCPP_USING_IF_EXISTS;
357*700637cbSDimitry Andricusing ::isunordered _LIBCPP_USING_IF_EXISTS;
358*700637cbSDimitry Andricusing ::isunordered _LIBCPP_USING_IF_EXISTS;
359*700637cbSDimitry Andric
360*700637cbSDimitry Andricusing ::float_t _LIBCPP_USING_IF_EXISTS;
361*700637cbSDimitry Andricusing ::double_t _LIBCPP_USING_IF_EXISTS;
362*700637cbSDimitry Andric
363*700637cbSDimitry Andricusing ::abs _LIBCPP_USING_IF_EXISTS;
364*700637cbSDimitry Andric
365*700637cbSDimitry Andricusing ::acos _LIBCPP_USING_IF_EXISTS;
366*700637cbSDimitry Andricusing ::acosf _LIBCPP_USING_IF_EXISTS;
367*700637cbSDimitry Andricusing ::asin _LIBCPP_USING_IF_EXISTS;
368*700637cbSDimitry Andricusing ::asinf _LIBCPP_USING_IF_EXISTS;
369*700637cbSDimitry Andricusing ::atan _LIBCPP_USING_IF_EXISTS;
370*700637cbSDimitry Andricusing ::atanf _LIBCPP_USING_IF_EXISTS;
371*700637cbSDimitry Andricusing ::atan2 _LIBCPP_USING_IF_EXISTS;
372*700637cbSDimitry Andricusing ::atan2f _LIBCPP_USING_IF_EXISTS;
373*700637cbSDimitry Andricusing ::ceil _LIBCPP_USING_IF_EXISTS;
374*700637cbSDimitry Andricusing ::ceilf _LIBCPP_USING_IF_EXISTS;
375*700637cbSDimitry Andricusing ::cos _LIBCPP_USING_IF_EXISTS;
376*700637cbSDimitry Andricusing ::cosf _LIBCPP_USING_IF_EXISTS;
377*700637cbSDimitry Andricusing ::cosh _LIBCPP_USING_IF_EXISTS;
378*700637cbSDimitry Andricusing ::coshf _LIBCPP_USING_IF_EXISTS;
379*700637cbSDimitry Andric
380*700637cbSDimitry Andricusing ::exp _LIBCPP_USING_IF_EXISTS;
381*700637cbSDimitry Andricusing ::expf _LIBCPP_USING_IF_EXISTS;
382*700637cbSDimitry Andric
383*700637cbSDimitry Andricusing ::fabs _LIBCPP_USING_IF_EXISTS;
384*700637cbSDimitry Andricusing ::fabsf _LIBCPP_USING_IF_EXISTS;
385*700637cbSDimitry Andricusing ::floor _LIBCPP_USING_IF_EXISTS;
386*700637cbSDimitry Andricusing ::floorf _LIBCPP_USING_IF_EXISTS;
387*700637cbSDimitry Andric
388*700637cbSDimitry Andricusing ::fmod _LIBCPP_USING_IF_EXISTS;
389*700637cbSDimitry Andricusing ::fmodf _LIBCPP_USING_IF_EXISTS;
390*700637cbSDimitry Andric
391*700637cbSDimitry Andricusing ::frexp _LIBCPP_USING_IF_EXISTS;
392*700637cbSDimitry Andricusing ::frexpf _LIBCPP_USING_IF_EXISTS;
393*700637cbSDimitry Andricusing ::ldexp _LIBCPP_USING_IF_EXISTS;
394*700637cbSDimitry Andricusing ::ldexpf _LIBCPP_USING_IF_EXISTS;
395*700637cbSDimitry Andric
396*700637cbSDimitry Andricusing ::log _LIBCPP_USING_IF_EXISTS;
397*700637cbSDimitry Andricusing ::logf _LIBCPP_USING_IF_EXISTS;
398*700637cbSDimitry Andric
399*700637cbSDimitry Andricusing ::log10 _LIBCPP_USING_IF_EXISTS;
400*700637cbSDimitry Andricusing ::log10f _LIBCPP_USING_IF_EXISTS;
401*700637cbSDimitry Andricusing ::modf _LIBCPP_USING_IF_EXISTS;
402*700637cbSDimitry Andricusing ::modff _LIBCPP_USING_IF_EXISTS;
403*700637cbSDimitry Andric
404*700637cbSDimitry Andricusing ::pow _LIBCPP_USING_IF_EXISTS;
405*700637cbSDimitry Andricusing ::powf _LIBCPP_USING_IF_EXISTS;
406*700637cbSDimitry Andric
407*700637cbSDimitry Andricusing ::sin _LIBCPP_USING_IF_EXISTS;
408*700637cbSDimitry Andricusing ::sinf _LIBCPP_USING_IF_EXISTS;
409*700637cbSDimitry Andricusing ::sinh _LIBCPP_USING_IF_EXISTS;
410*700637cbSDimitry Andricusing ::sinhf _LIBCPP_USING_IF_EXISTS;
411*700637cbSDimitry Andric
412*700637cbSDimitry Andricusing ::sqrt _LIBCPP_USING_IF_EXISTS;
413*700637cbSDimitry Andricusing ::sqrtf _LIBCPP_USING_IF_EXISTS;
414*700637cbSDimitry Andricusing ::tan _LIBCPP_USING_IF_EXISTS;
415*700637cbSDimitry Andricusing ::tanf _LIBCPP_USING_IF_EXISTS;
416*700637cbSDimitry Andric
417*700637cbSDimitry Andricusing ::tanh _LIBCPP_USING_IF_EXISTS;
418*700637cbSDimitry Andricusing ::tanhf _LIBCPP_USING_IF_EXISTS;
419*700637cbSDimitry Andric
420*700637cbSDimitry Andricusing ::acosh _LIBCPP_USING_IF_EXISTS;
421*700637cbSDimitry Andricusing ::acoshf _LIBCPP_USING_IF_EXISTS;
422*700637cbSDimitry Andricusing ::asinh _LIBCPP_USING_IF_EXISTS;
423*700637cbSDimitry Andricusing ::asinhf _LIBCPP_USING_IF_EXISTS;
424*700637cbSDimitry Andricusing ::atanh _LIBCPP_USING_IF_EXISTS;
425*700637cbSDimitry Andricusing ::atanhf _LIBCPP_USING_IF_EXISTS;
426*700637cbSDimitry Andricusing ::cbrt _LIBCPP_USING_IF_EXISTS;
427*700637cbSDimitry Andricusing ::cbrtf _LIBCPP_USING_IF_EXISTS;
428*700637cbSDimitry Andric
429*700637cbSDimitry Andricusing ::copysign _LIBCPP_USING_IF_EXISTS;
430*700637cbSDimitry Andricusing ::copysignf _LIBCPP_USING_IF_EXISTS;
431*700637cbSDimitry Andric
432*700637cbSDimitry Andricusing ::erf _LIBCPP_USING_IF_EXISTS;
433*700637cbSDimitry Andricusing ::erff _LIBCPP_USING_IF_EXISTS;
434*700637cbSDimitry Andricusing ::erfc _LIBCPP_USING_IF_EXISTS;
435*700637cbSDimitry Andricusing ::erfcf _LIBCPP_USING_IF_EXISTS;
436*700637cbSDimitry Andricusing ::exp2 _LIBCPP_USING_IF_EXISTS;
437*700637cbSDimitry Andricusing ::exp2f _LIBCPP_USING_IF_EXISTS;
438*700637cbSDimitry Andricusing ::expm1 _LIBCPP_USING_IF_EXISTS;
439*700637cbSDimitry Andricusing ::expm1f _LIBCPP_USING_IF_EXISTS;
440*700637cbSDimitry Andricusing ::fdim _LIBCPP_USING_IF_EXISTS;
441*700637cbSDimitry Andricusing ::fdimf _LIBCPP_USING_IF_EXISTS;
442*700637cbSDimitry Andricusing ::fmaf _LIBCPP_USING_IF_EXISTS;
443*700637cbSDimitry Andricusing ::fma _LIBCPP_USING_IF_EXISTS;
444*700637cbSDimitry Andricusing ::fmax _LIBCPP_USING_IF_EXISTS;
445*700637cbSDimitry Andricusing ::fmaxf _LIBCPP_USING_IF_EXISTS;
446*700637cbSDimitry Andricusing ::fmin _LIBCPP_USING_IF_EXISTS;
447*700637cbSDimitry Andricusing ::fminf _LIBCPP_USING_IF_EXISTS;
448*700637cbSDimitry Andricusing ::hypot _LIBCPP_USING_IF_EXISTS;
449*700637cbSDimitry Andricusing ::hypotf _LIBCPP_USING_IF_EXISTS;
450*700637cbSDimitry Andricusing ::ilogb _LIBCPP_USING_IF_EXISTS;
451*700637cbSDimitry Andricusing ::ilogbf _LIBCPP_USING_IF_EXISTS;
452*700637cbSDimitry Andricusing ::lgamma _LIBCPP_USING_IF_EXISTS;
453*700637cbSDimitry Andricusing ::lgammaf _LIBCPP_USING_IF_EXISTS;
454*700637cbSDimitry Andricusing ::llrint _LIBCPP_USING_IF_EXISTS;
455*700637cbSDimitry Andricusing ::llrintf _LIBCPP_USING_IF_EXISTS;
456*700637cbSDimitry Andricusing ::llround _LIBCPP_USING_IF_EXISTS;
457*700637cbSDimitry Andricusing ::llroundf _LIBCPP_USING_IF_EXISTS;
458*700637cbSDimitry Andricusing ::log1p _LIBCPP_USING_IF_EXISTS;
459*700637cbSDimitry Andricusing ::log1pf _LIBCPP_USING_IF_EXISTS;
460*700637cbSDimitry Andricusing ::log2 _LIBCPP_USING_IF_EXISTS;
461*700637cbSDimitry Andricusing ::log2f _LIBCPP_USING_IF_EXISTS;
462*700637cbSDimitry Andricusing ::logb _LIBCPP_USING_IF_EXISTS;
463*700637cbSDimitry Andricusing ::logbf _LIBCPP_USING_IF_EXISTS;
464*700637cbSDimitry Andricusing ::lrint _LIBCPP_USING_IF_EXISTS;
465*700637cbSDimitry Andricusing ::lrintf _LIBCPP_USING_IF_EXISTS;
466*700637cbSDimitry Andricusing ::lround _LIBCPP_USING_IF_EXISTS;
467*700637cbSDimitry Andricusing ::lroundf _LIBCPP_USING_IF_EXISTS;
468*700637cbSDimitry Andric
469*700637cbSDimitry Andricusing ::nan _LIBCPP_USING_IF_EXISTS;
470*700637cbSDimitry Andricusing ::nanf _LIBCPP_USING_IF_EXISTS;
471*700637cbSDimitry Andric
472*700637cbSDimitry Andricusing ::nearbyint _LIBCPP_USING_IF_EXISTS;
473*700637cbSDimitry Andricusing ::nearbyintf _LIBCPP_USING_IF_EXISTS;
474*700637cbSDimitry Andricusing ::nextafter _LIBCPP_USING_IF_EXISTS;
475*700637cbSDimitry Andricusing ::nextafterf _LIBCPP_USING_IF_EXISTS;
476*700637cbSDimitry Andricusing ::nexttoward _LIBCPP_USING_IF_EXISTS;
477*700637cbSDimitry Andricusing ::nexttowardf _LIBCPP_USING_IF_EXISTS;
478*700637cbSDimitry Andricusing ::remainder _LIBCPP_USING_IF_EXISTS;
479*700637cbSDimitry Andricusing ::remainderf _LIBCPP_USING_IF_EXISTS;
480*700637cbSDimitry Andricusing ::remquo _LIBCPP_USING_IF_EXISTS;
481*700637cbSDimitry Andricusing ::remquof _LIBCPP_USING_IF_EXISTS;
482*700637cbSDimitry Andricusing ::rint _LIBCPP_USING_IF_EXISTS;
483*700637cbSDimitry Andricusing ::rintf _LIBCPP_USING_IF_EXISTS;
484*700637cbSDimitry Andricusing ::round _LIBCPP_USING_IF_EXISTS;
485*700637cbSDimitry Andricusing ::roundf _LIBCPP_USING_IF_EXISTS;
486*700637cbSDimitry Andricusing ::scalbln _LIBCPP_USING_IF_EXISTS;
487*700637cbSDimitry Andricusing ::scalblnf _LIBCPP_USING_IF_EXISTS;
488*700637cbSDimitry Andricusing ::scalbn _LIBCPP_USING_IF_EXISTS;
489*700637cbSDimitry Andricusing ::scalbnf _LIBCPP_USING_IF_EXISTS;
490*700637cbSDimitry Andricusing ::tgamma _LIBCPP_USING_IF_EXISTS;
491*700637cbSDimitry Andricusing ::tgammaf _LIBCPP_USING_IF_EXISTS;
492*700637cbSDimitry Andricusing ::trunc _LIBCPP_USING_IF_EXISTS;
493*700637cbSDimitry Andricusing ::truncf _LIBCPP_USING_IF_EXISTS;
494*700637cbSDimitry Andric
495*700637cbSDimitry Andricusing ::acosl _LIBCPP_USING_IF_EXISTS;
496*700637cbSDimitry Andricusing ::asinl _LIBCPP_USING_IF_EXISTS;
497*700637cbSDimitry Andricusing ::atanl _LIBCPP_USING_IF_EXISTS;
498*700637cbSDimitry Andricusing ::atan2l _LIBCPP_USING_IF_EXISTS;
499*700637cbSDimitry Andricusing ::ceill _LIBCPP_USING_IF_EXISTS;
500*700637cbSDimitry Andricusing ::cosl _LIBCPP_USING_IF_EXISTS;
501*700637cbSDimitry Andricusing ::coshl _LIBCPP_USING_IF_EXISTS;
502*700637cbSDimitry Andricusing ::expl _LIBCPP_USING_IF_EXISTS;
503*700637cbSDimitry Andricusing ::fabsl _LIBCPP_USING_IF_EXISTS;
504*700637cbSDimitry Andricusing ::floorl _LIBCPP_USING_IF_EXISTS;
505*700637cbSDimitry Andricusing ::fmodl _LIBCPP_USING_IF_EXISTS;
506*700637cbSDimitry Andricusing ::frexpl _LIBCPP_USING_IF_EXISTS;
507*700637cbSDimitry Andricusing ::ldexpl _LIBCPP_USING_IF_EXISTS;
508*700637cbSDimitry Andricusing ::logl _LIBCPP_USING_IF_EXISTS;
509*700637cbSDimitry Andricusing ::log10l _LIBCPP_USING_IF_EXISTS;
510*700637cbSDimitry Andricusing ::modfl _LIBCPP_USING_IF_EXISTS;
511*700637cbSDimitry Andricusing ::powl _LIBCPP_USING_IF_EXISTS;
512*700637cbSDimitry Andricusing ::sinl _LIBCPP_USING_IF_EXISTS;
513*700637cbSDimitry Andricusing ::sinhl _LIBCPP_USING_IF_EXISTS;
514*700637cbSDimitry Andricusing ::sqrtl _LIBCPP_USING_IF_EXISTS;
515*700637cbSDimitry Andricusing ::tanl _LIBCPP_USING_IF_EXISTS;
516*700637cbSDimitry Andric
517*700637cbSDimitry Andricusing ::tanhl _LIBCPP_USING_IF_EXISTS;
518*700637cbSDimitry Andricusing ::acoshl _LIBCPP_USING_IF_EXISTS;
519*700637cbSDimitry Andricusing ::asinhl _LIBCPP_USING_IF_EXISTS;
520*700637cbSDimitry Andricusing ::atanhl _LIBCPP_USING_IF_EXISTS;
521*700637cbSDimitry Andricusing ::cbrtl _LIBCPP_USING_IF_EXISTS;
522*700637cbSDimitry Andric
523*700637cbSDimitry Andricusing ::copysignl _LIBCPP_USING_IF_EXISTS;
524*700637cbSDimitry Andric
525*700637cbSDimitry Andricusing ::erfl _LIBCPP_USING_IF_EXISTS;
526*700637cbSDimitry Andricusing ::erfcl _LIBCPP_USING_IF_EXISTS;
527*700637cbSDimitry Andricusing ::exp2l _LIBCPP_USING_IF_EXISTS;
528*700637cbSDimitry Andricusing ::expm1l _LIBCPP_USING_IF_EXISTS;
529*700637cbSDimitry Andricusing ::fdiml _LIBCPP_USING_IF_EXISTS;
530*700637cbSDimitry Andricusing ::fmal _LIBCPP_USING_IF_EXISTS;
531*700637cbSDimitry Andricusing ::fmaxl _LIBCPP_USING_IF_EXISTS;
532*700637cbSDimitry Andricusing ::fminl _LIBCPP_USING_IF_EXISTS;
533*700637cbSDimitry Andricusing ::hypotl _LIBCPP_USING_IF_EXISTS;
534*700637cbSDimitry Andricusing ::ilogbl _LIBCPP_USING_IF_EXISTS;
535*700637cbSDimitry Andricusing ::lgammal _LIBCPP_USING_IF_EXISTS;
536*700637cbSDimitry Andricusing ::llrintl _LIBCPP_USING_IF_EXISTS;
537*700637cbSDimitry Andricusing ::llroundl _LIBCPP_USING_IF_EXISTS;
538*700637cbSDimitry Andricusing ::log1pl _LIBCPP_USING_IF_EXISTS;
539*700637cbSDimitry Andricusing ::log2l _LIBCPP_USING_IF_EXISTS;
540*700637cbSDimitry Andricusing ::logbl _LIBCPP_USING_IF_EXISTS;
541*700637cbSDimitry Andricusing ::lrintl _LIBCPP_USING_IF_EXISTS;
542*700637cbSDimitry Andricusing ::lroundl _LIBCPP_USING_IF_EXISTS;
543*700637cbSDimitry Andricusing ::nanl _LIBCPP_USING_IF_EXISTS;
544*700637cbSDimitry Andricusing ::nearbyintl _LIBCPP_USING_IF_EXISTS;
545*700637cbSDimitry Andricusing ::nextafterl _LIBCPP_USING_IF_EXISTS;
546*700637cbSDimitry Andricusing ::nexttowardl _LIBCPP_USING_IF_EXISTS;
547*700637cbSDimitry Andricusing ::remainderl _LIBCPP_USING_IF_EXISTS;
548*700637cbSDimitry Andricusing ::remquol _LIBCPP_USING_IF_EXISTS;
549*700637cbSDimitry Andricusing ::rintl _LIBCPP_USING_IF_EXISTS;
550*700637cbSDimitry Andricusing ::roundl _LIBCPP_USING_IF_EXISTS;
551*700637cbSDimitry Andricusing ::scalblnl _LIBCPP_USING_IF_EXISTS;
552*700637cbSDimitry Andricusing ::scalbnl _LIBCPP_USING_IF_EXISTS;
553*700637cbSDimitry Andricusing ::tgammal _LIBCPP_USING_IF_EXISTS;
554*700637cbSDimitry Andricusing ::truncl _LIBCPP_USING_IF_EXISTS;
555*700637cbSDimitry Andric
556*700637cbSDimitry Andrictemplate <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
557*700637cbSDimitry Andric_LIBCPP_HIDE_FROM_ABI bool __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT {
558*700637cbSDimitry Andric#if __has_builtin(__builtin_isnan)
559*700637cbSDimitry Andric  return __builtin_isnan(__lcpp_x);
560*700637cbSDimitry Andric#else
561*700637cbSDimitry Andric  return isnan(__lcpp_x);
562*700637cbSDimitry Andric#endif
563*700637cbSDimitry Andric}
564*700637cbSDimitry Andric
565*700637cbSDimitry Andrictemplate <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
566*700637cbSDimitry Andric_LIBCPP_HIDE_FROM_ABI bool __constexpr_isnan(_A1 __lcpp_x) _NOEXCEPT {
567*700637cbSDimitry Andric  return std::isnan(__lcpp_x);
568*700637cbSDimitry Andric}
569*700637cbSDimitry Andric
570*700637cbSDimitry Andrictemplate <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
571*700637cbSDimitry Andric_LIBCPP_HIDE_FROM_ABI bool __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT {
572*700637cbSDimitry Andric#if __has_builtin(__builtin_isinf)
573*700637cbSDimitry Andric  return __builtin_isinf(__lcpp_x);
574*700637cbSDimitry Andric#else
575*700637cbSDimitry Andric  return isinf(__lcpp_x);
576*700637cbSDimitry Andric#endif
577*700637cbSDimitry Andric}
578*700637cbSDimitry Andric
579*700637cbSDimitry Andrictemplate <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
580*700637cbSDimitry Andric_LIBCPP_HIDE_FROM_ABI bool __constexpr_isinf(_A1 __lcpp_x) _NOEXCEPT {
581*700637cbSDimitry Andric  return std::isinf(__lcpp_x);
582*700637cbSDimitry Andric}
583*700637cbSDimitry Andric
584*700637cbSDimitry Andrictemplate <class _A1, __enable_if_t<is_floating_point<_A1>::value, int> = 0>
585*700637cbSDimitry Andric_LIBCPP_HIDE_FROM_ABI bool __constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT {
586*700637cbSDimitry Andric#if __has_builtin(__builtin_isfinite)
587*700637cbSDimitry Andric  return __builtin_isfinite(__lcpp_x);
588*700637cbSDimitry Andric#else
589*700637cbSDimitry Andric  return isfinite(__lcpp_x);
590*700637cbSDimitry Andric#endif
591*700637cbSDimitry Andric}
592*700637cbSDimitry Andric
593*700637cbSDimitry Andrictemplate <class _A1, __enable_if_t<!is_floating_point<_A1>::value, int> = 0>
594*700637cbSDimitry Andric_LIBCPP_HIDE_FROM_ABI bool __constexpr_isfinite(_A1 __lcpp_x) _NOEXCEPT {
595*700637cbSDimitry Andric  return __builtin_isfinite(__lcpp_x);
596*700637cbSDimitry Andric}
597*700637cbSDimitry Andric
598*700637cbSDimitry Andric_LIBCPP_END_NAMESPACE_STD
599*700637cbSDimitry Andric
600*700637cbSDimitry Andric_LIBCPP_POP_MACROS
601*700637cbSDimitry Andric
602*700637cbSDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
603*700637cbSDimitry Andric#  include <__cxx03/type_traits>
604*700637cbSDimitry Andric#endif
605*700637cbSDimitry Andric
606*700637cbSDimitry Andric#endif // _LIBCPP___CXX03_CMATH
607