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