test-tgmath.c 17 KB

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