1 /*
2  * Copyright (c) 2009 Apple Inc. All rights reserved.
3  *
4  * @APPLE_LICENSE_HEADER_START@
5  *
6  * The contents of this file constitute Original Code as defined in and
7  * are subject to the Apple Public Source License Version 1.1 (the
8  * "License").  You may not use this file except in compliance with the
9  * License.  Please obtain a copy of the License at
10  * http://www.apple.com/publicsource and read it before using this file.
11  *
12  * This Original Code and all software distributed under the License are
13  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
17  * License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * @APPLE_LICENSE_HEADER_END@
21  */
22 
23 #ifndef __TGMATH_H
24 #define __TGMATH_H
25 
26 /* C99 7.22 Type-generic math <tgmath.h>. */
27 #include <math.h>
28 
29 /* C++ handles type genericity with overloading in math.h. */
30 #ifndef __cplusplus
31 #include <complex.h>
32 
33 #define _TG_ATTRSp __attribute__((__overloadable__))
34 #define _TG_ATTRS __attribute__((__overloadable__, __always_inline__))
35 
36 // promotion
37 
38 typedef void _Argument_type_is_not_arithmetic;
39 static _Argument_type_is_not_arithmetic __tg_promote(...)
40   __attribute__((__unavailable__,__overloadable__));
41 static double               _TG_ATTRSp __tg_promote(int);
42 static double               _TG_ATTRSp __tg_promote(unsigned int);
43 static double               _TG_ATTRSp __tg_promote(long);
44 static double               _TG_ATTRSp __tg_promote(unsigned long);
45 static double               _TG_ATTRSp __tg_promote(long long);
46 static double               _TG_ATTRSp __tg_promote(unsigned long long);
47 static float                _TG_ATTRSp __tg_promote(float);
48 static double               _TG_ATTRSp __tg_promote(double);
49 static long double          _TG_ATTRSp __tg_promote(long double);
50 static float _Complex       _TG_ATTRSp __tg_promote(float _Complex);
51 static double _Complex      _TG_ATTRSp __tg_promote(double _Complex);
52 static long double _Complex _TG_ATTRSp __tg_promote(long double _Complex);
53 
54 #define __tg_promote1(__x)           (__typeof__(__tg_promote(__x)))
55 #define __tg_promote2(__x, __y)      (__typeof__(__tg_promote(__x) + \
56                                                  __tg_promote(__y)))
57 #define __tg_promote3(__x, __y, __z) (__typeof__(__tg_promote(__x) + \
58                                                  __tg_promote(__y) + \
59                                                  __tg_promote(__z)))
60 
61 // acos
62 
63 static float
64     _TG_ATTRS
__tg_acos(float __x)65     __tg_acos(float __x) {return acosf(__x);}
66 
67 static double
68     _TG_ATTRS
__tg_acos(double __x)69     __tg_acos(double __x) {return acos(__x);}
70 
71 static long double
72     _TG_ATTRS
__tg_acos(long double __x)73     __tg_acos(long double __x) {return acosl(__x);}
74 
75 static float _Complex
76     _TG_ATTRS
__tg_acos(float _Complex __x)77     __tg_acos(float _Complex __x) {return cacosf(__x);}
78 
79 static double _Complex
80     _TG_ATTRS
__tg_acos(double _Complex __x)81     __tg_acos(double _Complex __x) {return cacos(__x);}
82 
83 static long double _Complex
84     _TG_ATTRS
__tg_acos(long double _Complex __x)85     __tg_acos(long double _Complex __x) {return cacosl(__x);}
86 
87 #undef acos
88 #define acos(__x) __tg_acos(__tg_promote1((__x))(__x))
89 
90 // asin
91 
92 static float
93     _TG_ATTRS
__tg_asin(float __x)94     __tg_asin(float __x) {return asinf(__x);}
95 
96 static double
97     _TG_ATTRS
__tg_asin(double __x)98     __tg_asin(double __x) {return asin(__x);}
99 
100 static long double
101     _TG_ATTRS
__tg_asin(long double __x)102     __tg_asin(long double __x) {return asinl(__x);}
103 
104 static float _Complex
105     _TG_ATTRS
__tg_asin(float _Complex __x)106     __tg_asin(float _Complex __x) {return casinf(__x);}
107 
108 static double _Complex
109     _TG_ATTRS
__tg_asin(double _Complex __x)110     __tg_asin(double _Complex __x) {return casin(__x);}
111 
112 static long double _Complex
113     _TG_ATTRS
__tg_asin(long double _Complex __x)114     __tg_asin(long double _Complex __x) {return casinl(__x);}
115 
116 #undef asin
117 #define asin(__x) __tg_asin(__tg_promote1((__x))(__x))
118 
119 // atan
120 
121 static float
122     _TG_ATTRS
__tg_atan(float __x)123     __tg_atan(float __x) {return atanf(__x);}
124 
125 static double
126     _TG_ATTRS
__tg_atan(double __x)127     __tg_atan(double __x) {return atan(__x);}
128 
129 static long double
130     _TG_ATTRS
__tg_atan(long double __x)131     __tg_atan(long double __x) {return atanl(__x);}
132 
133 static float _Complex
134     _TG_ATTRS
__tg_atan(float _Complex __x)135     __tg_atan(float _Complex __x) {return catanf(__x);}
136 
137 static double _Complex
138     _TG_ATTRS
__tg_atan(double _Complex __x)139     __tg_atan(double _Complex __x) {return catan(__x);}
140 
141 static long double _Complex
142     _TG_ATTRS
__tg_atan(long double _Complex __x)143     __tg_atan(long double _Complex __x) {return catanl(__x);}
144 
145 #undef atan
146 #define atan(__x) __tg_atan(__tg_promote1((__x))(__x))
147 
148 // acosh
149 
150 static float
151     _TG_ATTRS
__tg_acosh(float __x)152     __tg_acosh(float __x) {return acoshf(__x);}
153 
154 static double
155     _TG_ATTRS
__tg_acosh(double __x)156     __tg_acosh(double __x) {return acosh(__x);}
157 
158 static long double
159     _TG_ATTRS
__tg_acosh(long double __x)160     __tg_acosh(long double __x) {return acoshl(__x);}
161 
162 static float _Complex
163     _TG_ATTRS
__tg_acosh(float _Complex __x)164     __tg_acosh(float _Complex __x) {return cacoshf(__x);}
165 
166 static double _Complex
167     _TG_ATTRS
__tg_acosh(double _Complex __x)168     __tg_acosh(double _Complex __x) {return cacosh(__x);}
169 
170 static long double _Complex
171     _TG_ATTRS
__tg_acosh(long double _Complex __x)172     __tg_acosh(long double _Complex __x) {return cacoshl(__x);}
173 
174 #undef acosh
175 #define acosh(__x) __tg_acosh(__tg_promote1((__x))(__x))
176 
177 // asinh
178 
179 static float
180     _TG_ATTRS
__tg_asinh(float __x)181     __tg_asinh(float __x) {return asinhf(__x);}
182 
183 static double
184     _TG_ATTRS
__tg_asinh(double __x)185     __tg_asinh(double __x) {return asinh(__x);}
186 
187 static long double
188     _TG_ATTRS
__tg_asinh(long double __x)189     __tg_asinh(long double __x) {return asinhl(__x);}
190 
191 static float _Complex
192     _TG_ATTRS
__tg_asinh(float _Complex __x)193     __tg_asinh(float _Complex __x) {return casinhf(__x);}
194 
195 static double _Complex
196     _TG_ATTRS
__tg_asinh(double _Complex __x)197     __tg_asinh(double _Complex __x) {return casinh(__x);}
198 
199 static long double _Complex
200     _TG_ATTRS
__tg_asinh(long double _Complex __x)201     __tg_asinh(long double _Complex __x) {return casinhl(__x);}
202 
203 #undef asinh
204 #define asinh(__x) __tg_asinh(__tg_promote1((__x))(__x))
205 
206 // atanh
207 
208 static float
209     _TG_ATTRS
__tg_atanh(float __x)210     __tg_atanh(float __x) {return atanhf(__x);}
211 
212 static double
213     _TG_ATTRS
__tg_atanh(double __x)214     __tg_atanh(double __x) {return atanh(__x);}
215 
216 static long double
217     _TG_ATTRS
__tg_atanh(long double __x)218     __tg_atanh(long double __x) {return atanhl(__x);}
219 
220 static float _Complex
221     _TG_ATTRS
__tg_atanh(float _Complex __x)222     __tg_atanh(float _Complex __x) {return catanhf(__x);}
223 
224 static double _Complex
225     _TG_ATTRS
__tg_atanh(double _Complex __x)226     __tg_atanh(double _Complex __x) {return catanh(__x);}
227 
228 static long double _Complex
229     _TG_ATTRS
__tg_atanh(long double _Complex __x)230     __tg_atanh(long double _Complex __x) {return catanhl(__x);}
231 
232 #undef atanh
233 #define atanh(__x) __tg_atanh(__tg_promote1((__x))(__x))
234 
235 // cos
236 
237 static float
238     _TG_ATTRS
__tg_cos(float __x)239     __tg_cos(float __x) {return cosf(__x);}
240 
241 static double
242     _TG_ATTRS
__tg_cos(double __x)243     __tg_cos(double __x) {return cos(__x);}
244 
245 static long double
246     _TG_ATTRS
__tg_cos(long double __x)247     __tg_cos(long double __x) {return cosl(__x);}
248 
249 static float _Complex
250     _TG_ATTRS
__tg_cos(float _Complex __x)251     __tg_cos(float _Complex __x) {return ccosf(__x);}
252 
253 static double _Complex
254     _TG_ATTRS
__tg_cos(double _Complex __x)255     __tg_cos(double _Complex __x) {return ccos(__x);}
256 
257 static long double _Complex
258     _TG_ATTRS
__tg_cos(long double _Complex __x)259     __tg_cos(long double _Complex __x) {return ccosl(__x);}
260 
261 #undef cos
262 #define cos(__x) __tg_cos(__tg_promote1((__x))(__x))
263 
264 // sin
265 
266 static float
267     _TG_ATTRS
__tg_sin(float __x)268     __tg_sin(float __x) {return sinf(__x);}
269 
270 static double
271     _TG_ATTRS
__tg_sin(double __x)272     __tg_sin(double __x) {return sin(__x);}
273 
274 static long double
275     _TG_ATTRS
__tg_sin(long double __x)276     __tg_sin(long double __x) {return sinl(__x);}
277 
278 static float _Complex
279     _TG_ATTRS
__tg_sin(float _Complex __x)280     __tg_sin(float _Complex __x) {return csinf(__x);}
281 
282 static double _Complex
283     _TG_ATTRS
__tg_sin(double _Complex __x)284     __tg_sin(double _Complex __x) {return csin(__x);}
285 
286 static long double _Complex
287     _TG_ATTRS
__tg_sin(long double _Complex __x)288     __tg_sin(long double _Complex __x) {return csinl(__x);}
289 
290 #undef sin
291 #define sin(__x) __tg_sin(__tg_promote1((__x))(__x))
292 
293 // tan
294 
295 static float
296     _TG_ATTRS
__tg_tan(float __x)297     __tg_tan(float __x) {return tanf(__x);}
298 
299 static double
300     _TG_ATTRS
__tg_tan(double __x)301     __tg_tan(double __x) {return tan(__x);}
302 
303 static long double
304     _TG_ATTRS
__tg_tan(long double __x)305     __tg_tan(long double __x) {return tanl(__x);}
306 
307 static float _Complex
308     _TG_ATTRS
__tg_tan(float _Complex __x)309     __tg_tan(float _Complex __x) {return ctanf(__x);}
310 
311 static double _Complex
312     _TG_ATTRS
__tg_tan(double _Complex __x)313     __tg_tan(double _Complex __x) {return ctan(__x);}
314 
315 static long double _Complex
316     _TG_ATTRS
__tg_tan(long double _Complex __x)317     __tg_tan(long double _Complex __x) {return ctanl(__x);}
318 
319 #undef tan
320 #define tan(__x) __tg_tan(__tg_promote1((__x))(__x))
321 
322 // cosh
323 
324 static float
325     _TG_ATTRS
__tg_cosh(float __x)326     __tg_cosh(float __x) {return coshf(__x);}
327 
328 static double
329     _TG_ATTRS
__tg_cosh(double __x)330     __tg_cosh(double __x) {return cosh(__x);}
331 
332 static long double
333     _TG_ATTRS
__tg_cosh(long double __x)334     __tg_cosh(long double __x) {return coshl(__x);}
335 
336 static float _Complex
337     _TG_ATTRS
__tg_cosh(float _Complex __x)338     __tg_cosh(float _Complex __x) {return ccoshf(__x);}
339 
340 static double _Complex
341     _TG_ATTRS
__tg_cosh(double _Complex __x)342     __tg_cosh(double _Complex __x) {return ccosh(__x);}
343 
344 static long double _Complex
345     _TG_ATTRS
__tg_cosh(long double _Complex __x)346     __tg_cosh(long double _Complex __x) {return ccoshl(__x);}
347 
348 #undef cosh
349 #define cosh(__x) __tg_cosh(__tg_promote1((__x))(__x))
350 
351 // sinh
352 
353 static float
354     _TG_ATTRS
__tg_sinh(float __x)355     __tg_sinh(float __x) {return sinhf(__x);}
356 
357 static double
358     _TG_ATTRS
__tg_sinh(double __x)359     __tg_sinh(double __x) {return sinh(__x);}
360 
361 static long double
362     _TG_ATTRS
__tg_sinh(long double __x)363     __tg_sinh(long double __x) {return sinhl(__x);}
364 
365 static float _Complex
366     _TG_ATTRS
__tg_sinh(float _Complex __x)367     __tg_sinh(float _Complex __x) {return csinhf(__x);}
368 
369 static double _Complex
370     _TG_ATTRS
__tg_sinh(double _Complex __x)371     __tg_sinh(double _Complex __x) {return csinh(__x);}
372 
373 static long double _Complex
374     _TG_ATTRS
__tg_sinh(long double _Complex __x)375     __tg_sinh(long double _Complex __x) {return csinhl(__x);}
376 
377 #undef sinh
378 #define sinh(__x) __tg_sinh(__tg_promote1((__x))(__x))
379 
380 // tanh
381 
382 static float
383     _TG_ATTRS
__tg_tanh(float __x)384     __tg_tanh(float __x) {return tanhf(__x);}
385 
386 static double
387     _TG_ATTRS
__tg_tanh(double __x)388     __tg_tanh(double __x) {return tanh(__x);}
389 
390 static long double
391     _TG_ATTRS
__tg_tanh(long double __x)392     __tg_tanh(long double __x) {return tanhl(__x);}
393 
394 static float _Complex
395     _TG_ATTRS
__tg_tanh(float _Complex __x)396     __tg_tanh(float _Complex __x) {return ctanhf(__x);}
397 
398 static double _Complex
399     _TG_ATTRS
__tg_tanh(double _Complex __x)400     __tg_tanh(double _Complex __x) {return ctanh(__x);}
401 
402 static long double _Complex
403     _TG_ATTRS
__tg_tanh(long double _Complex __x)404     __tg_tanh(long double _Complex __x) {return ctanhl(__x);}
405 
406 #undef tanh
407 #define tanh(__x) __tg_tanh(__tg_promote1((__x))(__x))
408 
409 // exp
410 
411 static float
412     _TG_ATTRS
__tg_exp(float __x)413     __tg_exp(float __x) {return expf(__x);}
414 
415 static double
416     _TG_ATTRS
__tg_exp(double __x)417     __tg_exp(double __x) {return exp(__x);}
418 
419 static long double
420     _TG_ATTRS
__tg_exp(long double __x)421     __tg_exp(long double __x) {return expl(__x);}
422 
423 static float _Complex
424     _TG_ATTRS
__tg_exp(float _Complex __x)425     __tg_exp(float _Complex __x) {return cexpf(__x);}
426 
427 static double _Complex
428     _TG_ATTRS
__tg_exp(double _Complex __x)429     __tg_exp(double _Complex __x) {return cexp(__x);}
430 
431 static long double _Complex
432     _TG_ATTRS
__tg_exp(long double _Complex __x)433     __tg_exp(long double _Complex __x) {return cexpl(__x);}
434 
435 #undef exp
436 #define exp(__x) __tg_exp(__tg_promote1((__x))(__x))
437 
438 // log
439 
440 static float
441     _TG_ATTRS
__tg_log(float __x)442     __tg_log(float __x) {return logf(__x);}
443 
444 static double
445     _TG_ATTRS
__tg_log(double __x)446     __tg_log(double __x) {return log(__x);}
447 
448 static long double
449     _TG_ATTRS
__tg_log(long double __x)450     __tg_log(long double __x) {return logl(__x);}
451 
452 static float _Complex
453     _TG_ATTRS
__tg_log(float _Complex __x)454     __tg_log(float _Complex __x) {return clogf(__x);}
455 
456 static double _Complex
457     _TG_ATTRS
__tg_log(double _Complex __x)458     __tg_log(double _Complex __x) {return clog(__x);}
459 
460 static long double _Complex
461     _TG_ATTRS
__tg_log(long double _Complex __x)462     __tg_log(long double _Complex __x) {return clogl(__x);}
463 
464 #undef log
465 #define log(__x) __tg_log(__tg_promote1((__x))(__x))
466 
467 // pow
468 
469 static float
470     _TG_ATTRS
__tg_pow(float __x,float __y)471     __tg_pow(float __x, float __y) {return powf(__x, __y);}
472 
473 static double
474     _TG_ATTRS
__tg_pow(double __x,double __y)475     __tg_pow(double __x, double __y) {return pow(__x, __y);}
476 
477 static long double
478     _TG_ATTRS
__tg_pow(long double __x,long double __y)479     __tg_pow(long double __x, long double __y) {return powl(__x, __y);}
480 
481 static float _Complex
482     _TG_ATTRS
__tg_pow(float _Complex __x,float _Complex __y)483     __tg_pow(float _Complex __x, float _Complex __y) {return cpowf(__x, __y);}
484 
485 static double _Complex
486     _TG_ATTRS
__tg_pow(double _Complex __x,double _Complex __y)487     __tg_pow(double _Complex __x, double _Complex __y) {return cpow(__x, __y);}
488 
489 static long double _Complex
490     _TG_ATTRS
__tg_pow(long double _Complex __x,long double _Complex __y)491     __tg_pow(long double _Complex __x, long double _Complex __y)
492     {return cpowl(__x, __y);}
493 
494 #undef pow
495 #define pow(__x, __y) __tg_pow(__tg_promote2((__x), (__y))(__x), \
496                                __tg_promote2((__x), (__y))(__y))
497 
498 // sqrt
499 
500 static float
501     _TG_ATTRS
__tg_sqrt(float __x)502     __tg_sqrt(float __x) {return sqrtf(__x);}
503 
504 static double
505     _TG_ATTRS
__tg_sqrt(double __x)506     __tg_sqrt(double __x) {return sqrt(__x);}
507 
508 static long double
509     _TG_ATTRS
__tg_sqrt(long double __x)510     __tg_sqrt(long double __x) {return sqrtl(__x);}
511 
512 static float _Complex
513     _TG_ATTRS
__tg_sqrt(float _Complex __x)514     __tg_sqrt(float _Complex __x) {return csqrtf(__x);}
515 
516 static double _Complex
517     _TG_ATTRS
__tg_sqrt(double _Complex __x)518     __tg_sqrt(double _Complex __x) {return csqrt(__x);}
519 
520 static long double _Complex
521     _TG_ATTRS
__tg_sqrt(long double _Complex __x)522     __tg_sqrt(long double _Complex __x) {return csqrtl(__x);}
523 
524 #undef sqrt
525 #define sqrt(__x) __tg_sqrt(__tg_promote1((__x))(__x))
526 
527 // fabs
528 
529 static float
530     _TG_ATTRS
__tg_fabs(float __x)531     __tg_fabs(float __x) {return fabsf(__x);}
532 
533 static double
534     _TG_ATTRS
__tg_fabs(double __x)535     __tg_fabs(double __x) {return fabs(__x);}
536 
537 static long double
538     _TG_ATTRS
__tg_fabs(long double __x)539     __tg_fabs(long double __x) {return fabsl(__x);}
540 
541 static float
542     _TG_ATTRS
__tg_fabs(float _Complex __x)543     __tg_fabs(float _Complex __x) {return cabsf(__x);}
544 
545 static double
546     _TG_ATTRS
__tg_fabs(double _Complex __x)547     __tg_fabs(double _Complex __x) {return cabs(__x);}
548 
549 static long double
550     _TG_ATTRS
__tg_fabs(long double _Complex __x)551     __tg_fabs(long double _Complex __x) {return cabsl(__x);}
552 
553 #undef fabs
554 #define fabs(__x) __tg_fabs(__tg_promote1((__x))(__x))
555 
556 // atan2
557 
558 static float
559     _TG_ATTRS
__tg_atan2(float __x,float __y)560     __tg_atan2(float __x, float __y) {return atan2f(__x, __y);}
561 
562 static double
563     _TG_ATTRS
__tg_atan2(double __x,double __y)564     __tg_atan2(double __x, double __y) {return atan2(__x, __y);}
565 
566 static long double
567     _TG_ATTRS
__tg_atan2(long double __x,long double __y)568     __tg_atan2(long double __x, long double __y) {return atan2l(__x, __y);}
569 
570 #undef atan2
571 #define atan2(__x, __y) __tg_atan2(__tg_promote2((__x), (__y))(__x), \
572                                    __tg_promote2((__x), (__y))(__y))
573 
574 // cbrt
575 
576 static float
577     _TG_ATTRS
__tg_cbrt(float __x)578     __tg_cbrt(float __x) {return cbrtf(__x);}
579 
580 static double
581     _TG_ATTRS
__tg_cbrt(double __x)582     __tg_cbrt(double __x) {return cbrt(__x);}
583 
584 static long double
585     _TG_ATTRS
__tg_cbrt(long double __x)586     __tg_cbrt(long double __x) {return cbrtl(__x);}
587 
588 #undef cbrt
589 #define cbrt(__x) __tg_cbrt(__tg_promote1((__x))(__x))
590 
591 // ceil
592 
593 static float
594     _TG_ATTRS
__tg_ceil(float __x)595     __tg_ceil(float __x) {return ceilf(__x);}
596 
597 static double
598     _TG_ATTRS
__tg_ceil(double __x)599     __tg_ceil(double __x) {return ceil(__x);}
600 
601 static long double
602     _TG_ATTRS
__tg_ceil(long double __x)603     __tg_ceil(long double __x) {return ceill(__x);}
604 
605 #undef ceil
606 #define ceil(__x) __tg_ceil(__tg_promote1((__x))(__x))
607 
608 // copysign
609 
610 static float
611     _TG_ATTRS
__tg_copysign(float __x,float __y)612     __tg_copysign(float __x, float __y) {return copysignf(__x, __y);}
613 
614 static double
615     _TG_ATTRS
__tg_copysign(double __x,double __y)616     __tg_copysign(double __x, double __y) {return copysign(__x, __y);}
617 
618 static long double
619     _TG_ATTRS
__tg_copysign(long double __x,long double __y)620     __tg_copysign(long double __x, long double __y) {return copysignl(__x, __y);}
621 
622 #undef copysign
623 #define copysign(__x, __y) __tg_copysign(__tg_promote2((__x), (__y))(__x), \
624                                          __tg_promote2((__x), (__y))(__y))
625 
626 // erf
627 
628 static float
629     _TG_ATTRS
__tg_erf(float __x)630     __tg_erf(float __x) {return erff(__x);}
631 
632 static double
633     _TG_ATTRS
__tg_erf(double __x)634     __tg_erf(double __x) {return erf(__x);}
635 
636 static long double
637     _TG_ATTRS
__tg_erf(long double __x)638     __tg_erf(long double __x) {return erfl(__x);}
639 
640 #undef erf
641 #define erf(__x) __tg_erf(__tg_promote1((__x))(__x))
642 
643 // erfc
644 
645 static float
646     _TG_ATTRS
__tg_erfc(float __x)647     __tg_erfc(float __x) {return erfcf(__x);}
648 
649 static double
650     _TG_ATTRS
__tg_erfc(double __x)651     __tg_erfc(double __x) {return erfc(__x);}
652 
653 static long double
654     _TG_ATTRS
__tg_erfc(long double __x)655     __tg_erfc(long double __x) {return erfcl(__x);}
656 
657 #undef erfc
658 #define erfc(__x) __tg_erfc(__tg_promote1((__x))(__x))
659 
660 // exp2
661 
662 static float
663     _TG_ATTRS
__tg_exp2(float __x)664     __tg_exp2(float __x) {return exp2f(__x);}
665 
666 static double
667     _TG_ATTRS
__tg_exp2(double __x)668     __tg_exp2(double __x) {return exp2(__x);}
669 
670 static long double
671     _TG_ATTRS
__tg_exp2(long double __x)672     __tg_exp2(long double __x) {return exp2l(__x);}
673 
674 #undef exp2
675 #define exp2(__x) __tg_exp2(__tg_promote1((__x))(__x))
676 
677 // expm1
678 
679 static float
680     _TG_ATTRS
__tg_expm1(float __x)681     __tg_expm1(float __x) {return expm1f(__x);}
682 
683 static double
684     _TG_ATTRS
__tg_expm1(double __x)685     __tg_expm1(double __x) {return expm1(__x);}
686 
687 static long double
688     _TG_ATTRS
__tg_expm1(long double __x)689     __tg_expm1(long double __x) {return expm1l(__x);}
690 
691 #undef expm1
692 #define expm1(__x) __tg_expm1(__tg_promote1((__x))(__x))
693 
694 // fdim
695 
696 static float
697     _TG_ATTRS
__tg_fdim(float __x,float __y)698     __tg_fdim(float __x, float __y) {return fdimf(__x, __y);}
699 
700 static double
701     _TG_ATTRS
__tg_fdim(double __x,double __y)702     __tg_fdim(double __x, double __y) {return fdim(__x, __y);}
703 
704 static long double
705     _TG_ATTRS
__tg_fdim(long double __x,long double __y)706     __tg_fdim(long double __x, long double __y) {return fdiml(__x, __y);}
707 
708 #undef fdim
709 #define fdim(__x, __y) __tg_fdim(__tg_promote2((__x), (__y))(__x), \
710                                  __tg_promote2((__x), (__y))(__y))
711 
712 // floor
713 
714 static float
715     _TG_ATTRS
__tg_floor(float __x)716     __tg_floor(float __x) {return floorf(__x);}
717 
718 static double
719     _TG_ATTRS
__tg_floor(double __x)720     __tg_floor(double __x) {return floor(__x);}
721 
722 static long double
723     _TG_ATTRS
__tg_floor(long double __x)724     __tg_floor(long double __x) {return floorl(__x);}
725 
726 #undef floor
727 #define floor(__x) __tg_floor(__tg_promote1((__x))(__x))
728 
729 // fma
730 
731 static float
732     _TG_ATTRS
__tg_fma(float __x,float __y,float __z)733     __tg_fma(float __x, float __y, float __z)
734     {return fmaf(__x, __y, __z);}
735 
736 static double
737     _TG_ATTRS
__tg_fma(double __x,double __y,double __z)738     __tg_fma(double __x, double __y, double __z)
739     {return fma(__x, __y, __z);}
740 
741 static long double
742     _TG_ATTRS
__tg_fma(long double __x,long double __y,long double __z)743     __tg_fma(long double __x,long double __y, long double __z)
744     {return fmal(__x, __y, __z);}
745 
746 #undef fma
747 #define fma(__x, __y, __z)                                \
748         __tg_fma(__tg_promote3((__x), (__y), (__z))(__x), \
749                  __tg_promote3((__x), (__y), (__z))(__y), \
750                  __tg_promote3((__x), (__y), (__z))(__z))
751 
752 // fmax
753 
754 static float
755     _TG_ATTRS
__tg_fmax(float __x,float __y)756     __tg_fmax(float __x, float __y) {return fmaxf(__x, __y);}
757 
758 static double
759     _TG_ATTRS
__tg_fmax(double __x,double __y)760     __tg_fmax(double __x, double __y) {return fmax(__x, __y);}
761 
762 static long double
763     _TG_ATTRS
__tg_fmax(long double __x,long double __y)764     __tg_fmax(long double __x, long double __y) {return fmaxl(__x, __y);}
765 
766 #undef fmax
767 #define fmax(__x, __y) __tg_fmax(__tg_promote2((__x), (__y))(__x), \
768                                  __tg_promote2((__x), (__y))(__y))
769 
770 // fmin
771 
772 static float
773     _TG_ATTRS
__tg_fmin(float __x,float __y)774     __tg_fmin(float __x, float __y) {return fminf(__x, __y);}
775 
776 static double
777     _TG_ATTRS
__tg_fmin(double __x,double __y)778     __tg_fmin(double __x, double __y) {return fmin(__x, __y);}
779 
780 static long double
781     _TG_ATTRS
__tg_fmin(long double __x,long double __y)782     __tg_fmin(long double __x, long double __y) {return fminl(__x, __y);}
783 
784 #undef fmin
785 #define fmin(__x, __y) __tg_fmin(__tg_promote2((__x), (__y))(__x), \
786                                  __tg_promote2((__x), (__y))(__y))
787 
788 // fmod
789 
790 static float
791     _TG_ATTRS
__tg_fmod(float __x,float __y)792     __tg_fmod(float __x, float __y) {return fmodf(__x, __y);}
793 
794 static double
795     _TG_ATTRS
__tg_fmod(double __x,double __y)796     __tg_fmod(double __x, double __y) {return fmod(__x, __y);}
797 
798 static long double
799     _TG_ATTRS
__tg_fmod(long double __x,long double __y)800     __tg_fmod(long double __x, long double __y) {return fmodl(__x, __y);}
801 
802 #undef fmod
803 #define fmod(__x, __y) __tg_fmod(__tg_promote2((__x), (__y))(__x), \
804                                  __tg_promote2((__x), (__y))(__y))
805 
806 // frexp
807 
808 static float
809     _TG_ATTRS
__tg_frexp(float __x,int * __y)810     __tg_frexp(float __x, int* __y) {return frexpf(__x, __y);}
811 
812 static double
813     _TG_ATTRS
__tg_frexp(double __x,int * __y)814     __tg_frexp(double __x, int* __y) {return frexp(__x, __y);}
815 
816 static long double
817     _TG_ATTRS
__tg_frexp(long double __x,int * __y)818     __tg_frexp(long double __x, int* __y) {return frexpl(__x, __y);}
819 
820 #undef frexp
821 #define frexp(__x, __y) __tg_frexp(__tg_promote1((__x))(__x), __y)
822 
823 // hypot
824 
825 static float
826     _TG_ATTRS
__tg_hypot(float __x,float __y)827     __tg_hypot(float __x, float __y) {return hypotf(__x, __y);}
828 
829 static double
830     _TG_ATTRS
__tg_hypot(double __x,double __y)831     __tg_hypot(double __x, double __y) {return hypot(__x, __y);}
832 
833 static long double
834     _TG_ATTRS
__tg_hypot(long double __x,long double __y)835     __tg_hypot(long double __x, long double __y) {return hypotl(__x, __y);}
836 
837 #undef hypot
838 #define hypot(__x, __y) __tg_hypot(__tg_promote2((__x), (__y))(__x), \
839                                    __tg_promote2((__x), (__y))(__y))
840 
841 // ilogb
842 
843 static int
844     _TG_ATTRS
__tg_ilogb(float __x)845     __tg_ilogb(float __x) {return ilogbf(__x);}
846 
847 static int
848     _TG_ATTRS
__tg_ilogb(double __x)849     __tg_ilogb(double __x) {return ilogb(__x);}
850 
851 static int
852     _TG_ATTRS
__tg_ilogb(long double __x)853     __tg_ilogb(long double __x) {return ilogbl(__x);}
854 
855 #undef ilogb
856 #define ilogb(__x) __tg_ilogb(__tg_promote1((__x))(__x))
857 
858 // ldexp
859 
860 static float
861     _TG_ATTRS
__tg_ldexp(float __x,int __y)862     __tg_ldexp(float __x, int __y) {return ldexpf(__x, __y);}
863 
864 static double
865     _TG_ATTRS
__tg_ldexp(double __x,int __y)866     __tg_ldexp(double __x, int __y) {return ldexp(__x, __y);}
867 
868 static long double
869     _TG_ATTRS
__tg_ldexp(long double __x,int __y)870     __tg_ldexp(long double __x, int __y) {return ldexpl(__x, __y);}
871 
872 #undef ldexp
873 #define ldexp(__x, __y) __tg_ldexp(__tg_promote1((__x))(__x), __y)
874 
875 // lgamma
876 
877 static float
878     _TG_ATTRS
__tg_lgamma(float __x)879     __tg_lgamma(float __x) {return lgammaf(__x);}
880 
881 static double
882     _TG_ATTRS
__tg_lgamma(double __x)883     __tg_lgamma(double __x) {return lgamma(__x);}
884 
885 static long double
886     _TG_ATTRS
__tg_lgamma(long double __x)887     __tg_lgamma(long double __x) {return lgammal(__x);}
888 
889 #undef lgamma
890 #define lgamma(__x) __tg_lgamma(__tg_promote1((__x))(__x))
891 
892 // llrint
893 
894 static long long
895     _TG_ATTRS
__tg_llrint(float __x)896     __tg_llrint(float __x) {return llrintf(__x);}
897 
898 static long long
899     _TG_ATTRS
__tg_llrint(double __x)900     __tg_llrint(double __x) {return llrint(__x);}
901 
902 static long long
903     _TG_ATTRS
__tg_llrint(long double __x)904     __tg_llrint(long double __x) {return llrintl(__x);}
905 
906 #undef llrint
907 #define llrint(__x) __tg_llrint(__tg_promote1((__x))(__x))
908 
909 // llround
910 
911 static long long
912     _TG_ATTRS
__tg_llround(float __x)913     __tg_llround(float __x) {return llroundf(__x);}
914 
915 static long long
916     _TG_ATTRS
__tg_llround(double __x)917     __tg_llround(double __x) {return llround(__x);}
918 
919 static long long
920     _TG_ATTRS
__tg_llround(long double __x)921     __tg_llround(long double __x) {return llroundl(__x);}
922 
923 #undef llround
924 #define llround(__x) __tg_llround(__tg_promote1((__x))(__x))
925 
926 // log10
927 
928 static float
929     _TG_ATTRS
__tg_log10(float __x)930     __tg_log10(float __x) {return log10f(__x);}
931 
932 static double
933     _TG_ATTRS
__tg_log10(double __x)934     __tg_log10(double __x) {return log10(__x);}
935 
936 static long double
937     _TG_ATTRS
__tg_log10(long double __x)938     __tg_log10(long double __x) {return log10l(__x);}
939 
940 #undef log10
941 #define log10(__x) __tg_log10(__tg_promote1((__x))(__x))
942 
943 // log1p
944 
945 static float
946     _TG_ATTRS
__tg_log1p(float __x)947     __tg_log1p(float __x) {return log1pf(__x);}
948 
949 static double
950     _TG_ATTRS
__tg_log1p(double __x)951     __tg_log1p(double __x) {return log1p(__x);}
952 
953 static long double
954     _TG_ATTRS
__tg_log1p(long double __x)955     __tg_log1p(long double __x) {return log1pl(__x);}
956 
957 #undef log1p
958 #define log1p(__x) __tg_log1p(__tg_promote1((__x))(__x))
959 
960 // log2
961 
962 static float
963     _TG_ATTRS
__tg_log2(float __x)964     __tg_log2(float __x) {return log2f(__x);}
965 
966 static double
967     _TG_ATTRS
__tg_log2(double __x)968     __tg_log2(double __x) {return log2(__x);}
969 
970 static long double
971     _TG_ATTRS
__tg_log2(long double __x)972     __tg_log2(long double __x) {return log2l(__x);}
973 
974 #undef log2
975 #define log2(__x) __tg_log2(__tg_promote1((__x))(__x))
976 
977 // logb
978 
979 static float
980     _TG_ATTRS
__tg_logb(float __x)981     __tg_logb(float __x) {return logbf(__x);}
982 
983 static double
984     _TG_ATTRS
__tg_logb(double __x)985     __tg_logb(double __x) {return logb(__x);}
986 
987 static long double
988     _TG_ATTRS
__tg_logb(long double __x)989     __tg_logb(long double __x) {return logbl(__x);}
990 
991 #undef logb
992 #define logb(__x) __tg_logb(__tg_promote1((__x))(__x))
993 
994 // lrint
995 
996 static long
997     _TG_ATTRS
__tg_lrint(float __x)998     __tg_lrint(float __x) {return lrintf(__x);}
999 
1000 static long
1001     _TG_ATTRS
__tg_lrint(double __x)1002     __tg_lrint(double __x) {return lrint(__x);}
1003 
1004 static long
1005     _TG_ATTRS
__tg_lrint(long double __x)1006     __tg_lrint(long double __x) {return lrintl(__x);}
1007 
1008 #undef lrint
1009 #define lrint(__x) __tg_lrint(__tg_promote1((__x))(__x))
1010 
1011 // lround
1012 
1013 static long
1014     _TG_ATTRS
__tg_lround(float __x)1015     __tg_lround(float __x) {return lroundf(__x);}
1016 
1017 static long
1018     _TG_ATTRS
__tg_lround(double __x)1019     __tg_lround(double __x) {return lround(__x);}
1020 
1021 static long
1022     _TG_ATTRS
__tg_lround(long double __x)1023     __tg_lround(long double __x) {return lroundl(__x);}
1024 
1025 #undef lround
1026 #define lround(__x) __tg_lround(__tg_promote1((__x))(__x))
1027 
1028 // nearbyint
1029 
1030 static float
1031     _TG_ATTRS
__tg_nearbyint(float __x)1032     __tg_nearbyint(float __x) {return nearbyintf(__x);}
1033 
1034 static double
1035     _TG_ATTRS
__tg_nearbyint(double __x)1036     __tg_nearbyint(double __x) {return nearbyint(__x);}
1037 
1038 static long double
1039     _TG_ATTRS
__tg_nearbyint(long double __x)1040     __tg_nearbyint(long double __x) {return nearbyintl(__x);}
1041 
1042 #undef nearbyint
1043 #define nearbyint(__x) __tg_nearbyint(__tg_promote1((__x))(__x))
1044 
1045 // nextafter
1046 
1047 static float
1048     _TG_ATTRS
__tg_nextafter(float __x,float __y)1049     __tg_nextafter(float __x, float __y) {return nextafterf(__x, __y);}
1050 
1051 static double
1052     _TG_ATTRS
__tg_nextafter(double __x,double __y)1053     __tg_nextafter(double __x, double __y) {return nextafter(__x, __y);}
1054 
1055 static long double
1056     _TG_ATTRS
__tg_nextafter(long double __x,long double __y)1057     __tg_nextafter(long double __x, long double __y) {return nextafterl(__x, __y);}
1058 
1059 #undef nextafter
1060 #define nextafter(__x, __y) __tg_nextafter(__tg_promote2((__x), (__y))(__x), \
1061                                            __tg_promote2((__x), (__y))(__y))
1062 
1063 // nexttoward
1064 
1065 static float
1066     _TG_ATTRS
__tg_nexttoward(float __x,long double __y)1067     __tg_nexttoward(float __x, long double __y) {return nexttowardf(__x, __y);}
1068 
1069 static double
1070     _TG_ATTRS
__tg_nexttoward(double __x,long double __y)1071     __tg_nexttoward(double __x, long double __y) {return nexttoward(__x, __y);}
1072 
1073 static long double
1074     _TG_ATTRS
__tg_nexttoward(long double __x,long double __y)1075     __tg_nexttoward(long double __x, long double __y) {return nexttowardl(__x, __y);}
1076 
1077 #undef nexttoward
1078 #define nexttoward(__x, __y) __tg_nexttoward(__tg_promote1((__x))(__x), (__y))
1079 
1080 // remainder
1081 
1082 static float
1083     _TG_ATTRS
__tg_remainder(float __x,float __y)1084     __tg_remainder(float __x, float __y) {return remainderf(__x, __y);}
1085 
1086 static double
1087     _TG_ATTRS
__tg_remainder(double __x,double __y)1088     __tg_remainder(double __x, double __y) {return remainder(__x, __y);}
1089 
1090 static long double
1091     _TG_ATTRS
__tg_remainder(long double __x,long double __y)1092     __tg_remainder(long double __x, long double __y) {return remainderl(__x, __y);}
1093 
1094 #undef remainder
1095 #define remainder(__x, __y) __tg_remainder(__tg_promote2((__x), (__y))(__x), \
1096                                            __tg_promote2((__x), (__y))(__y))
1097 
1098 // remquo
1099 
1100 static float
1101     _TG_ATTRS
__tg_remquo(float __x,float __y,int * __z)1102     __tg_remquo(float __x, float __y, int* __z)
1103     {return remquof(__x, __y, __z);}
1104 
1105 static double
1106     _TG_ATTRS
__tg_remquo(double __x,double __y,int * __z)1107     __tg_remquo(double __x, double __y, int* __z)
1108     {return remquo(__x, __y, __z);}
1109 
1110 static long double
1111     _TG_ATTRS
__tg_remquo(long double __x,long double __y,int * __z)1112     __tg_remquo(long double __x,long double __y, int* __z)
1113     {return remquol(__x, __y, __z);}
1114 
1115 #undef remquo
1116 #define remquo(__x, __y, __z)                         \
1117         __tg_remquo(__tg_promote2((__x), (__y))(__x), \
1118                     __tg_promote2((__x), (__y))(__y), \
1119                     (__z))
1120 
1121 // rint
1122 
1123 static float
1124     _TG_ATTRS
__tg_rint(float __x)1125     __tg_rint(float __x) {return rintf(__x);}
1126 
1127 static double
1128     _TG_ATTRS
__tg_rint(double __x)1129     __tg_rint(double __x) {return rint(__x);}
1130 
1131 static long double
1132     _TG_ATTRS
__tg_rint(long double __x)1133     __tg_rint(long double __x) {return rintl(__x);}
1134 
1135 #undef rint
1136 #define rint(__x) __tg_rint(__tg_promote1((__x))(__x))
1137 
1138 // round
1139 
1140 static float
1141     _TG_ATTRS
__tg_round(float __x)1142     __tg_round(float __x) {return roundf(__x);}
1143 
1144 static double
1145     _TG_ATTRS
__tg_round(double __x)1146     __tg_round(double __x) {return round(__x);}
1147 
1148 static long double
1149     _TG_ATTRS
__tg_round(long double __x)1150     __tg_round(long double __x) {return roundl(__x);}
1151 
1152 #undef round
1153 #define round(__x) __tg_round(__tg_promote1((__x))(__x))
1154 
1155 // scalbn
1156 
1157 static float
1158     _TG_ATTRS
__tg_scalbn(float __x,int __y)1159     __tg_scalbn(float __x, int __y) {return scalbnf(__x, __y);}
1160 
1161 static double
1162     _TG_ATTRS
__tg_scalbn(double __x,int __y)1163     __tg_scalbn(double __x, int __y) {return scalbn(__x, __y);}
1164 
1165 static long double
1166     _TG_ATTRS
__tg_scalbn(long double __x,int __y)1167     __tg_scalbn(long double __x, int __y) {return scalbnl(__x, __y);}
1168 
1169 #undef scalbn
1170 #define scalbn(__x, __y) __tg_scalbn(__tg_promote1((__x))(__x), __y)
1171 
1172 // scalbln
1173 
1174 static float
1175     _TG_ATTRS
__tg_scalbln(float __x,long __y)1176     __tg_scalbln(float __x, long __y) {return scalblnf(__x, __y);}
1177 
1178 static double
1179     _TG_ATTRS
__tg_scalbln(double __x,long __y)1180     __tg_scalbln(double __x, long __y) {return scalbln(__x, __y);}
1181 
1182 static long double
1183     _TG_ATTRS
__tg_scalbln(long double __x,long __y)1184     __tg_scalbln(long double __x, long __y) {return scalblnl(__x, __y);}
1185 
1186 #undef scalbln
1187 #define scalbln(__x, __y) __tg_scalbln(__tg_promote1((__x))(__x), __y)
1188 
1189 // tgamma
1190 
1191 static float
1192     _TG_ATTRS
__tg_tgamma(float __x)1193     __tg_tgamma(float __x) {return tgammaf(__x);}
1194 
1195 static double
1196     _TG_ATTRS
__tg_tgamma(double __x)1197     __tg_tgamma(double __x) {return tgamma(__x);}
1198 
1199 static long double
1200     _TG_ATTRS
__tg_tgamma(long double __x)1201     __tg_tgamma(long double __x) {return tgammal(__x);}
1202 
1203 #undef tgamma
1204 #define tgamma(__x) __tg_tgamma(__tg_promote1((__x))(__x))
1205 
1206 // trunc
1207 
1208 static float
1209     _TG_ATTRS
__tg_trunc(float __x)1210     __tg_trunc(float __x) {return truncf(__x);}
1211 
1212 static double
1213     _TG_ATTRS
__tg_trunc(double __x)1214     __tg_trunc(double __x) {return trunc(__x);}
1215 
1216 static long double
1217     _TG_ATTRS
__tg_trunc(long double __x)1218     __tg_trunc(long double __x) {return truncl(__x);}
1219 
1220 #undef trunc
1221 #define trunc(__x) __tg_trunc(__tg_promote1((__x))(__x))
1222 
1223 // carg
1224 
1225 static float
1226     _TG_ATTRS
__tg_carg(float __x)1227     __tg_carg(float __x) {return atan2f(0.F, __x);}
1228 
1229 static double
1230     _TG_ATTRS
__tg_carg(double __x)1231     __tg_carg(double __x) {return atan2(0., __x);}
1232 
1233 static long double
1234     _TG_ATTRS
__tg_carg(long double __x)1235     __tg_carg(long double __x) {return atan2l(0.L, __x);}
1236 
1237 static float
1238     _TG_ATTRS
__tg_carg(float _Complex __x)1239     __tg_carg(float _Complex __x) {return cargf(__x);}
1240 
1241 static double
1242     _TG_ATTRS
__tg_carg(double _Complex __x)1243     __tg_carg(double _Complex __x) {return carg(__x);}
1244 
1245 static long double
1246     _TG_ATTRS
__tg_carg(long double _Complex __x)1247     __tg_carg(long double _Complex __x) {return cargl(__x);}
1248 
1249 #undef carg
1250 #define carg(__x) __tg_carg(__tg_promote1((__x))(__x))
1251 
1252 // cimag
1253 
1254 static float
1255     _TG_ATTRS
__tg_cimag(float __x)1256     __tg_cimag(float __x) {return 0;}
1257 
1258 static double
1259     _TG_ATTRS
__tg_cimag(double __x)1260     __tg_cimag(double __x) {return 0;}
1261 
1262 static long double
1263     _TG_ATTRS
__tg_cimag(long double __x)1264     __tg_cimag(long double __x) {return 0;}
1265 
1266 static float
1267     _TG_ATTRS
__tg_cimag(float _Complex __x)1268     __tg_cimag(float _Complex __x) {return cimagf(__x);}
1269 
1270 static double
1271     _TG_ATTRS
__tg_cimag(double _Complex __x)1272     __tg_cimag(double _Complex __x) {return cimag(__x);}
1273 
1274 static long double
1275     _TG_ATTRS
__tg_cimag(long double _Complex __x)1276     __tg_cimag(long double _Complex __x) {return cimagl(__x);}
1277 
1278 #undef cimag
1279 #define cimag(__x) __tg_cimag(__tg_promote1((__x))(__x))
1280 
1281 // conj
1282 
1283 static float _Complex
1284     _TG_ATTRS
__tg_conj(float __x)1285     __tg_conj(float __x) {return __x;}
1286 
1287 static double _Complex
1288     _TG_ATTRS
__tg_conj(double __x)1289     __tg_conj(double __x) {return __x;}
1290 
1291 static long double _Complex
1292     _TG_ATTRS
__tg_conj(long double __x)1293     __tg_conj(long double __x) {return __x;}
1294 
1295 static float _Complex
1296     _TG_ATTRS
__tg_conj(float _Complex __x)1297     __tg_conj(float _Complex __x) {return conjf(__x);}
1298 
1299 static double _Complex
1300     _TG_ATTRS
__tg_conj(double _Complex __x)1301     __tg_conj(double _Complex __x) {return conj(__x);}
1302 
1303 static long double _Complex
1304     _TG_ATTRS
__tg_conj(long double _Complex __x)1305     __tg_conj(long double _Complex __x) {return conjl(__x);}
1306 
1307 #undef conj
1308 #define conj(__x) __tg_conj(__tg_promote1((__x))(__x))
1309 
1310 // cproj
1311 
1312 static float _Complex
1313     _TG_ATTRS
__tg_cproj(float __x)1314     __tg_cproj(float __x) {return cprojf(__x);}
1315 
1316 static double _Complex
1317     _TG_ATTRS
__tg_cproj(double __x)1318     __tg_cproj(double __x) {return cproj(__x);}
1319 
1320 static long double _Complex
1321     _TG_ATTRS
__tg_cproj(long double __x)1322     __tg_cproj(long double __x) {return cprojl(__x);}
1323 
1324 static float _Complex
1325     _TG_ATTRS
__tg_cproj(float _Complex __x)1326     __tg_cproj(float _Complex __x) {return cprojf(__x);}
1327 
1328 static double _Complex
1329     _TG_ATTRS
__tg_cproj(double _Complex __x)1330     __tg_cproj(double _Complex __x) {return cproj(__x);}
1331 
1332 static long double _Complex
1333     _TG_ATTRS
__tg_cproj(long double _Complex __x)1334     __tg_cproj(long double _Complex __x) {return cprojl(__x);}
1335 
1336 #undef cproj
1337 #define cproj(__x) __tg_cproj(__tg_promote1((__x))(__x))
1338 
1339 // creal
1340 
1341 static float
1342     _TG_ATTRS
__tg_creal(float __x)1343     __tg_creal(float __x) {return __x;}
1344 
1345 static double
1346     _TG_ATTRS
__tg_creal(double __x)1347     __tg_creal(double __x) {return __x;}
1348 
1349 static long double
1350     _TG_ATTRS
__tg_creal(long double __x)1351     __tg_creal(long double __x) {return __x;}
1352 
1353 static float
1354     _TG_ATTRS
__tg_creal(float _Complex __x)1355     __tg_creal(float _Complex __x) {return crealf(__x);}
1356 
1357 static double
1358     _TG_ATTRS
__tg_creal(double _Complex __x)1359     __tg_creal(double _Complex __x) {return creal(__x);}
1360 
1361 static long double
1362     _TG_ATTRS
__tg_creal(long double _Complex __x)1363     __tg_creal(long double _Complex __x) {return creall(__x);}
1364 
1365 #undef creal
1366 #define creal(__x) __tg_creal(__tg_promote1((__x))(__x))
1367 
1368 #undef _TG_ATTRSp
1369 #undef _TG_ATTRS
1370 
1371 #endif /* __cplusplus */
1372 #endif /* __TGMATH_H */