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