(root)/
glibc-2.38/
math/
test-tgmath.c
       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.
       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     158
      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    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));
     303  
     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;
     311  
     312    saved_count = count;
     313    if (ccount != 0)
     314      ccount = -10000;
     315  
     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;
     341  
     342    if (saved_count != count)
     343      count = -10000;
     344  
     345    if (0)
     346      {
     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);
     415  
     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
     422  
     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);
     445      }
     446  }
     447  #undef x
     448  #undef y
     449  #undef z
     450  
     451  
     452  TYPE
     453  (F(cos)) (TYPE x)
     454  {
     455    ++count;
     456    P ();
     457    return x;
     458  }
     459  
     460  TYPE
     461  (F(acos)) (TYPE x)
     462  {
     463    ++count;
     464    P ();
     465    return x;
     466  }
     467  
     468  TYPE
     469  (F(sin)) (TYPE x)
     470  {
     471    ++count;
     472    P ();
     473    return x;
     474  }
     475  
     476  TYPE
     477  (F(asin)) (TYPE x)
     478  {
     479    ++count;
     480    P ();
     481    return x;
     482  }
     483  
     484  TYPE
     485  (F(tan)) (TYPE x)
     486  {
     487    ++count;
     488    P ();
     489    return x;
     490  }
     491  
     492  TYPE
     493  (F(atan)) (TYPE x)
     494  {
     495    ++count;
     496    P ();
     497    return x;
     498  }
     499  
     500  TYPE
     501  (F(atan2)) (TYPE x, TYPE y)
     502  {
     503    ++count;
     504    P ();
     505    return x + y;
     506  }
     507  
     508  TYPE
     509  (F(cosh)) (TYPE x)
     510  {
     511    ++count;
     512    P ();
     513    return x;
     514  }
     515  
     516  TYPE
     517  (F(acosh)) (TYPE x)
     518  {
     519    ++count;
     520    P ();
     521    return x;
     522  }
     523  
     524  TYPE
     525  (F(sinh)) (TYPE x)
     526  {
     527    ++count;
     528    P ();
     529    return x;
     530  }
     531  
     532  TYPE
     533  (F(asinh)) (TYPE x)
     534  {
     535    ++count;
     536    P ();
     537    return x;
     538  }
     539  
     540  TYPE
     541  (F(tanh)) (TYPE x)
     542  {
     543    ++count;
     544    P ();
     545    return x;
     546  }
     547  
     548  TYPE
     549  (F(atanh)) (TYPE x)
     550  {
     551    ++count;
     552    P ();
     553    return x;
     554  }
     555  
     556  TYPE
     557  (F(exp)) (TYPE x)
     558  {
     559    ++count;
     560    P ();
     561    return x;
     562  }
     563  
     564  TYPE
     565  (F(log)) (TYPE x)
     566  {
     567    ++count;
     568    P ();
     569    return x;
     570  }
     571  
     572  TYPE
     573  (F(log10)) (TYPE x)
     574  {
     575    ++count;
     576    P ();
     577    return x;
     578  }
     579  
     580  TYPE
     581  (F(ldexp)) (TYPE x, int y)
     582  {
     583    ++count;
     584    P ();
     585    return x + y;
     586  }
     587  
     588  TYPE
     589  (F(frexp)) (TYPE x, int *y)
     590  {
     591    ++count;
     592    P ();
     593    return x + *y;
     594  }
     595  
     596  TYPE
     597  (F(expm1)) (TYPE x)
     598  {
     599    ++count;
     600    P ();
     601    return x;
     602  }
     603  
     604  TYPE
     605  (F(log1p)) (TYPE x)
     606  {
     607    ++count;
     608    P ();
     609    return x;
     610  }
     611  
     612  TYPE
     613  (F(logb)) (TYPE x)
     614  {
     615    ++count;
     616    P ();
     617    return x;
     618  }
     619  
     620  TYPE
     621  (F(exp10)) (TYPE x)
     622  {
     623    ++count;
     624    P ();
     625    return x;
     626  }
     627  
     628  TYPE
     629  (F(exp2)) (TYPE x)
     630  {
     631    ++count;
     632    P ();
     633    return x;
     634  }
     635  
     636  TYPE
     637  (F(log2)) (TYPE x)
     638  {
     639    ++count;
     640    P ();
     641    return x;
     642  }
     643  
     644  TYPE
     645  (F(pow)) (TYPE x, TYPE y)
     646  {
     647    ++count;
     648    P ();
     649    return x + y;
     650  }
     651  
     652  TYPE
     653  (F(sqrt)) (TYPE x)
     654  {
     655    ++count;
     656    P ();
     657    return x;
     658  }
     659  
     660  TYPE
     661  (F(hypot)) (TYPE x, TYPE y)
     662  {
     663    ++count;
     664    P ();
     665    return x + y;
     666  }
     667  
     668  TYPE
     669  (F(cbrt)) (TYPE x)
     670  {
     671    ++count;
     672    P ();
     673    return x;
     674  }
     675  
     676  TYPE
     677  (F(ceil)) (TYPE x)
     678  {
     679    ++count;
     680    P ();
     681    return x;
     682  }
     683  
     684  TYPE
     685  (F(fabs)) (TYPE x)
     686  {
     687    ++count;
     688    P ();
     689    return x;
     690  }
     691  
     692  TYPE
     693  (F(floor)) (TYPE x)
     694  {
     695    ++count;
     696    P ();
     697    return x;
     698  }
     699  
     700  TYPE
     701  (F(fmod)) (TYPE x, TYPE y)
     702  {
     703    ++count;
     704    P ();
     705    return x + y;
     706  }
     707  
     708  TYPE
     709  (F(nearbyint)) (TYPE x)
     710  {
     711    ++count;
     712    P ();
     713    return x;
     714  }
     715  
     716  TYPE
     717  (F(round)) (TYPE x)
     718  {
     719    ++count;
     720    P ();
     721    return x;
     722  }
     723  
     724  TYPE
     725  (F(roundeven)) (TYPE x)
     726  {
     727    ++count;
     728    P ();
     729    return x;
     730  }
     731  
     732  TYPE
     733  (F(trunc)) (TYPE x)
     734  {
     735    ++count;
     736    P ();
     737    return x;
     738  }
     739  
     740  TYPE
     741  (F(remquo)) (TYPE x, TYPE y, int *i)
     742  {
     743    ++count;
     744    P ();
     745    return x + y + *i;
     746  }
     747  
     748  long int
     749  (F(lrint)) (TYPE x)
     750  {
     751    ++count;
     752    P ();
     753    return x;
     754  }
     755  
     756  long int
     757  (F(lround)) (TYPE x)
     758  {
     759    ++count;
     760    P ();
     761    return x;
     762  }
     763  
     764  long long int
     765  (F(llrint)) (TYPE x)
     766  {
     767    ++count;
     768    P ();
     769    return x;
     770  }
     771  
     772  long long int
     773  (F(llround)) (TYPE x)
     774  {
     775    ++count;
     776    P ();
     777    return x;
     778  }
     779  
     780  intmax_t
     781  (F(fromfp)) (TYPE x, int round, unsigned int width)
     782  {
     783    ++count;
     784    P ();
     785    return x;
     786  }
     787  
     788  intmax_t
     789  (F(fromfpx)) (TYPE x, int round, unsigned int width)
     790  {
     791    ++count;
     792    P ();
     793    return x;
     794  }
     795  
     796  uintmax_t
     797  (F(ufromfp)) (TYPE x, int round, unsigned int width)
     798  {
     799    ++count;
     800    P ();
     801    return x;
     802  }
     803  
     804  uintmax_t
     805  (F(ufromfpx)) (TYPE x, int round, unsigned int width)
     806  {
     807    ++count;
     808    P ();
     809    return x;
     810  }
     811  
     812  TYPE
     813  (F(erf)) (TYPE x)
     814  {
     815    ++count;
     816    P ();
     817    return x;
     818  }
     819  
     820  TYPE
     821  (F(erfc)) (TYPE x)
     822  {
     823    ++count;
     824    P ();
     825    return x;
     826  }
     827  
     828  TYPE
     829  (F(tgamma)) (TYPE x)
     830  {
     831    ++count;
     832    P ();
     833    return x;
     834  }
     835  
     836  TYPE
     837  (F(lgamma)) (TYPE x)
     838  {
     839    ++count;
     840    P ();
     841    return x;
     842  }
     843  
     844  TYPE
     845  (F(rint)) (TYPE x)
     846  {
     847    ++count;
     848    P ();
     849    return x;
     850  }
     851  
     852  TYPE
     853  (F(nextafter)) (TYPE x, TYPE y)
     854  {
     855    ++count;
     856    P ();
     857    return x + y;
     858  }
     859  
     860  TYPE
     861  (F(nextdown)) (TYPE x)
     862  {
     863    ++count;
     864    P ();
     865    return x;
     866  }
     867  
     868  TYPE
     869  (F(nexttoward)) (TYPE x, long double y)
     870  {
     871    ++count;
     872    P ();
     873    return x + y;
     874  }
     875  
     876  TYPE
     877  (F(nextup)) (TYPE x)
     878  {
     879    ++count;
     880    P ();
     881    return x;
     882  }
     883  
     884  TYPE
     885  (F(remainder)) (TYPE x, TYPE y)
     886  {
     887    ++count;
     888    P ();
     889    return x + y;
     890  }
     891  
     892  TYPE
     893  (F(scalb)) (TYPE x, TYPE y)
     894  {
     895    ++count;
     896    P ();
     897    return x + y;
     898  }
     899  
     900  TYPE
     901  (F(scalbn)) (TYPE x, int y)
     902  {
     903    ++count;
     904    P ();
     905    return x + y;
     906  }
     907  
     908  TYPE
     909  (F(scalbln)) (TYPE x, long int y)
     910  {
     911    ++count;
     912    P ();
     913    return x + y;
     914  }
     915  
     916  int
     917  (F(ilogb)) (TYPE x)
     918  {
     919    ++count;
     920    P ();
     921    return x;
     922  }
     923  
     924  long int
     925  (F(llogb)) (TYPE x)
     926  {
     927    ++count;
     928    P ();
     929    return x;
     930  }
     931  
     932  TYPE
     933  (F(fdim)) (TYPE x, TYPE y)
     934  {
     935    ++count;
     936    P ();
     937    return x + y;
     938  }
     939  
     940  TYPE
     941  (F(fmin)) (TYPE x, TYPE y)
     942  {
     943    ++count;
     944    P ();
     945    return x + y;
     946  }
     947  
     948  TYPE
     949  (F(fmax)) (TYPE x, TYPE y)
     950  {
     951    ++count;
     952    P ();
     953    return x + y;
     954  }
     955  
     956  TYPE
     957  (F(fminmag)) (TYPE x, TYPE y)
     958  {
     959    ++count;
     960    P ();
     961    return x + y;
     962  }
     963  
     964  TYPE
     965  (F(fmaxmag)) (TYPE x, TYPE y)
     966  {
     967    ++count;
     968    P ();
     969    return x + y;
     970  }
     971  
     972  TYPE
     973  (F(fminimum)) (TYPE x, TYPE y)
     974  {
     975    ++count;
     976    P ();
     977    return x + y;
     978  }
     979  
     980  TYPE
     981  (F(fmaximum)) (TYPE x, TYPE y)
     982  {
     983    ++count;
     984    P ();
     985    return x + y;
     986  }
     987  
     988  TYPE
     989  (F(fminimum_num)) (TYPE x, TYPE y)
     990  {
     991    ++count;
     992    P ();
     993    return x + y;
     994  }
     995  
     996  TYPE
     997  (F(fmaximum_num)) (TYPE x, TYPE y)
     998  {
     999    ++count;
    1000    P ();
    1001    return x + y;
    1002  }
    1003  
    1004  TYPE
    1005  (F(fminimum_mag)) (TYPE x, TYPE y)
    1006  {
    1007    ++count;
    1008    P ();
    1009    return x + y;
    1010  }
    1011  
    1012  TYPE
    1013  (F(fmaximum_mag)) (TYPE x, TYPE y)
    1014  {
    1015    ++count;
    1016    P ();
    1017    return x + y;
    1018  }
    1019  
    1020  TYPE
    1021  (F(fminimum_mag_num)) (TYPE x, TYPE y)
    1022  {
    1023    ++count;
    1024    P ();
    1025    return x + y;
    1026  }
    1027  
    1028  TYPE
    1029  (F(fmaximum_mag_num)) (TYPE x, TYPE y)
    1030  {
    1031    ++count;
    1032    P ();
    1033    return x + y;
    1034  }
    1035  
    1036  TYPE
    1037  (F(fma)) (TYPE x, TYPE y, TYPE z)
    1038  {
    1039    ++count;
    1040    P ();
    1041    return x + y + z;
    1042  }
    1043  
    1044  complex TYPE
    1045  (F(cacos)) (complex TYPE x)
    1046  {
    1047    ++ccount;
    1048    P ();
    1049    return x;
    1050  }
    1051  
    1052  complex TYPE
    1053  (F(casin)) (complex TYPE x)
    1054  {
    1055    ++ccount;
    1056    P ();
    1057    return x;
    1058  }
    1059  
    1060  complex TYPE
    1061  (F(catan)) (complex TYPE x)
    1062  {
    1063    ++ccount;
    1064    P ();
    1065    return x;
    1066  }
    1067  
    1068  complex TYPE
    1069  (F(ccos)) (complex TYPE x)
    1070  {
    1071    ++ccount;
    1072    P ();
    1073    return x;
    1074  }
    1075  
    1076  complex TYPE
    1077  (F(csin)) (complex TYPE x)
    1078  {
    1079    ++ccount;
    1080    P ();
    1081    return x;
    1082  }
    1083  
    1084  complex TYPE
    1085  (F(ctan)) (complex TYPE x)
    1086  {
    1087    ++ccount;
    1088    P ();
    1089    return x;
    1090  }
    1091  
    1092  complex TYPE
    1093  (F(cacosh)) (complex TYPE x)
    1094  {
    1095    ++ccount;
    1096    P ();
    1097    return x;
    1098  }
    1099  
    1100  complex TYPE
    1101  (F(casinh)) (complex TYPE x)
    1102  {
    1103    ++ccount;
    1104    P ();
    1105    return x;
    1106  }
    1107  
    1108  complex TYPE
    1109  (F(catanh)) (complex TYPE x)
    1110  {
    1111    ++ccount;
    1112    P ();
    1113    return x;
    1114  }
    1115  
    1116  complex TYPE
    1117  (F(ccosh)) (complex TYPE x)
    1118  {
    1119    ++ccount;
    1120    P ();
    1121    return x;
    1122  }
    1123  
    1124  complex TYPE
    1125  (F(csinh)) (complex TYPE x)
    1126  {
    1127    ++ccount;
    1128    P ();
    1129    return x;
    1130  }
    1131  
    1132  complex TYPE
    1133  (F(ctanh)) (complex TYPE x)
    1134  {
    1135    ++ccount;
    1136    P ();
    1137    return x;
    1138  }
    1139  
    1140  complex TYPE
    1141  (F(cexp)) (complex TYPE x)
    1142  {
    1143    ++ccount;
    1144    P ();
    1145    return x;
    1146  }
    1147  
    1148  complex TYPE
    1149  (F(clog)) (complex TYPE x)
    1150  {
    1151    ++ccount;
    1152    P ();
    1153    return x;
    1154  }
    1155  
    1156  complex TYPE
    1157  (F(csqrt)) (complex TYPE x)
    1158  {
    1159    ++ccount;
    1160    P ();
    1161    return x;
    1162  }
    1163  
    1164  complex TYPE
    1165  (F(cpow)) (complex TYPE x, complex TYPE y)
    1166  {
    1167    ++ccount;
    1168    P ();
    1169    return x + y;
    1170  }
    1171  
    1172  TYPE
    1173  (F(cabs)) (complex TYPE x)
    1174  {
    1175    ++ccount;
    1176    P ();
    1177    return x;
    1178  }
    1179  
    1180  TYPE
    1181  (F(carg)) (complex TYPE x)
    1182  {
    1183    ++ccount;
    1184    P ();
    1185    return x;
    1186  }
    1187  
    1188  TYPE
    1189  (F(creal)) (complex TYPE x)
    1190  {
    1191    ++ccount;
    1192    P ();
    1193    return __real__ x;
    1194  }
    1195  
    1196  TYPE
    1197  (F(cimag)) (complex TYPE x)
    1198  {
    1199    ++ccount;
    1200    P ();
    1201    return __imag__ x;
    1202  }
    1203  
    1204  complex TYPE
    1205  (F(conj)) (complex TYPE x)
    1206  {
    1207    ++ccount;
    1208    P ();
    1209    return x;
    1210  }
    1211  
    1212  complex TYPE
    1213  (F(cproj)) (complex TYPE x)
    1214  {
    1215    ++ccount;
    1216    P ();
    1217    return x;
    1218  }
    1219  
    1220  #undef F
    1221  #undef TYPE
    1222  #undef count
    1223  #undef ccount
    1224  #undef TEST_INT
    1225  #endif