Remove "Contributed by" lines
[platform/upstream/glibc.git] / math / test-tgmath.c
1 /* Test compilation of tgmath macros.
2    Copyright (C) 2001-2021 Free Software Foundation, Inc.
3    This file is part of the GNU C Library.
4
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.
9
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.
14
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/>.  */
18
19 #ifndef HAVE_MAIN
20 #include <float.h>
21 #include <math.h>
22 #include <stdint.h>
23 #include <stdio.h>
24 #include <tgmath.h>
25
26 //#define DEBUG
27
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
33
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;
43
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;
50
51 #define NCALLS     132
52 #define NCALLS_INT 4
53 #define NCCALLS    47
54
55 static int
56 do_test (void)
57 {
58   int result = 0;
59
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)
64     {
65       puts ("float function called for double test");
66       result = 1;
67     }
68   if (count_ldouble != 0 || count_cldouble != 0)
69     {
70       puts ("long double function called for double test");
71       result = 1;
72     }
73   if (count_double < NCALLS + NCALLS_INT)
74     {
75       printf ("double functions not called often enough (%d)\n",
76               count_double);
77       result = 1;
78     }
79   else if (count_double > NCALLS + NCALLS_INT)
80     {
81       printf ("double functions called too often (%d)\n",
82               count_double);
83       result = 1;
84     }
85   if (count_cdouble < NCCALLS)
86     {
87       printf ("double complex functions not called often enough (%d)\n",
88               count_cdouble);
89       result = 1;
90     }
91   else if (count_cdouble > NCCALLS)
92     {
93       printf ("double complex functions called too often (%d)\n",
94               count_cdouble);
95       result = 1;
96     }
97
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)
102     {
103       puts ("double function called for float test");
104       result = 1;
105     }
106   if (count_ldouble != 0 || count_cldouble != 0)
107     {
108       puts ("long double function called for float test");
109       result = 1;
110     }
111   if (count_float < NCALLS)
112     {
113       printf ("float functions not called often enough (%d)\n", count_float);
114       result = 1;
115     }
116   else if (count_float > NCALLS)
117     {
118       printf ("float functions called too often (%d)\n",
119               count_double);
120       result = 1;
121     }
122   if (count_cfloat < NCCALLS)
123     {
124       printf ("float complex functions not called often enough (%d)\n",
125               count_cfloat);
126       result = 1;
127     }
128   else if (count_cfloat > NCCALLS)
129     {
130       printf ("float complex functions called too often (%d)\n",
131               count_cfloat);
132       result = 1;
133     }
134
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)
140     {
141       puts ("float function called for long double test");
142       result = 1;
143     }
144   if (count_double != 0 || count_cdouble != 0)
145     {
146       puts ("double function called for long double test");
147       result = 1;
148     }
149   if (count_ldouble < NCALLS)
150     {
151       printf ("long double functions not called often enough (%d)\n",
152               count_ldouble);
153       result = 1;
154     }
155   else if (count_ldouble > NCALLS)
156     {
157       printf ("long double functions called too often (%d)\n",
158               count_double);
159       result = 1;
160     }
161   if (count_cldouble < NCCALLS)
162     {
163       printf ("long double complex functions not called often enough (%d)\n",
164               count_cldouble);
165       result = 1;
166     }
167   else if (count_cldouble > NCCALLS)
168     {
169       printf ("long double complex functions called too often (%d)\n",
170               count_cldouble);
171       result = 1;
172     }
173 #endif
174
175   return result;
176 }
177
178 /* Now generate the three functions.  */
179 #define HAVE_MAIN
180
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"
190
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"
199
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
210
211 #define TEST_FUNCTION do_test ()
212 #include "../test-skeleton.c"
213
214 #else
215
216 #ifdef DEBUG
217 #define P() puts (__FUNCTION__)
218 #else
219 #define P()
220 #endif
221
222 static void
223 F(compile_test) (void)
224 {
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;
233
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   b = log2 (log2 (a));
257   a = pow (pow (x, a), pow (c, b));
258   b = sqrt (sqrt (a));
259   a = hypot (hypot (x, b), hypot (c, a));
260   b = cbrt (cbrt (a));
261   a = ceil (ceil (x));
262   b = fabs (fabs (a));
263   a = floor (floor (x));
264   b = fmod (fmod (a, b), fmod (c, x));
265   a = nearbyint (nearbyint (x));
266   b = round (round (a));
267   c = roundeven (roundeven (a));
268   a = trunc (trunc (x));
269   b = remquo (remquo (a, b, &i), remquo (c, x, &i), &i);
270   j = lrint (x) + lround (a);
271   k = llrint (b) + llround (c);
272   m = fromfp (a, FP_INT_UPWARD, 2) + fromfpx (b, FP_INT_DOWNWARD, 3);
273   um = ufromfp (c, FP_INT_TONEAREST, 4) + ufromfpx (a, FP_INT_TOWARDZERO, 5);
274   a = erf (erf (x));
275   b = erfc (erfc (a));
276   a = tgamma (tgamma (x));
277   b = lgamma (lgamma (a));
278   a = rint (rint (x));
279   b = nextafter (nextafter (a, b), nextafter (c, x));
280   a = nextdown (nextdown (a));
281   b = nexttoward (nexttoward (x, a), c);
282   a = nextup (nextup (a));
283   b = remainder (remainder (a, b), remainder (c, x));
284   a = scalb (scalb (x, a), (TYPE) (6));
285   k = scalbn (a, 7) + scalbln (c, 10l);
286   i = ilogb (x);
287   j = llogb (x);
288   a = fdim (fdim (x, a), fdim (c, b));
289   b = fmax (fmax (a, x), fmax (c, b));
290   a = fmin (fmin (x, a), fmin (c, b));
291   b = fmaxmag (fmaxmag (a, x), fmaxmag (c, b));
292   a = fminmag (fminmag (x, a), fminmag (c, b));
293   b = fma (sin (a), sin (x), sin (c));
294
295 #ifdef TEST_INT
296   a = atan2 (i, b);
297   b = remquo (i, a, &i);
298   c = fma (i, b, i);
299   a = pow (i, c);
300 #endif
301   x = a + b + c + i + j + k + m + um;
302
303   saved_count = count;
304   if (ccount != 0)
305     ccount = -10000;
306
307   d = cos (cos (z));
308   z = acos (acos (d));
309   d = sin (sin (z));
310   z = asin (asin (d));
311   d = tan (tan (z));
312   z = atan (atan (d));
313   d = cosh (cosh (z));
314   z = acosh (acosh (d));
315   d = sinh (sinh (z));
316   z = asinh (asinh (d));
317   d = tanh (tanh (z));
318   z = atanh (atanh (d));
319   d = exp (exp (z));
320   z = log (log (d));
321   d = sqrt (sqrt (z));
322   z = conj (conj (d));
323   d = fabs (conj (a));
324   z = pow (pow (a, d), pow (b, z));
325   d = cproj (cproj (z));
326   z += fabs (cproj (a));
327   a = carg (carg (z));
328   b = creal (creal (d));
329   c = cimag (cimag (z));
330   x += a + b + c + i + j + k;
331   z += d;
332
333   if (saved_count != count)
334     count = -10000;
335
336   if (0)
337     {
338       a = cos (y);
339       a = acos (y);
340       a = sin (y);
341       a = asin (y);
342       a = tan (y);
343       a = atan (y);
344       a = atan2 (y, y);
345       a = cosh (y);
346       a = acosh (y);
347       a = sinh (y);
348       a = asinh (y);
349       a = tanh (y);
350       a = atanh (y);
351       a = exp (y);
352       a = log (y);
353       a = log10 (y);
354       a = ldexp (y, 5);
355       a = frexp (y, &i);
356       a = expm1 (y);
357       a = log1p (y);
358       a = logb (y);
359       a = exp2 (y);
360       a = log2 (y);
361       a = pow (y, y);
362       a = sqrt (y);
363       a = hypot (y, y);
364       a = cbrt (y);
365       a = ceil (y);
366       a = fabs (y);
367       a = floor (y);
368       a = fmod (y, y);
369       a = nearbyint (y);
370       a = round (y);
371       a = roundeven (y);
372       a = trunc (y);
373       a = remquo (y, y, &i);
374       j = lrint (y) + lround (y);
375       k = llrint (y) + llround (y);
376       m = fromfp (y, FP_INT_UPWARD, 6) + fromfpx (y, FP_INT_DOWNWARD, 7);
377       um = (ufromfp (y, FP_INT_TONEAREST, 8)
378             + ufromfpx (y, FP_INT_TOWARDZERO, 9));
379       a = erf (y);
380       a = erfc (y);
381       a = tgamma (y);
382       a = lgamma (y);
383       a = rint (y);
384       a = nextafter (y, y);
385       a = nexttoward (y, y);
386       a = remainder (y, y);
387       a = scalb (y, (const TYPE) (6));
388       k = scalbn (y, 7) + scalbln (y, 10l);
389       i = ilogb (y);
390       j = llogb (y);
391       a = fdim (y, y);
392       a = fmax (y, y);
393       a = fmin (y, y);
394       a = fmaxmag (y, y);
395       a = fminmag (y, y);
396       a = fma (y, y, y);
397
398 #ifdef TEST_INT
399       a = atan2 (i, y);
400       a = remquo (i, y, &i);
401       a = fma (i, y, i);
402       a = pow (i, y);
403 #endif
404
405       d = cos ((const complex TYPE) z);
406       d = acos ((const complex TYPE) z);
407       d = sin ((const complex TYPE) z);
408       d = asin ((const complex TYPE) z);
409       d = tan ((const complex TYPE) z);
410       d = atan ((const complex TYPE) z);
411       d = cosh ((const complex TYPE) z);
412       d = acosh ((const complex TYPE) z);
413       d = sinh ((const complex TYPE) z);
414       d = asinh ((const complex TYPE) z);
415       d = tanh ((const complex TYPE) z);
416       d = atanh ((const complex TYPE) z);
417       d = exp ((const complex TYPE) z);
418       d = log ((const complex TYPE) z);
419       d = sqrt ((const complex TYPE) z);
420       d = pow ((const complex TYPE) z, (const complex TYPE) z);
421       d = fabs ((const complex TYPE) z);
422       d = carg ((const complex TYPE) z);
423       d = creal ((const complex TYPE) z);
424       d = cimag ((const complex TYPE) z);
425       d = conj ((const complex TYPE) z);
426       d = cproj ((const complex TYPE) z);
427     }
428 }
429 #undef x
430 #undef y
431 #undef z
432
433
434 TYPE
435 (F(cos)) (TYPE x)
436 {
437   ++count;
438   P ();
439   return x;
440 }
441
442 TYPE
443 (F(acos)) (TYPE x)
444 {
445   ++count;
446   P ();
447   return x;
448 }
449
450 TYPE
451 (F(sin)) (TYPE x)
452 {
453   ++count;
454   P ();
455   return x;
456 }
457
458 TYPE
459 (F(asin)) (TYPE x)
460 {
461   ++count;
462   P ();
463   return x;
464 }
465
466 TYPE
467 (F(tan)) (TYPE x)
468 {
469   ++count;
470   P ();
471   return x;
472 }
473
474 TYPE
475 (F(atan)) (TYPE x)
476 {
477   ++count;
478   P ();
479   return x;
480 }
481
482 TYPE
483 (F(atan2)) (TYPE x, TYPE y)
484 {
485   ++count;
486   P ();
487   return x + y;
488 }
489
490 TYPE
491 (F(cosh)) (TYPE x)
492 {
493   ++count;
494   P ();
495   return x;
496 }
497
498 TYPE
499 (F(acosh)) (TYPE x)
500 {
501   ++count;
502   P ();
503   return x;
504 }
505
506 TYPE
507 (F(sinh)) (TYPE x)
508 {
509   ++count;
510   P ();
511   return x;
512 }
513
514 TYPE
515 (F(asinh)) (TYPE x)
516 {
517   ++count;
518   P ();
519   return x;
520 }
521
522 TYPE
523 (F(tanh)) (TYPE x)
524 {
525   ++count;
526   P ();
527   return x;
528 }
529
530 TYPE
531 (F(atanh)) (TYPE x)
532 {
533   ++count;
534   P ();
535   return x;
536 }
537
538 TYPE
539 (F(exp)) (TYPE x)
540 {
541   ++count;
542   P ();
543   return x;
544 }
545
546 TYPE
547 (F(log)) (TYPE x)
548 {
549   ++count;
550   P ();
551   return x;
552 }
553
554 TYPE
555 (F(log10)) (TYPE x)
556 {
557   ++count;
558   P ();
559   return x;
560 }
561
562 TYPE
563 (F(ldexp)) (TYPE x, int y)
564 {
565   ++count;
566   P ();
567   return x + y;
568 }
569
570 TYPE
571 (F(frexp)) (TYPE x, int *y)
572 {
573   ++count;
574   P ();
575   return x + *y;
576 }
577
578 TYPE
579 (F(expm1)) (TYPE x)
580 {
581   ++count;
582   P ();
583   return x;
584 }
585
586 TYPE
587 (F(log1p)) (TYPE x)
588 {
589   ++count;
590   P ();
591   return x;
592 }
593
594 TYPE
595 (F(logb)) (TYPE x)
596 {
597   ++count;
598   P ();
599   return x;
600 }
601
602 TYPE
603 (F(exp2)) (TYPE x)
604 {
605   ++count;
606   P ();
607   return x;
608 }
609
610 TYPE
611 (F(log2)) (TYPE x)
612 {
613   ++count;
614   P ();
615   return x;
616 }
617
618 TYPE
619 (F(pow)) (TYPE x, TYPE y)
620 {
621   ++count;
622   P ();
623   return x + y;
624 }
625
626 TYPE
627 (F(sqrt)) (TYPE x)
628 {
629   ++count;
630   P ();
631   return x;
632 }
633
634 TYPE
635 (F(hypot)) (TYPE x, TYPE y)
636 {
637   ++count;
638   P ();
639   return x + y;
640 }
641
642 TYPE
643 (F(cbrt)) (TYPE x)
644 {
645   ++count;
646   P ();
647   return x;
648 }
649
650 TYPE
651 (F(ceil)) (TYPE x)
652 {
653   ++count;
654   P ();
655   return x;
656 }
657
658 TYPE
659 (F(fabs)) (TYPE x)
660 {
661   ++count;
662   P ();
663   return x;
664 }
665
666 TYPE
667 (F(floor)) (TYPE x)
668 {
669   ++count;
670   P ();
671   return x;
672 }
673
674 TYPE
675 (F(fmod)) (TYPE x, TYPE y)
676 {
677   ++count;
678   P ();
679   return x + y;
680 }
681
682 TYPE
683 (F(nearbyint)) (TYPE x)
684 {
685   ++count;
686   P ();
687   return x;
688 }
689
690 TYPE
691 (F(round)) (TYPE x)
692 {
693   ++count;
694   P ();
695   return x;
696 }
697
698 TYPE
699 (F(roundeven)) (TYPE x)
700 {
701   ++count;
702   P ();
703   return x;
704 }
705
706 TYPE
707 (F(trunc)) (TYPE x)
708 {
709   ++count;
710   P ();
711   return x;
712 }
713
714 TYPE
715 (F(remquo)) (TYPE x, TYPE y, int *i)
716 {
717   ++count;
718   P ();
719   return x + y + *i;
720 }
721
722 long int
723 (F(lrint)) (TYPE x)
724 {
725   ++count;
726   P ();
727   return x;
728 }
729
730 long int
731 (F(lround)) (TYPE x)
732 {
733   ++count;
734   P ();
735   return x;
736 }
737
738 long long int
739 (F(llrint)) (TYPE x)
740 {
741   ++count;
742   P ();
743   return x;
744 }
745
746 long long int
747 (F(llround)) (TYPE x)
748 {
749   ++count;
750   P ();
751   return x;
752 }
753
754 intmax_t
755 (F(fromfp)) (TYPE x, int round, unsigned int width)
756 {
757   ++count;
758   P ();
759   return x;
760 }
761
762 intmax_t
763 (F(fromfpx)) (TYPE x, int round, unsigned int width)
764 {
765   ++count;
766   P ();
767   return x;
768 }
769
770 uintmax_t
771 (F(ufromfp)) (TYPE x, int round, unsigned int width)
772 {
773   ++count;
774   P ();
775   return x;
776 }
777
778 uintmax_t
779 (F(ufromfpx)) (TYPE x, int round, unsigned int width)
780 {
781   ++count;
782   P ();
783   return x;
784 }
785
786 TYPE
787 (F(erf)) (TYPE x)
788 {
789   ++count;
790   P ();
791   return x;
792 }
793
794 TYPE
795 (F(erfc)) (TYPE x)
796 {
797   ++count;
798   P ();
799   return x;
800 }
801
802 TYPE
803 (F(tgamma)) (TYPE x)
804 {
805   ++count;
806   P ();
807   return x;
808 }
809
810 TYPE
811 (F(lgamma)) (TYPE x)
812 {
813   ++count;
814   P ();
815   return x;
816 }
817
818 TYPE
819 (F(rint)) (TYPE x)
820 {
821   ++count;
822   P ();
823   return x;
824 }
825
826 TYPE
827 (F(nextafter)) (TYPE x, TYPE y)
828 {
829   ++count;
830   P ();
831   return x + y;
832 }
833
834 TYPE
835 (F(nextdown)) (TYPE x)
836 {
837   ++count;
838   P ();
839   return x;
840 }
841
842 TYPE
843 (F(nexttoward)) (TYPE x, long double y)
844 {
845   ++count;
846   P ();
847   return x + y;
848 }
849
850 TYPE
851 (F(nextup)) (TYPE x)
852 {
853   ++count;
854   P ();
855   return x;
856 }
857
858 TYPE
859 (F(remainder)) (TYPE x, TYPE y)
860 {
861   ++count;
862   P ();
863   return x + y;
864 }
865
866 TYPE
867 (F(scalb)) (TYPE x, TYPE y)
868 {
869   ++count;
870   P ();
871   return x + y;
872 }
873
874 TYPE
875 (F(scalbn)) (TYPE x, int y)
876 {
877   ++count;
878   P ();
879   return x + y;
880 }
881
882 TYPE
883 (F(scalbln)) (TYPE x, long int y)
884 {
885   ++count;
886   P ();
887   return x + y;
888 }
889
890 int
891 (F(ilogb)) (TYPE x)
892 {
893   ++count;
894   P ();
895   return x;
896 }
897
898 long int
899 (F(llogb)) (TYPE x)
900 {
901   ++count;
902   P ();
903   return x;
904 }
905
906 TYPE
907 (F(fdim)) (TYPE x, TYPE y)
908 {
909   ++count;
910   P ();
911   return x + y;
912 }
913
914 TYPE
915 (F(fmin)) (TYPE x, TYPE y)
916 {
917   ++count;
918   P ();
919   return x + y;
920 }
921
922 TYPE
923 (F(fmax)) (TYPE x, TYPE y)
924 {
925   ++count;
926   P ();
927   return x + y;
928 }
929
930 TYPE
931 (F(fminmag)) (TYPE x, TYPE y)
932 {
933   ++count;
934   P ();
935   return x + y;
936 }
937
938 TYPE
939 (F(fmaxmag)) (TYPE x, TYPE y)
940 {
941   ++count;
942   P ();
943   return x + y;
944 }
945
946 TYPE
947 (F(fma)) (TYPE x, TYPE y, TYPE z)
948 {
949   ++count;
950   P ();
951   return x + y + z;
952 }
953
954 complex TYPE
955 (F(cacos)) (complex TYPE x)
956 {
957   ++ccount;
958   P ();
959   return x;
960 }
961
962 complex TYPE
963 (F(casin)) (complex TYPE x)
964 {
965   ++ccount;
966   P ();
967   return x;
968 }
969
970 complex TYPE
971 (F(catan)) (complex TYPE x)
972 {
973   ++ccount;
974   P ();
975   return x;
976 }
977
978 complex TYPE
979 (F(ccos)) (complex TYPE x)
980 {
981   ++ccount;
982   P ();
983   return x;
984 }
985
986 complex TYPE
987 (F(csin)) (complex TYPE x)
988 {
989   ++ccount;
990   P ();
991   return x;
992 }
993
994 complex TYPE
995 (F(ctan)) (complex TYPE x)
996 {
997   ++ccount;
998   P ();
999   return x;
1000 }
1001
1002 complex TYPE
1003 (F(cacosh)) (complex TYPE x)
1004 {
1005   ++ccount;
1006   P ();
1007   return x;
1008 }
1009
1010 complex TYPE
1011 (F(casinh)) (complex TYPE x)
1012 {
1013   ++ccount;
1014   P ();
1015   return x;
1016 }
1017
1018 complex TYPE
1019 (F(catanh)) (complex TYPE x)
1020 {
1021   ++ccount;
1022   P ();
1023   return x;
1024 }
1025
1026 complex TYPE
1027 (F(ccosh)) (complex TYPE x)
1028 {
1029   ++ccount;
1030   P ();
1031   return x;
1032 }
1033
1034 complex TYPE
1035 (F(csinh)) (complex TYPE x)
1036 {
1037   ++ccount;
1038   P ();
1039   return x;
1040 }
1041
1042 complex TYPE
1043 (F(ctanh)) (complex TYPE x)
1044 {
1045   ++ccount;
1046   P ();
1047   return x;
1048 }
1049
1050 complex TYPE
1051 (F(cexp)) (complex TYPE x)
1052 {
1053   ++ccount;
1054   P ();
1055   return x;
1056 }
1057
1058 complex TYPE
1059 (F(clog)) (complex TYPE x)
1060 {
1061   ++ccount;
1062   P ();
1063   return x;
1064 }
1065
1066 complex TYPE
1067 (F(csqrt)) (complex TYPE x)
1068 {
1069   ++ccount;
1070   P ();
1071   return x;
1072 }
1073
1074 complex TYPE
1075 (F(cpow)) (complex TYPE x, complex TYPE y)
1076 {
1077   ++ccount;
1078   P ();
1079   return x + y;
1080 }
1081
1082 TYPE
1083 (F(cabs)) (complex TYPE x)
1084 {
1085   ++ccount;
1086   P ();
1087   return x;
1088 }
1089
1090 TYPE
1091 (F(carg)) (complex TYPE x)
1092 {
1093   ++ccount;
1094   P ();
1095   return x;
1096 }
1097
1098 TYPE
1099 (F(creal)) (complex TYPE x)
1100 {
1101   ++ccount;
1102   P ();
1103   return __real__ x;
1104 }
1105
1106 TYPE
1107 (F(cimag)) (complex TYPE x)
1108 {
1109   ++ccount;
1110   P ();
1111   return __imag__ x;
1112 }
1113
1114 complex TYPE
1115 (F(conj)) (complex TYPE x)
1116 {
1117   ++ccount;
1118   P ();
1119   return x;
1120 }
1121
1122 complex TYPE
1123 (F(cproj)) (complex TYPE x)
1124 {
1125   ++ccount;
1126   P ();
1127   return x;
1128 }
1129
1130 #undef F
1131 #undef TYPE
1132 #undef count
1133 #undef ccount
1134 #undef TEST_INT
1135 #endif