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