test-tgmath.c 15 KB

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