1 /*===---- tgmath.h - Standard header for type generic math ----------------===*\
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 \*===----------------------------------------------------------------------===*/
9 #ifndef __CLANG_TGMATH_H
10 #define __CLANG_TGMATH_H
12 /* C99 7.22 Type-generic math <tgmath.h>. */
16 * Allow additional definitions and implementation-defined values on Apple
17 * platforms. This is done after #include <math.h> to avoid depcycle conflicts
18 * between libcxx and darwin in C++ modules builds.
20 #if defined(__APPLE__) && __STDC_HOSTED__ && __has_include_next(<tgmath.h>)
21 # include_next <tgmath.h>
24 /* C++ handles type genericity with overloading in math.h. */
28 #define _TG_ATTRSp __attribute__((__overloadable__))
29 #define _TG_ATTRS __attribute__((__overloadable__, __always_inline__))
33 typedef void _Argument_type_is_not_arithmetic
;
34 static _Argument_type_is_not_arithmetic
__tg_promote(...)
35 __attribute__((__unavailable__
,__overloadable__
));
36 static double _TG_ATTRSp
__tg_promote(int);
37 static double _TG_ATTRSp
__tg_promote(unsigned int);
38 static double _TG_ATTRSp
__tg_promote(long);
39 static double _TG_ATTRSp
__tg_promote(unsigned long);
40 static double _TG_ATTRSp
__tg_promote(long long);
41 static double _TG_ATTRSp
__tg_promote(unsigned long long);
42 static float _TG_ATTRSp
__tg_promote(float);
43 static double _TG_ATTRSp
__tg_promote(double);
44 static long double _TG_ATTRSp
__tg_promote(long double);
45 static float _Complex _TG_ATTRSp
__tg_promote(float _Complex
);
46 static double _Complex _TG_ATTRSp
__tg_promote(double _Complex
);
47 static long double _Complex _TG_ATTRSp
__tg_promote(long double _Complex
);
49 #define __tg_promote1(__x) (__typeof__(__tg_promote(__x)))
50 #define __tg_promote2(__x, __y) (__typeof__(__tg_promote(__x) + \
52 #define __tg_promote3(__x, __y, __z) (__typeof__(__tg_promote(__x) + \
60 __tg_acos(float __x
) {return acosf(__x
);}
64 __tg_acos(double __x
) {return acos(__x
);}
68 __tg_acos(long double __x
) {return acosl(__x
);}
72 __tg_acos(float _Complex __x
) {return cacosf(__x
);}
74 static double _Complex
76 __tg_acos(double _Complex __x
) {return cacos(__x
);}
78 static long double _Complex
80 __tg_acos(long double _Complex __x
) {return cacosl(__x
);}
83 #define acos(__x) __tg_acos(__tg_promote1((__x))(__x))
89 __tg_asin(float __x
) {return asinf(__x
);}
93 __tg_asin(double __x
) {return asin(__x
);}
97 __tg_asin(long double __x
) {return asinl(__x
);}
101 __tg_asin(float _Complex __x
) {return casinf(__x
);}
103 static double _Complex
105 __tg_asin(double _Complex __x
) {return casin(__x
);}
107 static long double _Complex
109 __tg_asin(long double _Complex __x
) {return casinl(__x
);}
112 #define asin(__x) __tg_asin(__tg_promote1((__x))(__x))
118 __tg_atan(float __x
) {return atanf(__x
);}
122 __tg_atan(double __x
) {return atan(__x
);}
126 __tg_atan(long double __x
) {return atanl(__x
);}
128 static float _Complex
130 __tg_atan(float _Complex __x
) {return catanf(__x
);}
132 static double _Complex
134 __tg_atan(double _Complex __x
) {return catan(__x
);}
136 static long double _Complex
138 __tg_atan(long double _Complex __x
) {return catanl(__x
);}
141 #define atan(__x) __tg_atan(__tg_promote1((__x))(__x))
147 __tg_acosh(float __x
) {return acoshf(__x
);}
151 __tg_acosh(double __x
) {return acosh(__x
);}
155 __tg_acosh(long double __x
) {return acoshl(__x
);}
157 static float _Complex
159 __tg_acosh(float _Complex __x
) {return cacoshf(__x
);}
161 static double _Complex
163 __tg_acosh(double _Complex __x
) {return cacosh(__x
);}
165 static long double _Complex
167 __tg_acosh(long double _Complex __x
) {return cacoshl(__x
);}
170 #define acosh(__x) __tg_acosh(__tg_promote1((__x))(__x))
176 __tg_asinh(float __x
) {return asinhf(__x
);}
180 __tg_asinh(double __x
) {return asinh(__x
);}
184 __tg_asinh(long double __x
) {return asinhl(__x
);}
186 static float _Complex
188 __tg_asinh(float _Complex __x
) {return casinhf(__x
);}
190 static double _Complex
192 __tg_asinh(double _Complex __x
) {return casinh(__x
);}
194 static long double _Complex
196 __tg_asinh(long double _Complex __x
) {return casinhl(__x
);}
199 #define asinh(__x) __tg_asinh(__tg_promote1((__x))(__x))
205 __tg_atanh(float __x
) {return atanhf(__x
);}
209 __tg_atanh(double __x
) {return atanh(__x
);}
213 __tg_atanh(long double __x
) {return atanhl(__x
);}
215 static float _Complex
217 __tg_atanh(float _Complex __x
) {return catanhf(__x
);}
219 static double _Complex
221 __tg_atanh(double _Complex __x
) {return catanh(__x
);}
223 static long double _Complex
225 __tg_atanh(long double _Complex __x
) {return catanhl(__x
);}
228 #define atanh(__x) __tg_atanh(__tg_promote1((__x))(__x))
234 __tg_cos(float __x
) {return cosf(__x
);}
238 __tg_cos(double __x
) {return cos(__x
);}
242 __tg_cos(long double __x
) {return cosl(__x
);}
244 static float _Complex
246 __tg_cos(float _Complex __x
) {return ccosf(__x
);}
248 static double _Complex
250 __tg_cos(double _Complex __x
) {return ccos(__x
);}
252 static long double _Complex
254 __tg_cos(long double _Complex __x
) {return ccosl(__x
);}
257 #define cos(__x) __tg_cos(__tg_promote1((__x))(__x))
263 __tg_sin(float __x
) {return sinf(__x
);}
267 __tg_sin(double __x
) {return sin(__x
);}
271 __tg_sin(long double __x
) {return sinl(__x
);}
273 static float _Complex
275 __tg_sin(float _Complex __x
) {return csinf(__x
);}
277 static double _Complex
279 __tg_sin(double _Complex __x
) {return csin(__x
);}
281 static long double _Complex
283 __tg_sin(long double _Complex __x
) {return csinl(__x
);}
286 #define sin(__x) __tg_sin(__tg_promote1((__x))(__x))
292 __tg_tan(float __x
) {return tanf(__x
);}
296 __tg_tan(double __x
) {return tan(__x
);}
300 __tg_tan(long double __x
) {return tanl(__x
);}
302 static float _Complex
304 __tg_tan(float _Complex __x
) {return ctanf(__x
);}
306 static double _Complex
308 __tg_tan(double _Complex __x
) {return ctan(__x
);}
310 static long double _Complex
312 __tg_tan(long double _Complex __x
) {return ctanl(__x
);}
315 #define tan(__x) __tg_tan(__tg_promote1((__x))(__x))
321 __tg_cosh(float __x
) {return coshf(__x
);}
325 __tg_cosh(double __x
) {return cosh(__x
);}
329 __tg_cosh(long double __x
) {return coshl(__x
);}
331 static float _Complex
333 __tg_cosh(float _Complex __x
) {return ccoshf(__x
);}
335 static double _Complex
337 __tg_cosh(double _Complex __x
) {return ccosh(__x
);}
339 static long double _Complex
341 __tg_cosh(long double _Complex __x
) {return ccoshl(__x
);}
344 #define cosh(__x) __tg_cosh(__tg_promote1((__x))(__x))
350 __tg_sinh(float __x
) {return sinhf(__x
);}
354 __tg_sinh(double __x
) {return sinh(__x
);}
358 __tg_sinh(long double __x
) {return sinhl(__x
);}
360 static float _Complex
362 __tg_sinh(float _Complex __x
) {return csinhf(__x
);}
364 static double _Complex
366 __tg_sinh(double _Complex __x
) {return csinh(__x
);}
368 static long double _Complex
370 __tg_sinh(long double _Complex __x
) {return csinhl(__x
);}
373 #define sinh(__x) __tg_sinh(__tg_promote1((__x))(__x))
379 __tg_tanh(float __x
) {return tanhf(__x
);}
383 __tg_tanh(double __x
) {return tanh(__x
);}
387 __tg_tanh(long double __x
) {return tanhl(__x
);}
389 static float _Complex
391 __tg_tanh(float _Complex __x
) {return ctanhf(__x
);}
393 static double _Complex
395 __tg_tanh(double _Complex __x
) {return ctanh(__x
);}
397 static long double _Complex
399 __tg_tanh(long double _Complex __x
) {return ctanhl(__x
);}
402 #define tanh(__x) __tg_tanh(__tg_promote1((__x))(__x))
408 __tg_exp(float __x
) {return expf(__x
);}
412 __tg_exp(double __x
) {return exp(__x
);}
416 __tg_exp(long double __x
) {return expl(__x
);}
418 static float _Complex
420 __tg_exp(float _Complex __x
) {return cexpf(__x
);}
422 static double _Complex
424 __tg_exp(double _Complex __x
) {return cexp(__x
);}
426 static long double _Complex
428 __tg_exp(long double _Complex __x
) {return cexpl(__x
);}
431 #define exp(__x) __tg_exp(__tg_promote1((__x))(__x))
437 __tg_log(float __x
) {return logf(__x
);}
441 __tg_log(double __x
) {return log(__x
);}
445 __tg_log(long double __x
) {return logl(__x
);}
447 static float _Complex
449 __tg_log(float _Complex __x
) {return clogf(__x
);}
451 static double _Complex
453 __tg_log(double _Complex __x
) {return clog(__x
);}
455 static long double _Complex
457 __tg_log(long double _Complex __x
) {return clogl(__x
);}
460 #define log(__x) __tg_log(__tg_promote1((__x))(__x))
466 __tg_pow(float __x
, float __y
) {return powf(__x
, __y
);}
470 __tg_pow(double __x
, double __y
) {return pow(__x
, __y
);}
474 __tg_pow(long double __x
, long double __y
) {return powl(__x
, __y
);}
476 static float _Complex
478 __tg_pow(float _Complex __x
, float _Complex __y
) {return cpowf(__x
, __y
);}
480 static double _Complex
482 __tg_pow(double _Complex __x
, double _Complex __y
) {return cpow(__x
, __y
);}
484 static long double _Complex
486 __tg_pow(long double _Complex __x
, long double _Complex __y
)
487 {return cpowl(__x
, __y
);}
490 #define pow(__x, __y) __tg_pow(__tg_promote2((__x), (__y))(__x), \
491 __tg_promote2((__x), (__y))(__y))
497 __tg_sqrt(float __x
) {return sqrtf(__x
);}
501 __tg_sqrt(double __x
) {return sqrt(__x
);}
505 __tg_sqrt(long double __x
) {return sqrtl(__x
);}
507 static float _Complex
509 __tg_sqrt(float _Complex __x
) {return csqrtf(__x
);}
511 static double _Complex
513 __tg_sqrt(double _Complex __x
) {return csqrt(__x
);}
515 static long double _Complex
517 __tg_sqrt(long double _Complex __x
) {return csqrtl(__x
);}
520 #define sqrt(__x) __tg_sqrt(__tg_promote1((__x))(__x))
526 __tg_fabs(float __x
) {return fabsf(__x
);}
530 __tg_fabs(double __x
) {return fabs(__x
);}
534 __tg_fabs(long double __x
) {return fabsl(__x
);}
538 __tg_fabs(float _Complex __x
) {return cabsf(__x
);}
542 __tg_fabs(double _Complex __x
) {return cabs(__x
);}
546 __tg_fabs(long double _Complex __x
) {return cabsl(__x
);}
549 #define fabs(__x) __tg_fabs(__tg_promote1((__x))(__x))
555 __tg_atan2(float __x
, float __y
) {return atan2f(__x
, __y
);}
559 __tg_atan2(double __x
, double __y
) {return atan2(__x
, __y
);}
563 __tg_atan2(long double __x
, long double __y
) {return atan2l(__x
, __y
);}
566 #define atan2(__x, __y) __tg_atan2(__tg_promote2((__x), (__y))(__x), \
567 __tg_promote2((__x), (__y))(__y))
573 __tg_cbrt(float __x
) {return cbrtf(__x
);}
577 __tg_cbrt(double __x
) {return cbrt(__x
);}
581 __tg_cbrt(long double __x
) {return cbrtl(__x
);}
584 #define cbrt(__x) __tg_cbrt(__tg_promote1((__x))(__x))
590 __tg_ceil(float __x
) {return ceilf(__x
);}
594 __tg_ceil(double __x
) {return ceil(__x
);}
598 __tg_ceil(long double __x
) {return ceill(__x
);}
601 #define ceil(__x) __tg_ceil(__tg_promote1((__x))(__x))
607 __tg_copysign(float __x
, float __y
) {return copysignf(__x
, __y
);}
611 __tg_copysign(double __x
, double __y
) {return copysign(__x
, __y
);}
615 __tg_copysign(long double __x
, long double __y
) {return copysignl(__x
, __y
);}
618 #define copysign(__x, __y) __tg_copysign(__tg_promote2((__x), (__y))(__x), \
619 __tg_promote2((__x), (__y))(__y))
625 __tg_erf(float __x
) {return erff(__x
);}
629 __tg_erf(double __x
) {return erf(__x
);}
633 __tg_erf(long double __x
) {return erfl(__x
);}
636 #define erf(__x) __tg_erf(__tg_promote1((__x))(__x))
642 __tg_erfc(float __x
) {return erfcf(__x
);}
646 __tg_erfc(double __x
) {return erfc(__x
);}
650 __tg_erfc(long double __x
) {return erfcl(__x
);}
653 #define erfc(__x) __tg_erfc(__tg_promote1((__x))(__x))
659 __tg_exp2(float __x
) {return exp2f(__x
);}
663 __tg_exp2(double __x
) {return exp2(__x
);}
667 __tg_exp2(long double __x
) {return exp2l(__x
);}
670 #define exp2(__x) __tg_exp2(__tg_promote1((__x))(__x))
676 __tg_expm1(float __x
) {return expm1f(__x
);}
680 __tg_expm1(double __x
) {return expm1(__x
);}
684 __tg_expm1(long double __x
) {return expm1l(__x
);}
687 #define expm1(__x) __tg_expm1(__tg_promote1((__x))(__x))
693 __tg_fdim(float __x
, float __y
) {return fdimf(__x
, __y
);}
697 __tg_fdim(double __x
, double __y
) {return fdim(__x
, __y
);}
701 __tg_fdim(long double __x
, long double __y
) {return fdiml(__x
, __y
);}
704 #define fdim(__x, __y) __tg_fdim(__tg_promote2((__x), (__y))(__x), \
705 __tg_promote2((__x), (__y))(__y))
711 __tg_floor(float __x
) {return floorf(__x
);}
715 __tg_floor(double __x
) {return floor(__x
);}
719 __tg_floor(long double __x
) {return floorl(__x
);}
722 #define floor(__x) __tg_floor(__tg_promote1((__x))(__x))
728 __tg_fma(float __x
, float __y
, float __z
)
729 {return fmaf(__x
, __y
, __z
);}
733 __tg_fma(double __x
, double __y
, double __z
)
734 {return fma(__x
, __y
, __z
);}
738 __tg_fma(long double __x
,long double __y
, long double __z
)
739 {return fmal(__x
, __y
, __z
);}
742 #define fma(__x, __y, __z) \
743 __tg_fma(__tg_promote3((__x), (__y), (__z))(__x), \
744 __tg_promote3((__x), (__y), (__z))(__y), \
745 __tg_promote3((__x), (__y), (__z))(__z))
751 __tg_fmax(float __x
, float __y
) {return fmaxf(__x
, __y
);}
755 __tg_fmax(double __x
, double __y
) {return fmax(__x
, __y
);}
759 __tg_fmax(long double __x
, long double __y
) {return fmaxl(__x
, __y
);}
762 #define fmax(__x, __y) __tg_fmax(__tg_promote2((__x), (__y))(__x), \
763 __tg_promote2((__x), (__y))(__y))
769 __tg_fmin(float __x
, float __y
) {return fminf(__x
, __y
);}
773 __tg_fmin(double __x
, double __y
) {return fmin(__x
, __y
);}
777 __tg_fmin(long double __x
, long double __y
) {return fminl(__x
, __y
);}
780 #define fmin(__x, __y) __tg_fmin(__tg_promote2((__x), (__y))(__x), \
781 __tg_promote2((__x), (__y))(__y))
787 __tg_fmod(float __x
, float __y
) {return fmodf(__x
, __y
);}
791 __tg_fmod(double __x
, double __y
) {return fmod(__x
, __y
);}
795 __tg_fmod(long double __x
, long double __y
) {return fmodl(__x
, __y
);}
798 #define fmod(__x, __y) __tg_fmod(__tg_promote2((__x), (__y))(__x), \
799 __tg_promote2((__x), (__y))(__y))
805 __tg_frexp(float __x
, int* __y
) {return frexpf(__x
, __y
);}
809 __tg_frexp(double __x
, int* __y
) {return frexp(__x
, __y
);}
813 __tg_frexp(long double __x
, int* __y
) {return frexpl(__x
, __y
);}
816 #define frexp(__x, __y) __tg_frexp(__tg_promote1((__x))(__x), __y)
822 __tg_hypot(float __x
, float __y
) {return hypotf(__x
, __y
);}
826 __tg_hypot(double __x
, double __y
) {return hypot(__x
, __y
);}
830 __tg_hypot(long double __x
, long double __y
) {return hypotl(__x
, __y
);}
833 #define hypot(__x, __y) __tg_hypot(__tg_promote2((__x), (__y))(__x), \
834 __tg_promote2((__x), (__y))(__y))
840 __tg_ilogb(float __x
) {return ilogbf(__x
);}
844 __tg_ilogb(double __x
) {return ilogb(__x
);}
848 __tg_ilogb(long double __x
) {return ilogbl(__x
);}
851 #define ilogb(__x) __tg_ilogb(__tg_promote1((__x))(__x))
857 __tg_ldexp(float __x
, int __y
) {return ldexpf(__x
, __y
);}
861 __tg_ldexp(double __x
, int __y
) {return ldexp(__x
, __y
);}
865 __tg_ldexp(long double __x
, int __y
) {return ldexpl(__x
, __y
);}
868 #define ldexp(__x, __y) __tg_ldexp(__tg_promote1((__x))(__x), __y)
874 __tg_lgamma(float __x
) {return lgammaf(__x
);}
878 __tg_lgamma(double __x
) {return lgamma(__x
);}
882 __tg_lgamma(long double __x
) {return lgammal(__x
);}
885 #define lgamma(__x) __tg_lgamma(__tg_promote1((__x))(__x))
891 __tg_llrint(float __x
) {return llrintf(__x
);}
895 __tg_llrint(double __x
) {return llrint(__x
);}
899 __tg_llrint(long double __x
) {return llrintl(__x
);}
902 #define llrint(__x) __tg_llrint(__tg_promote1((__x))(__x))
908 __tg_llround(float __x
) {return llroundf(__x
);}
912 __tg_llround(double __x
) {return llround(__x
);}
916 __tg_llround(long double __x
) {return llroundl(__x
);}
919 #define llround(__x) __tg_llround(__tg_promote1((__x))(__x))
925 __tg_log10(float __x
) {return log10f(__x
);}
929 __tg_log10(double __x
) {return log10(__x
);}
933 __tg_log10(long double __x
) {return log10l(__x
);}
936 #define log10(__x) __tg_log10(__tg_promote1((__x))(__x))
942 __tg_log1p(float __x
) {return log1pf(__x
);}
946 __tg_log1p(double __x
) {return log1p(__x
);}
950 __tg_log1p(long double __x
) {return log1pl(__x
);}
953 #define log1p(__x) __tg_log1p(__tg_promote1((__x))(__x))
959 __tg_log2(float __x
) {return log2f(__x
);}
963 __tg_log2(double __x
) {return log2(__x
);}
967 __tg_log2(long double __x
) {return log2l(__x
);}
970 #define log2(__x) __tg_log2(__tg_promote1((__x))(__x))
976 __tg_logb(float __x
) {return logbf(__x
);}
980 __tg_logb(double __x
) {return logb(__x
);}
984 __tg_logb(long double __x
) {return logbl(__x
);}
987 #define logb(__x) __tg_logb(__tg_promote1((__x))(__x))
993 __tg_lrint(float __x
) {return lrintf(__x
);}
997 __tg_lrint(double __x
) {return lrint(__x
);}
1001 __tg_lrint(long double __x
) {return lrintl(__x
);}
1004 #define lrint(__x) __tg_lrint(__tg_promote1((__x))(__x))
1010 __tg_lround(float __x
) {return lroundf(__x
);}
1014 __tg_lround(double __x
) {return lround(__x
);}
1018 __tg_lround(long double __x
) {return lroundl(__x
);}
1021 #define lround(__x) __tg_lround(__tg_promote1((__x))(__x))
1027 __tg_nearbyint(float __x
) {return nearbyintf(__x
);}
1031 __tg_nearbyint(double __x
) {return nearbyint(__x
);}
1035 __tg_nearbyint(long double __x
) {return nearbyintl(__x
);}
1038 #define nearbyint(__x) __tg_nearbyint(__tg_promote1((__x))(__x))
1044 __tg_nextafter(float __x
, float __y
) {return nextafterf(__x
, __y
);}
1048 __tg_nextafter(double __x
, double __y
) {return nextafter(__x
, __y
);}
1052 __tg_nextafter(long double __x
, long double __y
) {return nextafterl(__x
, __y
);}
1055 #define nextafter(__x, __y) __tg_nextafter(__tg_promote2((__x), (__y))(__x), \
1056 __tg_promote2((__x), (__y))(__y))
1062 __tg_nexttoward(float __x
, long double __y
) {return nexttowardf(__x
, __y
);}
1066 __tg_nexttoward(double __x
, long double __y
) {return nexttoward(__x
, __y
);}
1070 __tg_nexttoward(long double __x
, long double __y
) {return nexttowardl(__x
, __y
);}
1073 #define nexttoward(__x, __y) __tg_nexttoward(__tg_promote1((__x))(__x), (__y))
1079 __tg_remainder(float __x
, float __y
) {return remainderf(__x
, __y
);}
1083 __tg_remainder(double __x
, double __y
) {return remainder(__x
, __y
);}
1087 __tg_remainder(long double __x
, long double __y
) {return remainderl(__x
, __y
);}
1090 #define remainder(__x, __y) __tg_remainder(__tg_promote2((__x), (__y))(__x), \
1091 __tg_promote2((__x), (__y))(__y))
1097 __tg_remquo(float __x
, float __y
, int* __z
)
1098 {return remquof(__x
, __y
, __z
);}
1102 __tg_remquo(double __x
, double __y
, int* __z
)
1103 {return remquo(__x
, __y
, __z
);}
1107 __tg_remquo(long double __x
,long double __y
, int* __z
)
1108 {return remquol(__x
, __y
, __z
);}
1111 #define remquo(__x, __y, __z) \
1112 __tg_remquo(__tg_promote2((__x), (__y))(__x), \
1113 __tg_promote2((__x), (__y))(__y), \
1120 __tg_rint(float __x
) {return rintf(__x
);}
1124 __tg_rint(double __x
) {return rint(__x
);}
1128 __tg_rint(long double __x
) {return rintl(__x
);}
1131 #define rint(__x) __tg_rint(__tg_promote1((__x))(__x))
1137 __tg_round(float __x
) {return roundf(__x
);}
1141 __tg_round(double __x
) {return round(__x
);}
1145 __tg_round(long double __x
) {return roundl(__x
);}
1148 #define round(__x) __tg_round(__tg_promote1((__x))(__x))
1154 __tg_scalbn(float __x
, int __y
) {return scalbnf(__x
, __y
);}
1158 __tg_scalbn(double __x
, int __y
) {return scalbn(__x
, __y
);}
1162 __tg_scalbn(long double __x
, int __y
) {return scalbnl(__x
, __y
);}
1165 #define scalbn(__x, __y) __tg_scalbn(__tg_promote1((__x))(__x), __y)
1171 __tg_scalbln(float __x
, long __y
) {return scalblnf(__x
, __y
);}
1175 __tg_scalbln(double __x
, long __y
) {return scalbln(__x
, __y
);}
1179 __tg_scalbln(long double __x
, long __y
) {return scalblnl(__x
, __y
);}
1182 #define scalbln(__x, __y) __tg_scalbln(__tg_promote1((__x))(__x), __y)
1188 __tg_tgamma(float __x
) {return tgammaf(__x
);}
1192 __tg_tgamma(double __x
) {return tgamma(__x
);}
1196 __tg_tgamma(long double __x
) {return tgammal(__x
);}
1199 #define tgamma(__x) __tg_tgamma(__tg_promote1((__x))(__x))
1205 __tg_trunc(float __x
) {return truncf(__x
);}
1209 __tg_trunc(double __x
) {return trunc(__x
);}
1213 __tg_trunc(long double __x
) {return truncl(__x
);}
1216 #define trunc(__x) __tg_trunc(__tg_promote1((__x))(__x))
1222 __tg_carg(float __x
) {return atan2f(0.F
, __x
);}
1226 __tg_carg(double __x
) {return atan2(0., __x
);}
1230 __tg_carg(long double __x
) {return atan2l(0.L
, __x
);}
1234 __tg_carg(float _Complex __x
) {return cargf(__x
);}
1238 __tg_carg(double _Complex __x
) {return carg(__x
);}
1242 __tg_carg(long double _Complex __x
) {return cargl(__x
);}
1245 #define carg(__x) __tg_carg(__tg_promote1((__x))(__x))
1251 __tg_cimag(float __x
) {return 0;}
1255 __tg_cimag(double __x
) {return 0;}
1259 __tg_cimag(long double __x
) {return 0;}
1263 __tg_cimag(float _Complex __x
) {return cimagf(__x
);}
1267 __tg_cimag(double _Complex __x
) {return cimag(__x
);}
1271 __tg_cimag(long double _Complex __x
) {return cimagl(__x
);}
1274 #define cimag(__x) __tg_cimag(__tg_promote1((__x))(__x))
1278 static float _Complex
1280 __tg_conj(float __x
) {return __x
;}
1282 static double _Complex
1284 __tg_conj(double __x
) {return __x
;}
1286 static long double _Complex
1288 __tg_conj(long double __x
) {return __x
;}
1290 static float _Complex
1292 __tg_conj(float _Complex __x
) {return conjf(__x
);}
1294 static double _Complex
1296 __tg_conj(double _Complex __x
) {return conj(__x
);}
1298 static long double _Complex
1300 __tg_conj(long double _Complex __x
) {return conjl(__x
);}
1303 #define conj(__x) __tg_conj(__tg_promote1((__x))(__x))
1307 static float _Complex
1309 __tg_cproj(float __x
) {return cprojf(__x
);}
1311 static double _Complex
1313 __tg_cproj(double __x
) {return cproj(__x
);}
1315 static long double _Complex
1317 __tg_cproj(long double __x
) {return cprojl(__x
);}
1319 static float _Complex
1321 __tg_cproj(float _Complex __x
) {return cprojf(__x
);}
1323 static double _Complex
1325 __tg_cproj(double _Complex __x
) {return cproj(__x
);}
1327 static long double _Complex
1329 __tg_cproj(long double _Complex __x
) {return cprojl(__x
);}
1332 #define cproj(__x) __tg_cproj(__tg_promote1((__x))(__x))
1338 __tg_creal(float __x
) {return __x
;}
1342 __tg_creal(double __x
) {return __x
;}
1346 __tg_creal(long double __x
) {return __x
;}
1350 __tg_creal(float _Complex __x
) {return crealf(__x
);}
1354 __tg_creal(double _Complex __x
) {return creal(__x
);}
1358 __tg_creal(long double _Complex __x
) {return creall(__x
);}
1361 #define creal(__x) __tg_creal(__tg_promote1((__x))(__x))
1366 #endif /* __cplusplus */
1367 #endif /* __has_include_next */
1368 #endif /* __CLANG_TGMATH_H */