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