xref: /netbsd-src/tests/lib/libm/t_exp.c (revision 96fc3e30a7c3f7bba53384bf41dad5f78306fac4)
1 /* $NetBSD: t_exp.c,v 1.2 2012/05/30 15:14:10 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 /* y = exp(x) */
36 static const struct {
37 	double x;
38 	double y;
39 } exp_values[] = {
40 	{  -10, 0.4539992976248485e-4, },
41 	{   -5, 0.6737946999085467e-2, },
42 	{   -1, 0.3678794411714423, },
43 	{ -0.1, 0.9048374180359595, },
44 	{    0, 1.0000000000000000, },
45 	{  0.1, 1.1051709180756477, },
46 	{    1, 2.7182818284590452, },
47 	{    5, 148.41315910257660, },
48 	{   10, 22026.465794806718, },
49 };
50 
51 /*
52  * exp2(3)
53  */
54 ATF_TC(exp2_nan);
55 ATF_TC_HEAD(exp2_nan, tc)
56 {
57 	atf_tc_set_md_var(tc, "descr", "Test exp2(NaN) == NaN");
58 }
59 
60 ATF_TC_BODY(exp2_nan, tc)
61 {
62 #ifndef __vax__
63 	const double x = 0.0L / 0.0L;
64 
65 	if (isnan(exp2(x)) == 0)
66 		atf_tc_fail_nonfatal("exp2(NaN) != NaN");
67 #endif
68 }
69 
70 ATF_TC(exp2_inf_neg);
71 ATF_TC_HEAD(exp2_inf_neg, tc)
72 {
73 	atf_tc_set_md_var(tc, "descr", "Test exp2(-Inf) == +0.0");
74 }
75 
76 ATF_TC_BODY(exp2_inf_neg, tc)
77 {
78 #ifndef __vax__
79 	const double x = -1.0L / 0.0L;
80 	double y = exp2(x);
81 
82 	if (fabs(y) > 0.0 || signbit(y) != 0)
83 		atf_tc_fail_nonfatal("exp2(-Inf) != +0.0");
84 #endif
85 }
86 
87 ATF_TC(exp2_inf_pos);
88 ATF_TC_HEAD(exp2_inf_pos, tc)
89 {
90 	atf_tc_set_md_var(tc, "descr", "Test exp2(+Inf) == +Inf");
91 }
92 
93 ATF_TC_BODY(exp2_inf_pos, tc)
94 {
95 #ifndef __vax__
96 	const double x = 1.0L / 0.0L;
97 	double y = exp2(x);
98 
99 	if (isinf(y) == 0 || signbit(y) != 0)
100 		atf_tc_fail_nonfatal("exp2(+Inf) != +Inf");
101 #endif
102 }
103 
104 ATF_TC(exp2_product);
105 ATF_TC_HEAD(exp2_product, tc)
106 {
107 	atf_tc_set_md_var(tc, "descr", "Test exp2(x + y) == exp2(x) * exp2(y)");
108 }
109 
110 ATF_TC_BODY(exp2_product, tc)
111 {
112 #ifndef __vax__
113 	const double x[] = { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 };
114 	const double y[] = { 8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1, 0.0 };
115 	const double eps = 1.0e-11;
116 	size_t i;
117 
118 	for (i = 0; i < __arraycount(x); i++) {
119 
120 		if (fabs(exp2(x[i] + y[i]) - (exp2(x[i]) * exp2(y[i]))) > eps)
121 			atf_tc_fail_nonfatal("exp2(%0.01f + %0.01f) != exp2("
122 			    "%0.01f) * exp2(%0.01f)", x[i], y[i], x[i], y[i]);
123 	}
124 #endif
125 }
126 
127 ATF_TC(exp2_zero_neg);
128 ATF_TC_HEAD(exp2_zero_neg, tc)
129 {
130 	atf_tc_set_md_var(tc, "descr", "Test exp2(-0.0) == 1.0");
131 }
132 
133 ATF_TC_BODY(exp2_zero_neg, 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 ATF_TC(exp2_zero_pos);
144 ATF_TC_HEAD(exp2_zero_pos, tc)
145 {
146 	atf_tc_set_md_var(tc, "descr", "Test exp2(+0.0) == 1.0");
147 }
148 
149 ATF_TC_BODY(exp2_zero_pos, tc)
150 {
151 #ifndef __vax__
152 	const double x = 0.0L;
153 
154 	if (fabs(exp2(x) - 1.0) > 0.0)
155 		atf_tc_fail_nonfatal("exp2(+0.0) != 1.0");
156 #endif
157 }
158 
159 /*
160  * exp2f(3)
161  */
162 ATF_TC(exp2f_nan);
163 ATF_TC_HEAD(exp2f_nan, tc)
164 {
165 	atf_tc_set_md_var(tc, "descr", "Test exp2f(NaN) == NaN");
166 }
167 
168 ATF_TC_BODY(exp2f_nan, tc)
169 {
170 #ifndef __vax__
171 	const float x = 0.0L / 0.0L;
172 
173 	if (isnan(exp2f(x)) == 0)
174 		atf_tc_fail_nonfatal("exp2f(NaN) != NaN");
175 #endif
176 }
177 
178 ATF_TC(exp2f_inf_neg);
179 ATF_TC_HEAD(exp2f_inf_neg, tc)
180 {
181 	atf_tc_set_md_var(tc, "descr", "Test exp2f(-Inf) == +0.0");
182 }
183 
184 ATF_TC_BODY(exp2f_inf_neg, tc)
185 {
186 #ifndef __vax__
187 	const float x = -1.0L / 0.0L;
188 	float y = exp2f(x);
189 
190 	if (fabsf(y) > 0.0 || signbit(y) != 0)
191 		atf_tc_fail_nonfatal("exp2f(-Inf) != +0.0");
192 #endif
193 }
194 
195 ATF_TC(exp2f_inf_pos);
196 ATF_TC_HEAD(exp2f_inf_pos, tc)
197 {
198 	atf_tc_set_md_var(tc, "descr", "Test exp2f(+Inf) == +Inf");
199 }
200 
201 ATF_TC_BODY(exp2f_inf_pos, tc)
202 {
203 #ifndef __vax__
204 	const float x = 1.0L / 0.0L;
205 	float y = exp2f(x);
206 
207 	if (isinf(y) == 0 || signbit(y) != 0)
208 		atf_tc_fail_nonfatal("exp2f(+Inf) != +Inf");
209 #endif
210 }
211 
212 ATF_TC(exp2f_product);
213 ATF_TC_HEAD(exp2f_product, tc)
214 {
215 	atf_tc_set_md_var(tc, "descr", "Test exp2f(x+y) == exp2f(x) * exp2f(y)");
216 }
217 
218 ATF_TC_BODY(exp2f_product, tc)
219 {
220 #ifndef __vax__
221 	const float x[] = { 0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8 };
222 	const float y[] = { 8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1, 0.0 };
223 	const float eps = 1.0e-2;
224 	size_t i;
225 
226 	for (i = 0; i < __arraycount(x); i++) {
227 
228 		if (fabsf(exp2f(x[i] + y[i]) -
229 			(exp2f(x[i]) * exp2f(y[i]))) > eps)
230 			atf_tc_fail_nonfatal("exp2f(%0.01f + %0.01f) != exp2f("
231 			    "%0.01f) * exp2f(%0.01f)", x[i], y[i], x[i], y[i]);
232 	}
233 #endif
234 }
235 
236 ATF_TC(exp2f_zero_neg);
237 ATF_TC_HEAD(exp2f_zero_neg, tc)
238 {
239 	atf_tc_set_md_var(tc, "descr", "Test exp2f(-0.0) == 1.0");
240 }
241 
242 ATF_TC_BODY(exp2f_zero_neg, 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 ATF_TC(exp2f_zero_pos);
253 ATF_TC_HEAD(exp2f_zero_pos, tc)
254 {
255 	atf_tc_set_md_var(tc, "descr", "Test exp2f(+0.0) == 1.0");
256 }
257 
258 ATF_TC_BODY(exp2f_zero_pos, tc)
259 {
260 #ifndef __vax__
261 	const float x = 0.0L;
262 
263 	if (fabsf(exp2f(x) - 1.0) > 0.0)
264 		atf_tc_fail_nonfatal("exp2f(+0.0) != 1.0");
265 #endif
266 }
267 
268 /*
269  * exp(3)
270  */
271 ATF_TC(exp_nan);
272 ATF_TC_HEAD(exp_nan, tc)
273 {
274 	atf_tc_set_md_var(tc, "descr", "Test exp(NaN) == NaN");
275 }
276 
277 ATF_TC_BODY(exp_nan, tc)
278 {
279 #ifndef __vax__
280 	const double x = 0.0L / 0.0L;
281 
282 	if (isnan(exp(x)) == 0)
283 		atf_tc_fail_nonfatal("exp(NaN) != NaN");
284 #endif
285 }
286 
287 ATF_TC(exp_inf_neg);
288 ATF_TC_HEAD(exp_inf_neg, tc)
289 {
290 	atf_tc_set_md_var(tc, "descr", "Test exp(-Inf) == +0.0");
291 }
292 
293 ATF_TC_BODY(exp_inf_neg, tc)
294 {
295 #ifndef __vax__
296 	const double x = -1.0L / 0.0L;
297 	double y = exp(x);
298 
299 	if (fabs(y) > 0.0 || signbit(y) != 0)
300 		atf_tc_fail_nonfatal("exp(-Inf) != +0.0");
301 #endif
302 }
303 
304 ATF_TC(exp_inf_pos);
305 ATF_TC_HEAD(exp_inf_pos, tc)
306 {
307 	atf_tc_set_md_var(tc, "descr", "Test exp(+Inf) == +Inf");
308 }
309 
310 ATF_TC_BODY(exp_inf_pos, tc)
311 {
312 #ifndef __vax__
313 	const double x = 1.0L / 0.0L;
314 	double y = exp(x);
315 
316 	if (isinf(y) == 0 || signbit(y) != 0)
317 		atf_tc_fail_nonfatal("exp(+Inf) != +Inf");
318 #endif
319 }
320 
321 ATF_TC(exp_product);
322 ATF_TC_HEAD(exp_product, tc)
323 {
324 	atf_tc_set_md_var(tc, "descr", "Test some selected exp(x)");
325 }
326 
327 ATF_TC_BODY(exp_product, tc)
328 {
329 #ifndef __vax__
330 	double x;
331 	double y;
332 	const double eps = 1.0e-11;
333 	size_t i;
334 
335 	for (i = 0; i < __arraycount(exp_values); i++) {
336 		x = exp_values[i].x;
337 		y = exp_values[i].y;
338 
339 		if (fabs(exp(x) - y) > eps)
340 			atf_tc_fail_nonfatal("exp(%0.01f) != %18.18e", x, y);
341 	}
342 #endif
343 }
344 
345 ATF_TC(exp_zero_neg);
346 ATF_TC_HEAD(exp_zero_neg, tc)
347 {
348 	atf_tc_set_md_var(tc, "descr", "Test exp(-0.0) == 1.0");
349 }
350 
351 ATF_TC_BODY(exp_zero_neg, tc)
352 {
353 #ifndef __vax__
354 	const double x = -0.0L;
355 
356 	if (fabs(exp(x) - 1.0) > 0.0)
357 		atf_tc_fail_nonfatal("exp(-0.0) != 1.0");
358 #endif
359 }
360 
361 ATF_TC(exp_zero_pos);
362 ATF_TC_HEAD(exp_zero_pos, tc)
363 {
364 	atf_tc_set_md_var(tc, "descr", "Test exp(+0.0) == 1.0");
365 }
366 
367 ATF_TC_BODY(exp_zero_pos, tc)
368 {
369 #ifndef __vax__
370 	const double x = 0.0L;
371 
372 	if (fabs(exp(x) - 1.0) > 0.0)
373 		atf_tc_fail_nonfatal("exp(+0.0) != 1.0");
374 #endif
375 }
376 
377 /*
378  * expf(3)
379  */
380 ATF_TC(expf_nan);
381 ATF_TC_HEAD(expf_nan, tc)
382 {
383 	atf_tc_set_md_var(tc, "descr", "Test expf(NaN) == NaN");
384 }
385 
386 ATF_TC_BODY(expf_nan, tc)
387 {
388 #ifndef __vax__
389 	const float x = 0.0L / 0.0L;
390 
391 	if (isnan(expf(x)) == 0)
392 		atf_tc_fail_nonfatal("expf(NaN) != NaN");
393 #endif
394 }
395 
396 ATF_TC(expf_inf_neg);
397 ATF_TC_HEAD(expf_inf_neg, tc)
398 {
399 	atf_tc_set_md_var(tc, "descr", "Test expf(-Inf) == +0.0");
400 }
401 
402 ATF_TC_BODY(expf_inf_neg, tc)
403 {
404 #ifndef __vax__
405 	const float x = -1.0L / 0.0L;
406 	float y = expf(x);
407 
408 	if (fabsf(y) > 0.0 || signbit(y) != 0)
409 		atf_tc_fail_nonfatal("expf(-Inf) != +0.0");
410 #endif
411 }
412 
413 ATF_TC(expf_inf_pos);
414 ATF_TC_HEAD(expf_inf_pos, tc)
415 {
416 	atf_tc_set_md_var(tc, "descr", "Test expf(+Inf) == +Inf");
417 }
418 
419 ATF_TC_BODY(expf_inf_pos, tc)
420 {
421 #ifndef __vax__
422 	const float x = 1.0L / 0.0L;
423 	float y = expf(x);
424 
425 	if (isinf(y) == 0 || signbit(y) != 0)
426 		atf_tc_fail_nonfatal("expf(+Inf) != +Inf");
427 #endif
428 }
429 
430 ATF_TC(expf_product);
431 ATF_TC_HEAD(expf_product, tc)
432 {
433 	atf_tc_set_md_var(tc, "descr", "Test some selected expf(x)");
434 }
435 
436 ATF_TC_BODY(expf_product, tc)
437 {
438 #ifndef __vax__
439 	float x;
440 	float y;
441 	const float eps = 1.0e-2;
442 	size_t i;
443 
444 	for (i = 0; i < __arraycount(exp_values); i++) {
445 		x = exp_values[i].x;
446 		y = exp_values[i].y;
447 
448 		if (fabsf(expf(x) - y) > eps)
449 			atf_tc_fail_nonfatal("expf(%0.01f) != %18.18e", x, y);
450 	}
451 #endif
452 }
453 
454 ATF_TC(expf_zero_neg);
455 ATF_TC_HEAD(expf_zero_neg, tc)
456 {
457 	atf_tc_set_md_var(tc, "descr", "Test expf(-0.0) == 1.0");
458 }
459 
460 ATF_TC_BODY(expf_zero_neg, tc)
461 {
462 #ifndef __vax__
463 	const float x = -0.0L;
464 
465 	if (fabsf(expf(x) - 1.0) > 0.0)
466 		atf_tc_fail_nonfatal("expf(-0.0) != 1.0");
467 #endif
468 }
469 
470 ATF_TC(expf_zero_pos);
471 ATF_TC_HEAD(expf_zero_pos, tc)
472 {
473 	atf_tc_set_md_var(tc, "descr", "Test expf(+0.0) == 1.0");
474 }
475 
476 ATF_TC_BODY(expf_zero_pos, tc)
477 {
478 #ifndef __vax__
479 	const float x = 0.0L;
480 
481 	if (fabsf(expf(x) - 1.0) > 0.0)
482 		atf_tc_fail_nonfatal("expf(+0.0) != 1.0");
483 #endif
484 }
485 
486 /*
487  * expm1(3)
488  */
489 ATF_TC(expm1_nan);
490 ATF_TC_HEAD(expm1_nan, tc)
491 {
492 	atf_tc_set_md_var(tc, "descr", "Test expm1(NaN) == NaN");
493 }
494 
495 ATF_TC_BODY(expm1_nan, tc)
496 {
497 #ifndef __vax__
498 	const double x = 0.0L / 0.0L;
499 
500 	if (isnan(expm1(x)) == 0)
501 		atf_tc_fail_nonfatal("expm1(NaN) != NaN");
502 #endif
503 }
504 
505 ATF_TC(expm1_inf_neg);
506 ATF_TC_HEAD(expm1_inf_neg, tc)
507 {
508 	atf_tc_set_md_var(tc, "descr", "Test expm1(-Inf) == -1");
509 }
510 
511 ATF_TC_BODY(expm1_inf_neg, tc)
512 {
513 #ifndef __vax__
514 	const double x = -1.0L / 0.0L;
515 
516 	if (expm1(x) != -1.0)
517 		atf_tc_fail_nonfatal("expm1(-Inf) != -1.0");
518 #endif
519 }
520 
521 ATF_TC(expm1_inf_pos);
522 ATF_TC_HEAD(expm1_inf_pos, tc)
523 {
524 	atf_tc_set_md_var(tc, "descr", "Test expm1(+Inf) == +Inf");
525 }
526 
527 ATF_TC_BODY(expm1_inf_pos, tc)
528 {
529 #ifndef __vax__
530 	const double x = 1.0L / 0.0L;
531 	double y = expm1(x);
532 
533 	if (isinf(y) == 0 || signbit(y) != 0)
534 		atf_tc_fail_nonfatal("expm1(+Inf) != +Inf");
535 #endif
536 }
537 
538 ATF_TC(expm1_zero_neg);
539 ATF_TC_HEAD(expm1_zero_neg, tc)
540 {
541 	atf_tc_set_md_var(tc, "descr", "Test expm1(-0.0) == -0.0");
542 }
543 
544 ATF_TC_BODY(expm1_zero_neg, tc)
545 {
546 #ifndef __vax__
547 	const double x = -0.0L;
548 	double y = expm1(x);
549 
550 	if (fabs(y) > 0.0 || signbit(y) == 0)
551 		atf_tc_fail_nonfatal("expm1(-0.0) != -0.0");
552 #endif
553 }
554 
555 ATF_TC(expm1_zero_pos);
556 ATF_TC_HEAD(expm1_zero_pos, tc)
557 {
558 	atf_tc_set_md_var(tc, "descr", "Test expm1(+0.0) == 1.0");
559 }
560 
561 ATF_TC_BODY(expm1_zero_pos, tc)
562 {
563 #ifndef __vax__
564 	const double x = 0.0L;
565 	double y = expm1(x);
566 
567 	if (fabs(y) > 0.0 || signbit(y) != 0)
568 		atf_tc_fail_nonfatal("expm1(+0.0) != +0.0");
569 #endif
570 }
571 
572 /*
573  * expm1f(3)
574  */
575 ATF_TC(expm1f_nan);
576 ATF_TC_HEAD(expm1f_nan, tc)
577 {
578 	atf_tc_set_md_var(tc, "descr", "Test expm1f(NaN) == NaN");
579 }
580 
581 ATF_TC_BODY(expm1f_nan, tc)
582 {
583 #ifndef __vax__
584 	const float x = 0.0L / 0.0L;
585 
586 	if (isnan(expm1f(x)) == 0)
587 		atf_tc_fail_nonfatal("expm1f(NaN) != NaN");
588 #endif
589 }
590 
591 ATF_TC(expm1f_inf_neg);
592 ATF_TC_HEAD(expm1f_inf_neg, tc)
593 {
594 	atf_tc_set_md_var(tc, "descr", "Test expm1f(-Inf) == -1");
595 }
596 
597 ATF_TC_BODY(expm1f_inf_neg, tc)
598 {
599 #ifndef __vax__
600 	const float x = -1.0L / 0.0L;
601 
602 	if (expm1f(x) != -1.0)
603 		atf_tc_fail_nonfatal("expm1f(-Inf) != -1.0");
604 #endif
605 }
606 
607 ATF_TC(expm1f_inf_pos);
608 ATF_TC_HEAD(expm1f_inf_pos, tc)
609 {
610 	atf_tc_set_md_var(tc, "descr", "Test expm1f(+Inf) == +Inf");
611 }
612 
613 ATF_TC_BODY(expm1f_inf_pos, tc)
614 {
615 #ifndef __vax__
616 	const float x = 1.0L / 0.0L;
617 	float y = expm1f(x);
618 
619 	if (isinf(y) == 0 || signbit(y) != 0)
620 		atf_tc_fail_nonfatal("expm1f(+Inf) != +Inf");
621 #endif
622 }
623 
624 ATF_TC(expm1f_zero_neg);
625 ATF_TC_HEAD(expm1f_zero_neg, tc)
626 {
627 	atf_tc_set_md_var(tc, "descr", "Test expm1f(-0.0) == -0.0");
628 }
629 
630 ATF_TC_BODY(expm1f_zero_neg, tc)
631 {
632 #ifndef __vax__
633 	const float x = -0.0L;
634 	float y = expm1f(x);
635 
636 	if (fabsf(y) > 0.0 || signbit(y) == 0)
637 		atf_tc_fail_nonfatal("expm1f(-0.0) != -0.0");
638 #endif
639 }
640 
641 ATF_TC(expm1f_zero_pos);
642 ATF_TC_HEAD(expm1f_zero_pos, tc)
643 {
644 	atf_tc_set_md_var(tc, "descr", "Test expm1f(+0.0) == 1.0");
645 }
646 
647 ATF_TC_BODY(expm1f_zero_pos, tc)
648 {
649 #ifndef __vax__
650 	const float x = 0.0L;
651 	float y = expm1f(x);
652 
653 	if (fabsf(y) > 0.0 || signbit(y) != 0)
654 		atf_tc_fail_nonfatal("expm1f(+0.0) != +0.0");
655 #endif
656 }
657 
658 ATF_TP_ADD_TCS(tp)
659 {
660 
661 	ATF_TP_ADD_TC(tp, exp2_nan);
662 	ATF_TP_ADD_TC(tp, exp2_inf_neg);
663 	ATF_TP_ADD_TC(tp, exp2_inf_pos);
664 	ATF_TP_ADD_TC(tp, exp2_product);
665 	ATF_TP_ADD_TC(tp, exp2_zero_neg);
666 	ATF_TP_ADD_TC(tp, exp2_zero_pos);
667 
668 	ATF_TP_ADD_TC(tp, exp2f_nan);
669 	ATF_TP_ADD_TC(tp, exp2f_inf_neg);
670 	ATF_TP_ADD_TC(tp, exp2f_inf_pos);
671 	ATF_TP_ADD_TC(tp, exp2f_product);
672 	ATF_TP_ADD_TC(tp, exp2f_zero_neg);
673 	ATF_TP_ADD_TC(tp, exp2f_zero_pos);
674 
675 	ATF_TP_ADD_TC(tp, exp_nan);
676 	ATF_TP_ADD_TC(tp, exp_inf_neg);
677 	ATF_TP_ADD_TC(tp, exp_inf_pos);
678 	ATF_TP_ADD_TC(tp, exp_product);
679 	ATF_TP_ADD_TC(tp, exp_zero_neg);
680 	ATF_TP_ADD_TC(tp, exp_zero_pos);
681 
682 	ATF_TP_ADD_TC(tp, expf_nan);
683 	ATF_TP_ADD_TC(tp, expf_inf_neg);
684 	ATF_TP_ADD_TC(tp, expf_inf_pos);
685 	ATF_TP_ADD_TC(tp, expf_product);
686 	ATF_TP_ADD_TC(tp, expf_zero_neg);
687 	ATF_TP_ADD_TC(tp, expf_zero_pos);
688 
689 	ATF_TP_ADD_TC(tp, expm1_nan);
690 	ATF_TP_ADD_TC(tp, expm1_inf_neg);
691 	ATF_TP_ADD_TC(tp, expm1_inf_pos);
692 	ATF_TP_ADD_TC(tp, expm1_zero_neg);
693 	ATF_TP_ADD_TC(tp, expm1_zero_pos);
694 
695 	ATF_TP_ADD_TC(tp, expm1f_nan);
696 	ATF_TP_ADD_TC(tp, expm1f_inf_neg);
697 	ATF_TP_ADD_TC(tp, expm1f_inf_pos);
698 	ATF_TP_ADD_TC(tp, expm1f_zero_neg);
699 	ATF_TP_ADD_TC(tp, expm1f_zero_pos);
700 
701 	return atf_no_error();
702 }
703