riscv: Fix feenvupdate with FE_DFL_ENV (BZ 31022)
[glibc.git] / math / test-tgmath.c
blob85ca4e673fe278495f1fde6bcd42fbddbff253d5
1 /* Test compilation of tgmath macros.
2 Copyright (C) 2001-2023 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <https://www.gnu.org/licenses/>. */
19 #ifndef HAVE_MAIN
20 #include <float.h>
21 #include <math.h>
22 #include <stdint.h>
23 #include <stdio.h>
24 #include <tgmath.h>
26 //#define DEBUG
28 static void compile_test (void);
29 static void compile_testf (void);
30 #if LDBL_MANT_DIG > DBL_MANT_DIG
31 static void compile_testl (void);
32 #endif
34 float fx;
35 double dx;
36 long double lx;
37 const float fy = 1.25;
38 const double dy = 1.25;
39 const long double ly = 1.25;
40 complex float fz;
41 complex double dz;
42 complex long double lz;
44 volatile int count_double;
45 volatile int count_float;
46 volatile int count_ldouble;
47 volatile int count_cdouble;
48 volatile int count_cfloat;
49 volatile int count_cldouble;
51 #define NCALLS 158
52 #define NCALLS_INT 4
53 #define NCCALLS 47
55 static int
56 do_test (void)
58 int result = 0;
60 count_float = count_double = count_ldouble = 0;
61 count_cfloat = count_cdouble = count_cldouble = 0;
62 compile_test ();
63 if (count_float != 0 || count_cfloat != 0)
65 puts ("float function called for double test");
66 result = 1;
68 if (count_ldouble != 0 || count_cldouble != 0)
70 puts ("long double function called for double test");
71 result = 1;
73 if (count_double < NCALLS + NCALLS_INT)
75 printf ("double functions not called often enough (%d)\n",
76 count_double);
77 result = 1;
79 else if (count_double > NCALLS + NCALLS_INT)
81 printf ("double functions called too often (%d)\n",
82 count_double);
83 result = 1;
85 if (count_cdouble < NCCALLS)
87 printf ("double complex functions not called often enough (%d)\n",
88 count_cdouble);
89 result = 1;
91 else if (count_cdouble > NCCALLS)
93 printf ("double complex functions called too often (%d)\n",
94 count_cdouble);
95 result = 1;
98 count_float = count_double = count_ldouble = 0;
99 count_cfloat = count_cdouble = count_cldouble = 0;
100 compile_testf ();
101 if (count_double != 0 || count_cdouble != 0)
103 puts ("double function called for float test");
104 result = 1;
106 if (count_ldouble != 0 || count_cldouble != 0)
108 puts ("long double function called for float test");
109 result = 1;
111 if (count_float < NCALLS)
113 printf ("float functions not called often enough (%d)\n", count_float);
114 result = 1;
116 else if (count_float > NCALLS)
118 printf ("float functions called too often (%d)\n",
119 count_double);
120 result = 1;
122 if (count_cfloat < NCCALLS)
124 printf ("float complex functions not called often enough (%d)\n",
125 count_cfloat);
126 result = 1;
128 else if (count_cfloat > NCCALLS)
130 printf ("float complex functions called too often (%d)\n",
131 count_cfloat);
132 result = 1;
135 #if LDBL_MANT_DIG > DBL_MANT_DIG
136 count_float = count_double = count_ldouble = 0;
137 count_cfloat = count_cdouble = count_cldouble = 0;
138 compile_testl ();
139 if (count_float != 0 || count_cfloat != 0)
141 puts ("float function called for long double test");
142 result = 1;
144 if (count_double != 0 || count_cdouble != 0)
146 puts ("double function called for long double test");
147 result = 1;
149 if (count_ldouble < NCALLS)
151 printf ("long double functions not called often enough (%d)\n",
152 count_ldouble);
153 result = 1;
155 else if (count_ldouble > NCALLS)
157 printf ("long double functions called too often (%d)\n",
158 count_double);
159 result = 1;
161 if (count_cldouble < NCCALLS)
163 printf ("long double complex functions not called often enough (%d)\n",
164 count_cldouble);
165 result = 1;
167 else if (count_cldouble > NCCALLS)
169 printf ("long double complex functions called too often (%d)\n",
170 count_cldouble);
171 result = 1;
173 #endif
175 return result;
178 /* Now generate the three functions. */
179 #define HAVE_MAIN
181 #define F(name) name
182 #define TYPE double
183 #define TEST_INT 1
184 #define x dx
185 #define y dy
186 #define z dz
187 #define count count_double
188 #define ccount count_cdouble
189 #include "test-tgmath.c"
191 #define F(name) name##f
192 #define TYPE float
193 #define x fx
194 #define y fy
195 #define z fz
196 #define count count_float
197 #define ccount count_cfloat
198 #include "test-tgmath.c"
200 #if LDBL_MANT_DIG > DBL_MANT_DIG
201 #define F(name) name##l
202 #define TYPE long double
203 #define x lx
204 #define y ly
205 #define z lz
206 #define count count_ldouble
207 #define ccount count_cldouble
208 #include "test-tgmath.c"
209 #endif
211 #define TEST_FUNCTION do_test ()
212 #include "../test-skeleton.c"
214 #else
216 #ifdef DEBUG
217 #define P() puts (__FUNCTION__)
218 #else
219 #define P()
220 #endif
222 static void
223 F(compile_test) (void)
225 TYPE a, b, c = 1.0;
226 complex TYPE d;
227 int i = 2;
228 int saved_count;
229 long int j;
230 long long int k;
231 intmax_t m;
232 uintmax_t um;
234 a = cos (cos (x));
235 b = acos (acos (a));
236 a = sin (sin (x));
237 b = asin (asin (a));
238 a = tan (tan (x));
239 b = atan (atan (a));
240 c = atan2 (atan2 (a, c), atan2 (b, x));
241 a = cosh (cosh (x));
242 b = acosh (acosh (a));
243 a = sinh (sinh (x));
244 b = asinh (asinh (a));
245 a = tanh (tanh (x));
246 b = atanh (atanh (a));
247 a = exp (exp (x));
248 b = log (log (a));
249 a = log10 (log10 (x));
250 b = ldexp (ldexp (a, 1), 5);
251 a = frexp (frexp (x, &i), &i);
252 b = expm1 (expm1 (a));
253 a = log1p (log1p (x));
254 b = logb (logb (a));
255 a = exp2 (exp2 (x));
256 a = exp10 (exp10 (x));
257 b = log2 (log2 (a));
258 a = pow (pow (x, a), pow (c, b));
259 b = sqrt (sqrt (a));
260 a = hypot (hypot (x, b), hypot (c, a));
261 b = cbrt (cbrt (a));
262 a = ceil (ceil (x));
263 b = fabs (fabs (a));
264 a = floor (floor (x));
265 b = fmod (fmod (a, b), fmod (c, x));
266 a = nearbyint (nearbyint (x));
267 b = round (round (a));
268 c = roundeven (roundeven (a));
269 a = trunc (trunc (x));
270 b = remquo (remquo (a, b, &i), remquo (c, x, &i), &i);
271 j = lrint (x) + lround (a);
272 k = llrint (b) + llround (c);
273 m = fromfp (a, FP_INT_UPWARD, 2) + fromfpx (b, FP_INT_DOWNWARD, 3);
274 um = ufromfp (c, FP_INT_TONEAREST, 4) + ufromfpx (a, FP_INT_TOWARDZERO, 5);
275 a = erf (erf (x));
276 b = erfc (erfc (a));
277 a = tgamma (tgamma (x));
278 b = lgamma (lgamma (a));
279 a = rint (rint (x));
280 b = nextafter (nextafter (a, b), nextafter (c, x));
281 a = nextdown (nextdown (a));
282 b = nexttoward (nexttoward (x, a), c);
283 a = nextup (nextup (a));
284 b = remainder (remainder (a, b), remainder (c, x));
285 a = scalb (scalb (x, a), (TYPE) (6));
286 k = scalbn (a, 7) + scalbln (c, 10l);
287 i = ilogb (x);
288 j = llogb (x);
289 a = fdim (fdim (x, a), fdim (c, b));
290 b = fmax (fmax (a, x), fmax (c, b));
291 a = fmin (fmin (x, a), fmin (c, b));
292 b = fmaxmag (fmaxmag (a, x), fmaxmag (c, b));
293 a = fminmag (fminmag (x, a), fminmag (c, b));
294 b = fmaximum (fmaximum (a, x), fmaximum (c, b));
295 a = fminimum (fminimum (x, a), fminimum (c, b));
296 b = fmaximum_num (fmaximum_num (a, x), fmaximum_num (c, b));
297 a = fminimum_num (fminimum_num (x, a), fminimum_num (c, b));
298 b = fmaximum_mag (fmaximum_mag (a, x), fmaximum_mag (c, b));
299 a = fminimum_mag (fminimum_mag (x, a), fminimum_mag (c, b));
300 b = fmaximum_mag_num (fmaximum_mag_num (a, x), fmaximum_mag_num (c, b));
301 a = fminimum_mag_num (fminimum_mag_num (x, a), fminimum_mag_num (c, b));
302 b = fma (sin (a), sin (x), sin (c));
304 #ifdef TEST_INT
305 a = atan2 (i, b);
306 b = remquo (i, a, &i);
307 c = fma (i, b, i);
308 a = pow (i, c);
309 #endif
310 x = a + b + c + i + j + k + m + um;
312 saved_count = count;
313 if (ccount != 0)
314 ccount = -10000;
316 d = cos (cos (z));
317 z = acos (acos (d));
318 d = sin (sin (z));
319 z = asin (asin (d));
320 d = tan (tan (z));
321 z = atan (atan (d));
322 d = cosh (cosh (z));
323 z = acosh (acosh (d));
324 d = sinh (sinh (z));
325 z = asinh (asinh (d));
326 d = tanh (tanh (z));
327 z = atanh (atanh (d));
328 d = exp (exp (z));
329 z = log (log (d));
330 d = sqrt (sqrt (z));
331 z = conj (conj (d));
332 d = fabs (conj (a));
333 z = pow (pow (a, d), pow (b, z));
334 d = cproj (cproj (z));
335 z += fabs (cproj (a));
336 a = carg (carg (z));
337 b = creal (creal (d));
338 c = cimag (cimag (z));
339 x += a + b + c + i + j + k;
340 z += d;
342 if (saved_count != count)
343 count = -10000;
345 if (0)
347 a = cos (y);
348 a = acos (y);
349 a = sin (y);
350 a = asin (y);
351 a = tan (y);
352 a = atan (y);
353 a = atan2 (y, y);
354 a = cosh (y);
355 a = acosh (y);
356 a = sinh (y);
357 a = asinh (y);
358 a = tanh (y);
359 a = atanh (y);
360 a = exp (y);
361 a = log (y);
362 a = log10 (y);
363 a = ldexp (y, 5);
364 a = frexp (y, &i);
365 a = expm1 (y);
366 a = log1p (y);
367 a = logb (y);
368 a = exp2 (y);
369 a = exp10 (y);
370 a = log2 (y);
371 a = pow (y, y);
372 a = sqrt (y);
373 a = hypot (y, y);
374 a = cbrt (y);
375 a = ceil (y);
376 a = fabs (y);
377 a = floor (y);
378 a = fmod (y, y);
379 a = nearbyint (y);
380 a = round (y);
381 a = roundeven (y);
382 a = trunc (y);
383 a = remquo (y, y, &i);
384 j = lrint (y) + lround (y);
385 k = llrint (y) + llround (y);
386 m = fromfp (y, FP_INT_UPWARD, 6) + fromfpx (y, FP_INT_DOWNWARD, 7);
387 um = (ufromfp (y, FP_INT_TONEAREST, 8)
388 + ufromfpx (y, FP_INT_TOWARDZERO, 9));
389 a = erf (y);
390 a = erfc (y);
391 a = tgamma (y);
392 a = lgamma (y);
393 a = rint (y);
394 a = nextafter (y, y);
395 a = nexttoward (y, y);
396 a = remainder (y, y);
397 a = scalb (y, (const TYPE) (6));
398 k = scalbn (y, 7) + scalbln (y, 10l);
399 i = ilogb (y);
400 j = llogb (y);
401 a = fdim (y, y);
402 a = fmax (y, y);
403 a = fmin (y, y);
404 a = fmaxmag (y, y);
405 a = fminmag (y, y);
406 a = fmaximum (y, y);
407 a = fminimum (y, y);
408 a = fmaximum_num (y, y);
409 a = fminimum_num (y, y);
410 a = fmaximum_mag (y, y);
411 a = fminimum_mag (y, y);
412 a = fmaximum_mag_num (y, y);
413 a = fminimum_mag_num (y, y);
414 a = fma (y, y, y);
416 #ifdef TEST_INT
417 a = atan2 (i, y);
418 a = remquo (i, y, &i);
419 a = fma (i, y, i);
420 a = pow (i, y);
421 #endif
423 d = cos ((const complex TYPE) z);
424 d = acos ((const complex TYPE) z);
425 d = sin ((const complex TYPE) z);
426 d = asin ((const complex TYPE) z);
427 d = tan ((const complex TYPE) z);
428 d = atan ((const complex TYPE) z);
429 d = cosh ((const complex TYPE) z);
430 d = acosh ((const complex TYPE) z);
431 d = sinh ((const complex TYPE) z);
432 d = asinh ((const complex TYPE) z);
433 d = tanh ((const complex TYPE) z);
434 d = atanh ((const complex TYPE) z);
435 d = exp ((const complex TYPE) z);
436 d = log ((const complex TYPE) z);
437 d = sqrt ((const complex TYPE) z);
438 d = pow ((const complex TYPE) z, (const complex TYPE) z);
439 d = fabs ((const complex TYPE) z);
440 d = carg ((const complex TYPE) z);
441 d = creal ((const complex TYPE) z);
442 d = cimag ((const complex TYPE) z);
443 d = conj ((const complex TYPE) z);
444 d = cproj ((const complex TYPE) z);
447 #undef x
448 #undef y
449 #undef z
452 TYPE
453 (F(cos)) (TYPE x)
455 ++count;
456 P ();
457 return x;
460 TYPE
461 (F(acos)) (TYPE x)
463 ++count;
464 P ();
465 return x;
468 TYPE
469 (F(sin)) (TYPE x)
471 ++count;
472 P ();
473 return x;
476 TYPE
477 (F(asin)) (TYPE x)
479 ++count;
480 P ();
481 return x;
484 TYPE
485 (F(tan)) (TYPE x)
487 ++count;
488 P ();
489 return x;
492 TYPE
493 (F(atan)) (TYPE x)
495 ++count;
496 P ();
497 return x;
500 TYPE
501 (F(atan2)) (TYPE x, TYPE y)
503 ++count;
504 P ();
505 return x + y;
508 TYPE
509 (F(cosh)) (TYPE x)
511 ++count;
512 P ();
513 return x;
516 TYPE
517 (F(acosh)) (TYPE x)
519 ++count;
520 P ();
521 return x;
524 TYPE
525 (F(sinh)) (TYPE x)
527 ++count;
528 P ();
529 return x;
532 TYPE
533 (F(asinh)) (TYPE x)
535 ++count;
536 P ();
537 return x;
540 TYPE
541 (F(tanh)) (TYPE x)
543 ++count;
544 P ();
545 return x;
548 TYPE
549 (F(atanh)) (TYPE x)
551 ++count;
552 P ();
553 return x;
556 TYPE
557 (F(exp)) (TYPE x)
559 ++count;
560 P ();
561 return x;
564 TYPE
565 (F(log)) (TYPE x)
567 ++count;
568 P ();
569 return x;
572 TYPE
573 (F(log10)) (TYPE x)
575 ++count;
576 P ();
577 return x;
580 TYPE
581 (F(ldexp)) (TYPE x, int y)
583 ++count;
584 P ();
585 return x + y;
588 TYPE
589 (F(frexp)) (TYPE x, int *y)
591 ++count;
592 P ();
593 return x + *y;
596 TYPE
597 (F(expm1)) (TYPE x)
599 ++count;
600 P ();
601 return x;
604 TYPE
605 (F(log1p)) (TYPE x)
607 ++count;
608 P ();
609 return x;
612 TYPE
613 (F(logb)) (TYPE x)
615 ++count;
616 P ();
617 return x;
620 TYPE
621 (F(exp10)) (TYPE x)
623 ++count;
624 P ();
625 return x;
628 TYPE
629 (F(exp2)) (TYPE x)
631 ++count;
632 P ();
633 return x;
636 TYPE
637 (F(log2)) (TYPE x)
639 ++count;
640 P ();
641 return x;
644 TYPE
645 (F(pow)) (TYPE x, TYPE y)
647 ++count;
648 P ();
649 return x + y;
652 TYPE
653 (F(sqrt)) (TYPE x)
655 ++count;
656 P ();
657 return x;
660 TYPE
661 (F(hypot)) (TYPE x, TYPE y)
663 ++count;
664 P ();
665 return x + y;
668 TYPE
669 (F(cbrt)) (TYPE x)
671 ++count;
672 P ();
673 return x;
676 TYPE
677 (F(ceil)) (TYPE x)
679 ++count;
680 P ();
681 return x;
684 TYPE
685 (F(fabs)) (TYPE x)
687 ++count;
688 P ();
689 return x;
692 TYPE
693 (F(floor)) (TYPE x)
695 ++count;
696 P ();
697 return x;
700 TYPE
701 (F(fmod)) (TYPE x, TYPE y)
703 ++count;
704 P ();
705 return x + y;
708 TYPE
709 (F(nearbyint)) (TYPE x)
711 ++count;
712 P ();
713 return x;
716 TYPE
717 (F(round)) (TYPE x)
719 ++count;
720 P ();
721 return x;
724 TYPE
725 (F(roundeven)) (TYPE x)
727 ++count;
728 P ();
729 return x;
732 TYPE
733 (F(trunc)) (TYPE x)
735 ++count;
736 P ();
737 return x;
740 TYPE
741 (F(remquo)) (TYPE x, TYPE y, int *i)
743 ++count;
744 P ();
745 return x + y + *i;
748 long int
749 (F(lrint)) (TYPE x)
751 ++count;
752 P ();
753 return x;
756 long int
757 (F(lround)) (TYPE x)
759 ++count;
760 P ();
761 return x;
764 long long int
765 (F(llrint)) (TYPE x)
767 ++count;
768 P ();
769 return x;
772 long long int
773 (F(llround)) (TYPE x)
775 ++count;
776 P ();
777 return x;
780 intmax_t
781 (F(fromfp)) (TYPE x, int round, unsigned int width)
783 ++count;
784 P ();
785 return x;
788 intmax_t
789 (F(fromfpx)) (TYPE x, int round, unsigned int width)
791 ++count;
792 P ();
793 return x;
796 uintmax_t
797 (F(ufromfp)) (TYPE x, int round, unsigned int width)
799 ++count;
800 P ();
801 return x;
804 uintmax_t
805 (F(ufromfpx)) (TYPE x, int round, unsigned int width)
807 ++count;
808 P ();
809 return x;
812 TYPE
813 (F(erf)) (TYPE x)
815 ++count;
816 P ();
817 return x;
820 TYPE
821 (F(erfc)) (TYPE x)
823 ++count;
824 P ();
825 return x;
828 TYPE
829 (F(tgamma)) (TYPE x)
831 ++count;
832 P ();
833 return x;
836 TYPE
837 (F(lgamma)) (TYPE x)
839 ++count;
840 P ();
841 return x;
844 TYPE
845 (F(rint)) (TYPE x)
847 ++count;
848 P ();
849 return x;
852 TYPE
853 (F(nextafter)) (TYPE x, TYPE y)
855 ++count;
856 P ();
857 return x + y;
860 TYPE
861 (F(nextdown)) (TYPE x)
863 ++count;
864 P ();
865 return x;
868 TYPE
869 (F(nexttoward)) (TYPE x, long double y)
871 ++count;
872 P ();
873 return x + y;
876 TYPE
877 (F(nextup)) (TYPE x)
879 ++count;
880 P ();
881 return x;
884 TYPE
885 (F(remainder)) (TYPE x, TYPE y)
887 ++count;
888 P ();
889 return x + y;
892 TYPE
893 (F(scalb)) (TYPE x, TYPE y)
895 ++count;
896 P ();
897 return x + y;
900 TYPE
901 (F(scalbn)) (TYPE x, int y)
903 ++count;
904 P ();
905 return x + y;
908 TYPE
909 (F(scalbln)) (TYPE x, long int y)
911 ++count;
912 P ();
913 return x + y;
917 (F(ilogb)) (TYPE x)
919 ++count;
920 P ();
921 return x;
924 long int
925 (F(llogb)) (TYPE x)
927 ++count;
928 P ();
929 return x;
932 TYPE
933 (F(fdim)) (TYPE x, TYPE y)
935 ++count;
936 P ();
937 return x + y;
940 TYPE
941 (F(fmin)) (TYPE x, TYPE y)
943 ++count;
944 P ();
945 return x + y;
948 TYPE
949 (F(fmax)) (TYPE x, TYPE y)
951 ++count;
952 P ();
953 return x + y;
956 TYPE
957 (F(fminmag)) (TYPE x, TYPE y)
959 ++count;
960 P ();
961 return x + y;
964 TYPE
965 (F(fmaxmag)) (TYPE x, TYPE y)
967 ++count;
968 P ();
969 return x + y;
972 TYPE
973 (F(fminimum)) (TYPE x, TYPE y)
975 ++count;
976 P ();
977 return x + y;
980 TYPE
981 (F(fmaximum)) (TYPE x, TYPE y)
983 ++count;
984 P ();
985 return x + y;
988 TYPE
989 (F(fminimum_num)) (TYPE x, TYPE y)
991 ++count;
992 P ();
993 return x + y;
996 TYPE
997 (F(fmaximum_num)) (TYPE x, TYPE y)
999 ++count;
1000 P ();
1001 return x + y;
1004 TYPE
1005 (F(fminimum_mag)) (TYPE x, TYPE y)
1007 ++count;
1008 P ();
1009 return x + y;
1012 TYPE
1013 (F(fmaximum_mag)) (TYPE x, TYPE y)
1015 ++count;
1016 P ();
1017 return x + y;
1020 TYPE
1021 (F(fminimum_mag_num)) (TYPE x, TYPE y)
1023 ++count;
1024 P ();
1025 return x + y;
1028 TYPE
1029 (F(fmaximum_mag_num)) (TYPE x, TYPE y)
1031 ++count;
1032 P ();
1033 return x + y;
1036 TYPE
1037 (F(fma)) (TYPE x, TYPE y, TYPE z)
1039 ++count;
1040 P ();
1041 return x + y + z;
1044 complex TYPE
1045 (F(cacos)) (complex TYPE x)
1047 ++ccount;
1048 P ();
1049 return x;
1052 complex TYPE
1053 (F(casin)) (complex TYPE x)
1055 ++ccount;
1056 P ();
1057 return x;
1060 complex TYPE
1061 (F(catan)) (complex TYPE x)
1063 ++ccount;
1064 P ();
1065 return x;
1068 complex TYPE
1069 (F(ccos)) (complex TYPE x)
1071 ++ccount;
1072 P ();
1073 return x;
1076 complex TYPE
1077 (F(csin)) (complex TYPE x)
1079 ++ccount;
1080 P ();
1081 return x;
1084 complex TYPE
1085 (F(ctan)) (complex TYPE x)
1087 ++ccount;
1088 P ();
1089 return x;
1092 complex TYPE
1093 (F(cacosh)) (complex TYPE x)
1095 ++ccount;
1096 P ();
1097 return x;
1100 complex TYPE
1101 (F(casinh)) (complex TYPE x)
1103 ++ccount;
1104 P ();
1105 return x;
1108 complex TYPE
1109 (F(catanh)) (complex TYPE x)
1111 ++ccount;
1112 P ();
1113 return x;
1116 complex TYPE
1117 (F(ccosh)) (complex TYPE x)
1119 ++ccount;
1120 P ();
1121 return x;
1124 complex TYPE
1125 (F(csinh)) (complex TYPE x)
1127 ++ccount;
1128 P ();
1129 return x;
1132 complex TYPE
1133 (F(ctanh)) (complex TYPE x)
1135 ++ccount;
1136 P ();
1137 return x;
1140 complex TYPE
1141 (F(cexp)) (complex TYPE x)
1143 ++ccount;
1144 P ();
1145 return x;
1148 complex TYPE
1149 (F(clog)) (complex TYPE x)
1151 ++ccount;
1152 P ();
1153 return x;
1156 complex TYPE
1157 (F(csqrt)) (complex TYPE x)
1159 ++ccount;
1160 P ();
1161 return x;
1164 complex TYPE
1165 (F(cpow)) (complex TYPE x, complex TYPE y)
1167 ++ccount;
1168 P ();
1169 return x + y;
1172 TYPE
1173 (F(cabs)) (complex TYPE x)
1175 ++ccount;
1176 P ();
1177 return x;
1180 TYPE
1181 (F(carg)) (complex TYPE x)
1183 ++ccount;
1184 P ();
1185 return x;
1188 TYPE
1189 (F(creal)) (complex TYPE x)
1191 ++ccount;
1192 P ();
1193 return __real__ x;
1196 TYPE
1197 (F(cimag)) (complex TYPE x)
1199 ++ccount;
1200 P ();
1201 return __imag__ x;
1204 complex TYPE
1205 (F(conj)) (complex TYPE x)
1207 ++ccount;
1208 P ();
1209 return x;
1212 complex TYPE
1213 (F(cproj)) (complex TYPE x)
1215 ++ccount;
1216 P ();
1217 return x;
1220 #undef F
1221 #undef TYPE
1222 #undef count
1223 #undef ccount
1224 #undef TEST_INT
1225 #endif