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