1 /* $NetBSD: t_exp.c,v 1.1 2011/09/18 05:19:18 jruoho Exp $ */ 2 3 /*- 4 * Copyright (c) 2011 The NetBSD Foundation, Inc. 5 * All rights reserved. 6 * 7 * This code is derived from software contributed to The NetBSD Foundation 8 * by Jukka Ruohonen. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31 32 #include <atf-c.h> 33 #include <math.h> 34 35 /* 36 * exp2(3) 37 */ 38 ATF_TC(exp2_nan); 39 ATF_TC_HEAD(exp2_nan, tc) 40 { 41 atf_tc_set_md_var(tc, "descr", "Test exp2(NaN) == NaN"); 42 } 43 44 ATF_TC_BODY(exp2_nan, tc) 45 { 46 #ifndef __vax__ 47 const double x = 0.0L / 0.0L; 48 49 if (isnan(exp2(x)) == 0) 50 atf_tc_fail_nonfatal("exp2(NaN) != NaN"); 51 #endif 52 } 53 54 ATF_TC(exp2_inf_neg); 55 ATF_TC_HEAD(exp2_inf_neg, tc) 56 { 57 atf_tc_set_md_var(tc, "descr", "Test exp2(-Inf) == +0.0"); 58 } 59 60 ATF_TC_BODY(exp2_inf_neg, tc) 61 { 62 #ifndef __vax__ 63 const double x = -1.0L / 0.0L; 64 double y = exp2(x); 65 66 if (fabs(y) > 0.0 || signbit(y) != 0) 67 atf_tc_fail_nonfatal("exp2(-Inf) != +0.0"); 68 #endif 69 } 70 71 ATF_TC(exp2_inf_pos); 72 ATF_TC_HEAD(exp2_inf_pos, tc) 73 { 74 atf_tc_set_md_var(tc, "descr", "Test exp2(+Inf) == +Inf"); 75 } 76 77 ATF_TC_BODY(exp2_inf_pos, tc) 78 { 79 #ifndef __vax__ 80 const double x = 1.0L / 0.0L; 81 double y = exp2(x); 82 83 if (isinf(y) == 0 || signbit(y) != 0) 84 atf_tc_fail_nonfatal("exp2(+Inf) != +Inf"); 85 #endif 86 } 87 88 ATF_TC(exp2_product); 89 ATF_TC_HEAD(exp2_product, tc) 90 { 91 atf_tc_set_md_var(tc, "descr", "Test exp2(x + y) == exp2(x) * exp2(y)"); 92 } 93 94 ATF_TC_BODY(exp2_product, tc) 95 { 96 #ifndef __vax__ 97 const double x[] = { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 }; 98 const double y[] = { 8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1, 0.0 }; 99 const double eps = 1.0e-11; 100 size_t i; 101 102 for (i = 0; i < __arraycount(x); i++) { 103 104 if (fabs(exp2(x[i] + y[i]) - (exp2(x[i]) * exp2(y[i]))) > eps) 105 atf_tc_fail_nonfatal("exp2(%0.01f + %0.01f) != exp2(" 106 "%0.01f) * exp2(%0.01f)", x[i], y[i], x[i], y[i]); 107 } 108 #endif 109 } 110 111 ATF_TC(exp2_zero_neg); 112 ATF_TC_HEAD(exp2_zero_neg, tc) 113 { 114 atf_tc_set_md_var(tc, "descr", "Test exp2(-0.0) == 1.0"); 115 } 116 117 ATF_TC_BODY(exp2_zero_neg, tc) 118 { 119 #ifndef __vax__ 120 const double x = -0.0L; 121 122 if (fabs(exp2(x) - 1.0) > 0.0) 123 atf_tc_fail_nonfatal("exp2(-0.0) != 1.0"); 124 #endif 125 } 126 127 ATF_TC(exp2_zero_pos); 128 ATF_TC_HEAD(exp2_zero_pos, tc) 129 { 130 atf_tc_set_md_var(tc, "descr", "Test exp2(+0.0) == 1.0"); 131 } 132 133 ATF_TC_BODY(exp2_zero_pos, tc) 134 { 135 #ifndef __vax__ 136 const double x = 0.0L; 137 138 if (fabs(exp2(x) - 1.0) > 0.0) 139 atf_tc_fail_nonfatal("exp2(+0.0) != 1.0"); 140 #endif 141 } 142 143 /* 144 * exp2f(3) 145 */ 146 ATF_TC(exp2f_nan); 147 ATF_TC_HEAD(exp2f_nan, tc) 148 { 149 atf_tc_set_md_var(tc, "descr", "Test exp2f(NaN) == NaN"); 150 } 151 152 ATF_TC_BODY(exp2f_nan, tc) 153 { 154 #ifndef __vax__ 155 const float x = 0.0L / 0.0L; 156 157 if (isnan(exp2f(x)) == 0) 158 atf_tc_fail_nonfatal("exp2f(NaN) != NaN"); 159 #endif 160 } 161 162 ATF_TC(exp2f_inf_neg); 163 ATF_TC_HEAD(exp2f_inf_neg, tc) 164 { 165 atf_tc_set_md_var(tc, "descr", "Test exp2f(-Inf) == +0.0"); 166 } 167 168 ATF_TC_BODY(exp2f_inf_neg, tc) 169 { 170 #ifndef __vax__ 171 const float x = -1.0L / 0.0L; 172 float y = exp2f(x); 173 174 if (fabsf(y) > 0.0 || signbit(y) != 0) 175 atf_tc_fail_nonfatal("exp2f(-Inf) != +0.0"); 176 #endif 177 } 178 179 ATF_TC(exp2f_inf_pos); 180 ATF_TC_HEAD(exp2f_inf_pos, tc) 181 { 182 atf_tc_set_md_var(tc, "descr", "Test exp2f(+Inf) == +Inf"); 183 } 184 185 ATF_TC_BODY(exp2f_inf_pos, tc) 186 { 187 #ifndef __vax__ 188 const float x = 1.0L / 0.0L; 189 float y = exp2f(x); 190 191 if (isinf(y) == 0 || signbit(y) != 0) 192 atf_tc_fail_nonfatal("exp2f(+Inf) != +Inf"); 193 #endif 194 } 195 196 ATF_TC(exp2f_product); 197 ATF_TC_HEAD(exp2f_product, tc) 198 { 199 atf_tc_set_md_var(tc, "descr", "Test exp2f(x+y) == exp2f(x) * exp2f(y)"); 200 } 201 202 ATF_TC_BODY(exp2f_product, tc) 203 { 204 #ifndef __vax__ 205 const float x[] = { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 }; 206 const float y[] = { 8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1, 0.0 }; 207 const float eps = 1.0e-2; 208 size_t i; 209 210 for (i = 0; i < __arraycount(x); i++) { 211 212 if (fabsf(exp2f(x[i] + y[i]) - 213 (exp2f(x[i]) * exp2f(y[i]))) > eps) 214 atf_tc_fail_nonfatal("exp2f(%0.01f + %0.01f) != exp2f(" 215 "%0.01f) * exp2f(%0.01f)", x[i], y[i], x[i], y[i]); 216 } 217 #endif 218 } 219 220 ATF_TC(exp2f_zero_neg); 221 ATF_TC_HEAD(exp2f_zero_neg, tc) 222 { 223 atf_tc_set_md_var(tc, "descr", "Test exp2f(-0.0) == 1.0"); 224 } 225 226 ATF_TC_BODY(exp2f_zero_neg, tc) 227 { 228 #ifndef __vax__ 229 const float x = -0.0L; 230 231 if (fabsf(exp2f(x) - 1.0) > 0.0) 232 atf_tc_fail_nonfatal("exp2f(-0.0) != 1.0"); 233 #endif 234 } 235 236 ATF_TC(exp2f_zero_pos); 237 ATF_TC_HEAD(exp2f_zero_pos, tc) 238 { 239 atf_tc_set_md_var(tc, "descr", "Test exp2f(+0.0) == 1.0"); 240 } 241 242 ATF_TC_BODY(exp2f_zero_pos, tc) 243 { 244 #ifndef __vax__ 245 const float x = 0.0L; 246 247 if (fabsf(exp2f(x) - 1.0) > 0.0) 248 atf_tc_fail_nonfatal("exp2f(+0.0) != 1.0"); 249 #endif 250 } 251 252 /* 253 * exp(3) 254 */ 255 ATF_TC(exp_nan); 256 ATF_TC_HEAD(exp_nan, tc) 257 { 258 atf_tc_set_md_var(tc, "descr", "Test exp(NaN) == NaN"); 259 } 260 261 ATF_TC_BODY(exp_nan, tc) 262 { 263 #ifndef __vax__ 264 const double x = 0.0L / 0.0L; 265 266 if (isnan(exp(x)) == 0) 267 atf_tc_fail_nonfatal("exp(NaN) != NaN"); 268 #endif 269 } 270 271 ATF_TC(exp_inf_neg); 272 ATF_TC_HEAD(exp_inf_neg, tc) 273 { 274 atf_tc_set_md_var(tc, "descr", "Test exp(-Inf) == +0.0"); 275 } 276 277 ATF_TC_BODY(exp_inf_neg, tc) 278 { 279 #ifndef __vax__ 280 const double x = -1.0L / 0.0L; 281 double y = exp(x); 282 283 if (fabs(y) > 0.0 || signbit(y) != 0) 284 atf_tc_fail_nonfatal("exp(-Inf) != +0.0"); 285 #endif 286 } 287 288 ATF_TC(exp_inf_pos); 289 ATF_TC_HEAD(exp_inf_pos, tc) 290 { 291 atf_tc_set_md_var(tc, "descr", "Test exp(+Inf) == +Inf"); 292 } 293 294 ATF_TC_BODY(exp_inf_pos, tc) 295 { 296 #ifndef __vax__ 297 const double x = 1.0L / 0.0L; 298 double y = exp(x); 299 300 if (isinf(y) == 0 || signbit(y) != 0) 301 atf_tc_fail_nonfatal("exp(+Inf) != +Inf"); 302 #endif 303 } 304 305 ATF_TC(exp_product); 306 ATF_TC_HEAD(exp_product, tc) 307 { 308 atf_tc_set_md_var(tc, "descr", "Test exp(x + y) == exp(x) * exp(y)"); 309 } 310 311 ATF_TC_BODY(exp_product, tc) 312 { 313 #ifndef __vax__ 314 const double x[] = { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 }; 315 const double y[] = { 8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1, 0.0 }; 316 const double eps = 1.0e-11; 317 size_t i; 318 319 for (i = 0; i < __arraycount(x); i++) { 320 321 if (fabs(exp(x[i] + y[i]) - (exp(x[i]) * exp(y[i]))) > eps) 322 atf_tc_fail_nonfatal("exp(%0.01f + %0.01f) != exp(" 323 "%0.01f) * exp(%0.01f)", x[i], y[i], x[i], y[i]); 324 } 325 #endif 326 } 327 328 ATF_TC(exp_zero_neg); 329 ATF_TC_HEAD(exp_zero_neg, tc) 330 { 331 atf_tc_set_md_var(tc, "descr", "Test exp(-0.0) == 1.0"); 332 } 333 334 ATF_TC_BODY(exp_zero_neg, tc) 335 { 336 #ifndef __vax__ 337 const double x = -0.0L; 338 339 if (fabs(exp(x) - 1.0) > 0.0) 340 atf_tc_fail_nonfatal("exp(-0.0) != 1.0"); 341 #endif 342 } 343 344 ATF_TC(exp_zero_pos); 345 ATF_TC_HEAD(exp_zero_pos, tc) 346 { 347 atf_tc_set_md_var(tc, "descr", "Test exp(+0.0) == 1.0"); 348 } 349 350 ATF_TC_BODY(exp_zero_pos, tc) 351 { 352 #ifndef __vax__ 353 const double x = 0.0L; 354 355 if (fabs(exp(x) - 1.0) > 0.0) 356 atf_tc_fail_nonfatal("exp(+0.0) != 1.0"); 357 #endif 358 } 359 360 /* 361 * expf(3) 362 */ 363 ATF_TC(expf_nan); 364 ATF_TC_HEAD(expf_nan, tc) 365 { 366 atf_tc_set_md_var(tc, "descr", "Test expf(NaN) == NaN"); 367 } 368 369 ATF_TC_BODY(expf_nan, tc) 370 { 371 #ifndef __vax__ 372 const float x = 0.0L / 0.0L; 373 374 if (isnan(expf(x)) == 0) 375 atf_tc_fail_nonfatal("expf(NaN) != NaN"); 376 #endif 377 } 378 379 ATF_TC(expf_inf_neg); 380 ATF_TC_HEAD(expf_inf_neg, tc) 381 { 382 atf_tc_set_md_var(tc, "descr", "Test expf(-Inf) == +0.0"); 383 } 384 385 ATF_TC_BODY(expf_inf_neg, tc) 386 { 387 #ifndef __vax__ 388 const float x = -1.0L / 0.0L; 389 float y = expf(x); 390 391 if (fabsf(y) > 0.0 || signbit(y) != 0) 392 atf_tc_fail_nonfatal("expf(-Inf) != +0.0"); 393 #endif 394 } 395 396 ATF_TC(expf_inf_pos); 397 ATF_TC_HEAD(expf_inf_pos, tc) 398 { 399 atf_tc_set_md_var(tc, "descr", "Test expf(+Inf) == +Inf"); 400 } 401 402 ATF_TC_BODY(expf_inf_pos, tc) 403 { 404 #ifndef __vax__ 405 const float x = 1.0L / 0.0L; 406 float y = expf(x); 407 408 if (isinf(y) == 0 || signbit(y) != 0) 409 atf_tc_fail_nonfatal("expf(+Inf) != +Inf"); 410 #endif 411 } 412 413 ATF_TC(expf_product); 414 ATF_TC_HEAD(expf_product, tc) 415 { 416 atf_tc_set_md_var(tc, "descr", "Test expf(x+y) == expf(x) * expf(y)"); 417 } 418 419 ATF_TC_BODY(expf_product, tc) 420 { 421 #ifndef __vax__ 422 const float x[] = { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 }; 423 const float y[] = { 8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1, 0.0 }; 424 const float eps = 1.0e-2; 425 size_t i; 426 427 for (i = 0; i < __arraycount(x); i++) { 428 429 if (fabsf(expf(x[i] + y[i]) - (expf(x[i]) * expf(y[i]))) > eps) 430 atf_tc_fail_nonfatal("expf(%0.01f + %0.01f) != expf(" 431 "%0.01f) * expf(%0.01f)", x[i], y[i], x[i], y[i]); 432 } 433 #endif 434 } 435 436 ATF_TC(expf_zero_neg); 437 ATF_TC_HEAD(expf_zero_neg, tc) 438 { 439 atf_tc_set_md_var(tc, "descr", "Test expf(-0.0) == 1.0"); 440 } 441 442 ATF_TC_BODY(expf_zero_neg, tc) 443 { 444 #ifndef __vax__ 445 const float x = -0.0L; 446 447 if (fabsf(expf(x) - 1.0) > 0.0) 448 atf_tc_fail_nonfatal("expf(-0.0) != 1.0"); 449 #endif 450 } 451 452 ATF_TC(expf_zero_pos); 453 ATF_TC_HEAD(expf_zero_pos, tc) 454 { 455 atf_tc_set_md_var(tc, "descr", "Test expf(+0.0) == 1.0"); 456 } 457 458 ATF_TC_BODY(expf_zero_pos, tc) 459 { 460 #ifndef __vax__ 461 const float x = 0.0L; 462 463 if (fabsf(expf(x) - 1.0) > 0.0) 464 atf_tc_fail_nonfatal("expf(+0.0) != 1.0"); 465 #endif 466 } 467 468 /* 469 * expm1(3) 470 */ 471 ATF_TC(expm1_nan); 472 ATF_TC_HEAD(expm1_nan, tc) 473 { 474 atf_tc_set_md_var(tc, "descr", "Test expm1(NaN) == NaN"); 475 } 476 477 ATF_TC_BODY(expm1_nan, tc) 478 { 479 #ifndef __vax__ 480 const double x = 0.0L / 0.0L; 481 482 if (isnan(expm1(x)) == 0) 483 atf_tc_fail_nonfatal("expm1(NaN) != NaN"); 484 #endif 485 } 486 487 ATF_TC(expm1_inf_neg); 488 ATF_TC_HEAD(expm1_inf_neg, tc) 489 { 490 atf_tc_set_md_var(tc, "descr", "Test expm1(-Inf) == -1"); 491 } 492 493 ATF_TC_BODY(expm1_inf_neg, tc) 494 { 495 #ifndef __vax__ 496 const double x = -1.0L / 0.0L; 497 498 if (expm1(x) != -1.0) 499 atf_tc_fail_nonfatal("expm1(-Inf) != -1.0"); 500 #endif 501 } 502 503 ATF_TC(expm1_inf_pos); 504 ATF_TC_HEAD(expm1_inf_pos, tc) 505 { 506 atf_tc_set_md_var(tc, "descr", "Test expm1(+Inf) == +Inf"); 507 } 508 509 ATF_TC_BODY(expm1_inf_pos, tc) 510 { 511 #ifndef __vax__ 512 const double x = 1.0L / 0.0L; 513 double y = expm1(x); 514 515 if (isinf(y) == 0 || signbit(y) != 0) 516 atf_tc_fail_nonfatal("expm1(+Inf) != +Inf"); 517 #endif 518 } 519 520 ATF_TC(expm1_zero_neg); 521 ATF_TC_HEAD(expm1_zero_neg, tc) 522 { 523 atf_tc_set_md_var(tc, "descr", "Test expm1(-0.0) == -0.0"); 524 } 525 526 ATF_TC_BODY(expm1_zero_neg, tc) 527 { 528 #ifndef __vax__ 529 const double x = -0.0L; 530 double y = expm1(x); 531 532 if (fabs(y) > 0.0 || signbit(y) == 0) 533 atf_tc_fail_nonfatal("expm1(-0.0) != -0.0"); 534 #endif 535 } 536 537 ATF_TC(expm1_zero_pos); 538 ATF_TC_HEAD(expm1_zero_pos, tc) 539 { 540 atf_tc_set_md_var(tc, "descr", "Test expm1(+0.0) == 1.0"); 541 } 542 543 ATF_TC_BODY(expm1_zero_pos, tc) 544 { 545 #ifndef __vax__ 546 const double x = 0.0L; 547 double y = expm1(x); 548 549 if (fabs(y) > 0.0 || signbit(y) != 0) 550 atf_tc_fail_nonfatal("expm1(+0.0) != +0.0"); 551 #endif 552 } 553 554 /* 555 * expm1f(3) 556 */ 557 ATF_TC(expm1f_nan); 558 ATF_TC_HEAD(expm1f_nan, tc) 559 { 560 atf_tc_set_md_var(tc, "descr", "Test expm1f(NaN) == NaN"); 561 } 562 563 ATF_TC_BODY(expm1f_nan, tc) 564 { 565 #ifndef __vax__ 566 const float x = 0.0L / 0.0L; 567 568 if (isnan(expm1f(x)) == 0) 569 atf_tc_fail_nonfatal("expm1f(NaN) != NaN"); 570 #endif 571 } 572 573 ATF_TC(expm1f_inf_neg); 574 ATF_TC_HEAD(expm1f_inf_neg, tc) 575 { 576 atf_tc_set_md_var(tc, "descr", "Test expm1f(-Inf) == -1"); 577 } 578 579 ATF_TC_BODY(expm1f_inf_neg, tc) 580 { 581 #ifndef __vax__ 582 const float x = -1.0L / 0.0L; 583 584 if (expm1f(x) != -1.0) 585 atf_tc_fail_nonfatal("expm1f(-Inf) != -1.0"); 586 #endif 587 } 588 589 ATF_TC(expm1f_inf_pos); 590 ATF_TC_HEAD(expm1f_inf_pos, tc) 591 { 592 atf_tc_set_md_var(tc, "descr", "Test expm1f(+Inf) == +Inf"); 593 } 594 595 ATF_TC_BODY(expm1f_inf_pos, tc) 596 { 597 #ifndef __vax__ 598 const float x = 1.0L / 0.0L; 599 float y = expm1f(x); 600 601 if (isinf(y) == 0 || signbit(y) != 0) 602 atf_tc_fail_nonfatal("expm1f(+Inf) != +Inf"); 603 #endif 604 } 605 606 ATF_TC(expm1f_zero_neg); 607 ATF_TC_HEAD(expm1f_zero_neg, tc) 608 { 609 atf_tc_set_md_var(tc, "descr", "Test expm1f(-0.0) == -0.0"); 610 } 611 612 ATF_TC_BODY(expm1f_zero_neg, tc) 613 { 614 #ifndef __vax__ 615 const float x = -0.0L; 616 float y = expm1f(x); 617 618 if (fabsf(y) > 0.0 || signbit(y) == 0) 619 atf_tc_fail_nonfatal("expm1f(-0.0) != -0.0"); 620 #endif 621 } 622 623 ATF_TC(expm1f_zero_pos); 624 ATF_TC_HEAD(expm1f_zero_pos, tc) 625 { 626 atf_tc_set_md_var(tc, "descr", "Test expm1f(+0.0) == 1.0"); 627 } 628 629 ATF_TC_BODY(expm1f_zero_pos, tc) 630 { 631 #ifndef __vax__ 632 const float x = 0.0L; 633 float y = expm1f(x); 634 635 if (fabsf(y) > 0.0 || signbit(y) != 0) 636 atf_tc_fail_nonfatal("expm1f(+0.0) != +0.0"); 637 #endif 638 } 639 640 ATF_TP_ADD_TCS(tp) 641 { 642 643 ATF_TP_ADD_TC(tp, exp2_nan); 644 ATF_TP_ADD_TC(tp, exp2_inf_neg); 645 ATF_TP_ADD_TC(tp, exp2_inf_pos); 646 ATF_TP_ADD_TC(tp, exp2_product); 647 ATF_TP_ADD_TC(tp, exp2_zero_neg); 648 ATF_TP_ADD_TC(tp, exp2_zero_pos); 649 650 ATF_TP_ADD_TC(tp, exp2f_nan); 651 ATF_TP_ADD_TC(tp, exp2f_inf_neg); 652 ATF_TP_ADD_TC(tp, exp2f_inf_pos); 653 ATF_TP_ADD_TC(tp, exp2f_product); 654 ATF_TP_ADD_TC(tp, exp2f_zero_neg); 655 ATF_TP_ADD_TC(tp, exp2f_zero_pos); 656 657 ATF_TP_ADD_TC(tp, exp_nan); 658 ATF_TP_ADD_TC(tp, exp_inf_neg); 659 ATF_TP_ADD_TC(tp, exp_inf_pos); 660 ATF_TP_ADD_TC(tp, exp_product); 661 ATF_TP_ADD_TC(tp, exp_zero_neg); 662 ATF_TP_ADD_TC(tp, exp_zero_pos); 663 664 ATF_TP_ADD_TC(tp, expf_nan); 665 ATF_TP_ADD_TC(tp, expf_inf_neg); 666 ATF_TP_ADD_TC(tp, expf_inf_pos); 667 ATF_TP_ADD_TC(tp, expf_product); 668 ATF_TP_ADD_TC(tp, expf_zero_neg); 669 ATF_TP_ADD_TC(tp, expf_zero_pos); 670 671 ATF_TP_ADD_TC(tp, expm1_nan); 672 ATF_TP_ADD_TC(tp, expm1_inf_neg); 673 ATF_TP_ADD_TC(tp, expm1_inf_pos); 674 ATF_TP_ADD_TC(tp, expm1_zero_neg); 675 ATF_TP_ADD_TC(tp, expm1_zero_pos); 676 677 ATF_TP_ADD_TC(tp, expm1f_nan); 678 ATF_TP_ADD_TC(tp, expm1f_inf_neg); 679 ATF_TP_ADD_TC(tp, expm1f_inf_pos); 680 ATF_TP_ADD_TC(tp, expm1f_zero_neg); 681 ATF_TP_ADD_TC(tp, expm1f_zero_pos); 682 683 return atf_no_error(); 684 } 685