1*0a6a1f1dSLionel Sambuc /* $NetBSD: t_pow.c,v 1.4 2015/09/08 05:24:27 dholland Exp $ */
211be35a1SLionel Sambuc
311be35a1SLionel Sambuc /*-
411be35a1SLionel Sambuc * Copyright (c) 2011 The NetBSD Foundation, Inc.
511be35a1SLionel Sambuc * All rights reserved.
611be35a1SLionel Sambuc *
711be35a1SLionel Sambuc * This code is derived from software contributed to The NetBSD Foundation
811be35a1SLionel Sambuc * by Jukka Ruohonen.
911be35a1SLionel Sambuc *
1011be35a1SLionel Sambuc * Redistribution and use in source and binary forms, with or without
1111be35a1SLionel Sambuc * modification, are permitted provided that the following conditions
1211be35a1SLionel Sambuc * are met:
1311be35a1SLionel Sambuc * 1. Redistributions of source code must retain the above copyright
1411be35a1SLionel Sambuc * notice, this list of conditions and the following disclaimer.
1511be35a1SLionel Sambuc * 2. Redistributions in binary form must reproduce the above copyright
1611be35a1SLionel Sambuc * notice, this list of conditions and the following disclaimer in the
1711be35a1SLionel Sambuc * documentation and/or other materials provided with the distribution.
1811be35a1SLionel Sambuc *
1911be35a1SLionel Sambuc * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2011be35a1SLionel Sambuc * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2111be35a1SLionel Sambuc * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2211be35a1SLionel Sambuc * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2311be35a1SLionel Sambuc * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2411be35a1SLionel Sambuc * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2511be35a1SLionel Sambuc * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2611be35a1SLionel Sambuc * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2711be35a1SLionel Sambuc * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2811be35a1SLionel Sambuc * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2911be35a1SLionel Sambuc * POSSIBILITY OF SUCH DAMAGE.
3011be35a1SLionel Sambuc */
3111be35a1SLionel Sambuc #include <sys/cdefs.h>
32*0a6a1f1dSLionel Sambuc __RCSID("$NetBSD: t_pow.c,v 1.4 2015/09/08 05:24:27 dholland Exp $");
3311be35a1SLionel Sambuc
3411be35a1SLionel Sambuc #include <atf-c.h>
3511be35a1SLionel Sambuc #include <math.h>
3611be35a1SLionel Sambuc
3711be35a1SLionel Sambuc /*
3811be35a1SLionel Sambuc * pow(3)
3911be35a1SLionel Sambuc */
4011be35a1SLionel Sambuc ATF_TC(pow_nan_x);
ATF_TC_HEAD(pow_nan_x,tc)4111be35a1SLionel Sambuc ATF_TC_HEAD(pow_nan_x, tc)
4211be35a1SLionel Sambuc {
4311be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(NaN, y) == NaN");
4411be35a1SLionel Sambuc }
4511be35a1SLionel Sambuc
ATF_TC_BODY(pow_nan_x,tc)4611be35a1SLionel Sambuc ATF_TC_BODY(pow_nan_x, tc)
4711be35a1SLionel Sambuc {
4811be35a1SLionel Sambuc const double x = 0.0L / 0.0L;
4911be35a1SLionel Sambuc
5011be35a1SLionel Sambuc ATF_CHECK(isnan(pow(x, 2.0)) != 0);
5111be35a1SLionel Sambuc }
5211be35a1SLionel Sambuc
5311be35a1SLionel Sambuc ATF_TC(pow_nan_y);
ATF_TC_HEAD(pow_nan_y,tc)5411be35a1SLionel Sambuc ATF_TC_HEAD(pow_nan_y, tc)
5511be35a1SLionel Sambuc {
5611be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(x, NaN) == NaN");
5711be35a1SLionel Sambuc }
5811be35a1SLionel Sambuc
ATF_TC_BODY(pow_nan_y,tc)5911be35a1SLionel Sambuc ATF_TC_BODY(pow_nan_y, tc)
6011be35a1SLionel Sambuc {
6111be35a1SLionel Sambuc const double y = 0.0L / 0.0L;
6211be35a1SLionel Sambuc
6311be35a1SLionel Sambuc ATF_CHECK(isnan(pow(2.0, y)) != 0);
6411be35a1SLionel Sambuc }
6511be35a1SLionel Sambuc
6611be35a1SLionel Sambuc ATF_TC(pow_inf_neg_x);
ATF_TC_HEAD(pow_inf_neg_x,tc)6711be35a1SLionel Sambuc ATF_TC_HEAD(pow_inf_neg_x, tc)
6811be35a1SLionel Sambuc {
6911be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(-Inf, y) == +-Inf || +-0.0");
7011be35a1SLionel Sambuc }
7111be35a1SLionel Sambuc
ATF_TC_BODY(pow_inf_neg_x,tc)7211be35a1SLionel Sambuc ATF_TC_BODY(pow_inf_neg_x, tc)
7311be35a1SLionel Sambuc {
7411be35a1SLionel Sambuc const double x = -1.0L / 0.0L;
7511be35a1SLionel Sambuc double z;
7611be35a1SLionel Sambuc
7711be35a1SLionel Sambuc /*
7811be35a1SLionel Sambuc * If y is odd, y > 0, and x is -Inf, -Inf is returned.
7911be35a1SLionel Sambuc * If y is even, y > 0, and x is -Inf, +Inf is returned.
8011be35a1SLionel Sambuc */
8111be35a1SLionel Sambuc z = pow(x, 3.0);
8211be35a1SLionel Sambuc
8311be35a1SLionel Sambuc if (isinf(z) == 0 || signbit(z) == 0)
8411be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-Inf, 3.0) != -Inf");
8511be35a1SLionel Sambuc
8611be35a1SLionel Sambuc z = pow(x, 4.0);
8711be35a1SLionel Sambuc
8811be35a1SLionel Sambuc if (isinf(z) == 0 || signbit(z) != 0)
8911be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-Inf, 4.0) != +Inf");
9011be35a1SLionel Sambuc
9111be35a1SLionel Sambuc /*
9211be35a1SLionel Sambuc * If y is odd, y < 0, and x is -Inf, -0.0 is returned.
9311be35a1SLionel Sambuc * If y is even, y < 0, and x is -Inf, +0.0 is returned.
9411be35a1SLionel Sambuc */
9511be35a1SLionel Sambuc z = pow(x, -3.0);
9611be35a1SLionel Sambuc
9711be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) == 0)
9811be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-Inf, -3.0) != -0.0");
9911be35a1SLionel Sambuc
10011be35a1SLionel Sambuc z = pow(x, -4.0);
10111be35a1SLionel Sambuc
10211be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) != 0)
10311be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-Inf -4.0) != +0.0");
10411be35a1SLionel Sambuc }
10511be35a1SLionel Sambuc
10611be35a1SLionel Sambuc ATF_TC(pow_inf_neg_y);
ATF_TC_HEAD(pow_inf_neg_y,tc)10711be35a1SLionel Sambuc ATF_TC_HEAD(pow_inf_neg_y, tc)
10811be35a1SLionel Sambuc {
10911be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(x, -Inf) == +Inf || +0.0");
11011be35a1SLionel Sambuc }
11111be35a1SLionel Sambuc
ATF_TC_BODY(pow_inf_neg_y,tc)11211be35a1SLionel Sambuc ATF_TC_BODY(pow_inf_neg_y, tc)
11311be35a1SLionel Sambuc {
11411be35a1SLionel Sambuc const double y = -1.0L / 0.0L;
11511be35a1SLionel Sambuc double z;
11611be35a1SLionel Sambuc
11711be35a1SLionel Sambuc /*
11811be35a1SLionel Sambuc * If |x| < 1 and y is -Inf, +Inf is returned.
11911be35a1SLionel Sambuc * If |x| > 1 and y is -Inf, +0.0 is returned.
12011be35a1SLionel Sambuc */
12111be35a1SLionel Sambuc z = pow(0.1, y);
12211be35a1SLionel Sambuc
12311be35a1SLionel Sambuc if (isinf(z) == 0 || signbit(z) != 0)
12411be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(0.1, -Inf) != +Inf");
12511be35a1SLionel Sambuc
12611be35a1SLionel Sambuc z = pow(1.1, y);
12711be35a1SLionel Sambuc
12811be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) != 0)
12911be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(1.1, -Inf) != +0.0");
13011be35a1SLionel Sambuc }
13111be35a1SLionel Sambuc
13211be35a1SLionel Sambuc ATF_TC(pow_inf_pos_x);
ATF_TC_HEAD(pow_inf_pos_x,tc)13311be35a1SLionel Sambuc ATF_TC_HEAD(pow_inf_pos_x, tc)
13411be35a1SLionel Sambuc {
13511be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(+Inf, y) == +Inf || +0.0");
13611be35a1SLionel Sambuc }
13711be35a1SLionel Sambuc
ATF_TC_BODY(pow_inf_pos_x,tc)13811be35a1SLionel Sambuc ATF_TC_BODY(pow_inf_pos_x, tc)
13911be35a1SLionel Sambuc {
14011be35a1SLionel Sambuc const double x = 1.0L / 0.0L;
14111be35a1SLionel Sambuc double z;
14211be35a1SLionel Sambuc
14311be35a1SLionel Sambuc /*
14411be35a1SLionel Sambuc * For y < 0, if x is +Inf, +0.0 is returned.
14511be35a1SLionel Sambuc * For y > 0, if x is +Inf, +Inf is returned.
14611be35a1SLionel Sambuc */
14711be35a1SLionel Sambuc z = pow(x, -2.0);
14811be35a1SLionel Sambuc
14911be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) != 0)
15011be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(+Inf, -2.0) != +0.0");
15111be35a1SLionel Sambuc
15211be35a1SLionel Sambuc z = pow(x, 2.0);
15311be35a1SLionel Sambuc
15411be35a1SLionel Sambuc if (isinf(z) == 0 || signbit(z) != 0)
15511be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(+Inf, 2.0) != +Inf");
15611be35a1SLionel Sambuc }
15711be35a1SLionel Sambuc
15811be35a1SLionel Sambuc ATF_TC(pow_inf_pos_y);
ATF_TC_HEAD(pow_inf_pos_y,tc)15911be35a1SLionel Sambuc ATF_TC_HEAD(pow_inf_pos_y, tc)
16011be35a1SLionel Sambuc {
16111be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(x, +Inf) == +Inf || +0.0");
16211be35a1SLionel Sambuc }
16311be35a1SLionel Sambuc
ATF_TC_BODY(pow_inf_pos_y,tc)16411be35a1SLionel Sambuc ATF_TC_BODY(pow_inf_pos_y, tc)
16511be35a1SLionel Sambuc {
16611be35a1SLionel Sambuc const double y = 1.0L / 0.0L;
16711be35a1SLionel Sambuc double z;
16811be35a1SLionel Sambuc
16911be35a1SLionel Sambuc /*
17011be35a1SLionel Sambuc * If |x| < 1 and y is +Inf, +0.0 is returned.
17111be35a1SLionel Sambuc * If |x| > 1 and y is +Inf, +Inf is returned.
17211be35a1SLionel Sambuc */
17311be35a1SLionel Sambuc z = pow(0.1, y);
17411be35a1SLionel Sambuc
17511be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) != 0)
17611be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(0.1, +Inf) != +0.0");
17711be35a1SLionel Sambuc
17811be35a1SLionel Sambuc z = pow(1.1, y);
17911be35a1SLionel Sambuc
18011be35a1SLionel Sambuc if (isinf(z) == 0 || signbit(z) != 0)
18111be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(1.1, +Inf) != +Inf");
18211be35a1SLionel Sambuc }
18311be35a1SLionel Sambuc
18411be35a1SLionel Sambuc ATF_TC(pow_one_neg_x);
ATF_TC_HEAD(pow_one_neg_x,tc)18511be35a1SLionel Sambuc ATF_TC_HEAD(pow_one_neg_x, tc)
18611be35a1SLionel Sambuc {
18711be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(-1.0, +-Inf) == 1.0");
18811be35a1SLionel Sambuc }
18911be35a1SLionel Sambuc
ATF_TC_BODY(pow_one_neg_x,tc)19011be35a1SLionel Sambuc ATF_TC_BODY(pow_one_neg_x, tc)
19111be35a1SLionel Sambuc {
19211be35a1SLionel Sambuc const double infp = 1.0L / 0.0L;
19311be35a1SLionel Sambuc const double infn = -1.0L / 0.0L;
19411be35a1SLionel Sambuc
19511be35a1SLionel Sambuc /*
19611be35a1SLionel Sambuc * If x is -1.0, and y is +-Inf, 1.0 shall be returned.
19711be35a1SLionel Sambuc */
19811be35a1SLionel Sambuc ATF_REQUIRE(isinf(infp) != 0);
19911be35a1SLionel Sambuc ATF_REQUIRE(isinf(infn) != 0);
20011be35a1SLionel Sambuc
20111be35a1SLionel Sambuc if (pow(-1.0, infp) != 1.0) {
20211be35a1SLionel Sambuc atf_tc_expect_fail("PR lib/45372");
20311be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-1.0, +Inf) != 1.0");
20411be35a1SLionel Sambuc }
20511be35a1SLionel Sambuc
20611be35a1SLionel Sambuc if (pow(-1.0, infn) != 1.0) {
20711be35a1SLionel Sambuc atf_tc_expect_fail("PR lib/45372");
20811be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-1.0, -Inf) != 1.0");
20911be35a1SLionel Sambuc }
21011be35a1SLionel Sambuc }
21111be35a1SLionel Sambuc
21211be35a1SLionel Sambuc ATF_TC(pow_one_pos_x);
ATF_TC_HEAD(pow_one_pos_x,tc)21311be35a1SLionel Sambuc ATF_TC_HEAD(pow_one_pos_x, tc)
21411be35a1SLionel Sambuc {
21511be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(1.0, y) == 1.0");
21611be35a1SLionel Sambuc }
21711be35a1SLionel Sambuc
ATF_TC_BODY(pow_one_pos_x,tc)21811be35a1SLionel Sambuc ATF_TC_BODY(pow_one_pos_x, tc)
21911be35a1SLionel Sambuc {
22011be35a1SLionel Sambuc const double y[] = { 0.0, 0.1, 2.0, -3.0, 99.0, 99.99, 9999999.9 };
22111be35a1SLionel Sambuc const double z = 0.0L / 0.0L;
22211be35a1SLionel Sambuc size_t i;
22311be35a1SLionel Sambuc
22411be35a1SLionel Sambuc /*
22511be35a1SLionel Sambuc * For any value of y (including NaN),
22611be35a1SLionel Sambuc * if x is 1.0, 1.0 shall be returned.
22711be35a1SLionel Sambuc */
22811be35a1SLionel Sambuc if (pow(1.0, z) != 1.0)
22911be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(1.0, NaN) != 1.0");
23011be35a1SLionel Sambuc
23111be35a1SLionel Sambuc for (i = 0; i < __arraycount(y); i++) {
23211be35a1SLionel Sambuc
23311be35a1SLionel Sambuc if (pow(1.0, y[i]) != 1.0)
23411be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(1.0, %0.01f) != 1.0", y[i]);
23511be35a1SLionel Sambuc }
23611be35a1SLionel Sambuc }
23711be35a1SLionel Sambuc
23811be35a1SLionel Sambuc ATF_TC(pow_zero_x);
ATF_TC_HEAD(pow_zero_x,tc)23911be35a1SLionel Sambuc ATF_TC_HEAD(pow_zero_x, tc)
24011be35a1SLionel Sambuc {
24111be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(+-0.0, y) == +-0.0 || HUGE");
24211be35a1SLionel Sambuc }
24311be35a1SLionel Sambuc
ATF_TC_BODY(pow_zero_x,tc)24411be35a1SLionel Sambuc ATF_TC_BODY(pow_zero_x, tc)
24511be35a1SLionel Sambuc {
24611be35a1SLionel Sambuc double z;
24711be35a1SLionel Sambuc
24811be35a1SLionel Sambuc /*
24911be35a1SLionel Sambuc * If x is +0.0 or -0.0, y > 0, and y
25011be35a1SLionel Sambuc * is an odd integer, x is returned.
25111be35a1SLionel Sambuc */
25211be35a1SLionel Sambuc z = pow(+0.0, 3.0);
25311be35a1SLionel Sambuc
25411be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) != 0)
25511be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(+0.0, 3.0) != +0.0");
25611be35a1SLionel Sambuc
25711be35a1SLionel Sambuc z = pow(-0.0, 3.0);
25811be35a1SLionel Sambuc
25911be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) == 0)
26011be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-0.0, 3.0) != -0.0");
26111be35a1SLionel Sambuc
26211be35a1SLionel Sambuc /*
26311be35a1SLionel Sambuc * If y > 0 and not an odd integer,
26411be35a1SLionel Sambuc * if x is +0.0 or -0.0, +0.0 is returned.
26511be35a1SLionel Sambuc */
26611be35a1SLionel Sambuc z = pow(+0.0, 4.0);
26711be35a1SLionel Sambuc
26811be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) != 0)
26911be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(+0.0, 4.0) != +0.0");
27011be35a1SLionel Sambuc
27111be35a1SLionel Sambuc z = pow(-0.0, 4.0);
27211be35a1SLionel Sambuc
27311be35a1SLionel Sambuc if (fabs(z) > 0.0 || signbit(z) != 0)
27411be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-0.0, 4.0) != +0.0");
27511be35a1SLionel Sambuc
27611be35a1SLionel Sambuc /*
27711be35a1SLionel Sambuc * If y < 0 and x is +0.0 or -0.0, either +-HUGE_VAL,
27811be35a1SLionel Sambuc * +-HUGE_VALF, or +-HUGE_VALL shall be returned.
27911be35a1SLionel Sambuc */
28011be35a1SLionel Sambuc z = pow(+0.0, -4.0);
28111be35a1SLionel Sambuc
28211be35a1SLionel Sambuc if (z != HUGE_VAL) {
28311be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(+0.0, -4.0) != HUGE_VAL");
28411be35a1SLionel Sambuc }
28511be35a1SLionel Sambuc
28611be35a1SLionel Sambuc z = pow(-0.0, -4.0);
28711be35a1SLionel Sambuc
28811be35a1SLionel Sambuc if (z != HUGE_VAL) {
28911be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-0.0, -4.0) != HUGE_VAL");
29011be35a1SLionel Sambuc }
29111be35a1SLionel Sambuc
29211be35a1SLionel Sambuc z = pow(+0.0, -5.0);
29311be35a1SLionel Sambuc
29411be35a1SLionel Sambuc if (z != HUGE_VAL) {
29511be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(+0.0, -5.0) != HUGE_VAL");
29611be35a1SLionel Sambuc }
29711be35a1SLionel Sambuc
29811be35a1SLionel Sambuc z = pow(-0.0, -5.0);
29911be35a1SLionel Sambuc
30011be35a1SLionel Sambuc if (z != -HUGE_VAL)
30111be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(-0.0, -5.0) != -HUGE_VAL");
30211be35a1SLionel Sambuc }
30311be35a1SLionel Sambuc
30411be35a1SLionel Sambuc ATF_TC(pow_zero_y);
ATF_TC_HEAD(pow_zero_y,tc)30511be35a1SLionel Sambuc ATF_TC_HEAD(pow_zero_y, tc)
30611be35a1SLionel Sambuc {
30711be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test pow(x, +-0.0) == 1.0");
30811be35a1SLionel Sambuc }
30911be35a1SLionel Sambuc
ATF_TC_BODY(pow_zero_y,tc)31011be35a1SLionel Sambuc ATF_TC_BODY(pow_zero_y, tc)
31111be35a1SLionel Sambuc {
31211be35a1SLionel Sambuc const double x[] = { 0.1, -3.0, 77.0, 99.99, 101.0000001 };
31311be35a1SLionel Sambuc const double z = 0.0L / 0.0L;
31411be35a1SLionel Sambuc size_t i;
31511be35a1SLionel Sambuc
31611be35a1SLionel Sambuc /*
31711be35a1SLionel Sambuc * For any value of x (including NaN),
31811be35a1SLionel Sambuc * if y is +0.0 or -0.0, 1.0 is returned.
31911be35a1SLionel Sambuc */
32011be35a1SLionel Sambuc if (pow(z, +0.0) != 1.0)
32111be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(NaN, +0.0) != 1.0");
32211be35a1SLionel Sambuc
32311be35a1SLionel Sambuc if (pow(z, -0.0) != 1.0)
32411be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(NaN, -0.0) != 1.0");
32511be35a1SLionel Sambuc
32611be35a1SLionel Sambuc for (i = 0; i < __arraycount(x); i++) {
32711be35a1SLionel Sambuc
32811be35a1SLionel Sambuc if (pow(x[i], +0.0) != 1.0)
32911be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(%0.01f, +0.0) != 1.0", x[i]);
33011be35a1SLionel Sambuc
33111be35a1SLionel Sambuc if (pow(x[i], -0.0) != 1.0)
33211be35a1SLionel Sambuc atf_tc_fail_nonfatal("pow(%0.01f, -0.0) != 1.0", x[i]);
33311be35a1SLionel Sambuc }
33411be35a1SLionel Sambuc }
33511be35a1SLionel Sambuc
33611be35a1SLionel Sambuc /*
33711be35a1SLionel Sambuc * powf(3)
33811be35a1SLionel Sambuc */
33911be35a1SLionel Sambuc ATF_TC(powf_nan_x);
ATF_TC_HEAD(powf_nan_x,tc)34011be35a1SLionel Sambuc ATF_TC_HEAD(powf_nan_x, tc)
34111be35a1SLionel Sambuc {
34211be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(NaN, y) == NaN");
34311be35a1SLionel Sambuc }
34411be35a1SLionel Sambuc
ATF_TC_BODY(powf_nan_x,tc)34511be35a1SLionel Sambuc ATF_TC_BODY(powf_nan_x, tc)
34611be35a1SLionel Sambuc {
34711be35a1SLionel Sambuc const float x = 0.0L / 0.0L;
34811be35a1SLionel Sambuc
34911be35a1SLionel Sambuc ATF_CHECK(isnanf(powf(x, 2.0)) != 0);
35011be35a1SLionel Sambuc }
35111be35a1SLionel Sambuc
35211be35a1SLionel Sambuc ATF_TC(powf_nan_y);
ATF_TC_HEAD(powf_nan_y,tc)35311be35a1SLionel Sambuc ATF_TC_HEAD(powf_nan_y, tc)
35411be35a1SLionel Sambuc {
35511be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(x, NaN) == NaN");
35611be35a1SLionel Sambuc }
35711be35a1SLionel Sambuc
ATF_TC_BODY(powf_nan_y,tc)35811be35a1SLionel Sambuc ATF_TC_BODY(powf_nan_y, tc)
35911be35a1SLionel Sambuc {
36011be35a1SLionel Sambuc const float y = 0.0L / 0.0L;
36111be35a1SLionel Sambuc
36211be35a1SLionel Sambuc ATF_CHECK(isnanf(powf(2.0, y)) != 0);
36311be35a1SLionel Sambuc }
36411be35a1SLionel Sambuc
36511be35a1SLionel Sambuc ATF_TC(powf_inf_neg_x);
ATF_TC_HEAD(powf_inf_neg_x,tc)36611be35a1SLionel Sambuc ATF_TC_HEAD(powf_inf_neg_x, tc)
36711be35a1SLionel Sambuc {
36811be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(-Inf, y) == +-Inf || +-0.0");
36911be35a1SLionel Sambuc }
37011be35a1SLionel Sambuc
ATF_TC_BODY(powf_inf_neg_x,tc)37111be35a1SLionel Sambuc ATF_TC_BODY(powf_inf_neg_x, tc)
37211be35a1SLionel Sambuc {
37311be35a1SLionel Sambuc const float x = -1.0L / 0.0L;
37411be35a1SLionel Sambuc float z;
37511be35a1SLionel Sambuc
37611be35a1SLionel Sambuc /*
37711be35a1SLionel Sambuc * If y is odd, y > 0, and x is -Inf, -Inf is returned.
37811be35a1SLionel Sambuc * If y is even, y > 0, and x is -Inf, +Inf is returned.
37911be35a1SLionel Sambuc */
38011be35a1SLionel Sambuc z = powf(x, 3.0);
38111be35a1SLionel Sambuc
38211be35a1SLionel Sambuc if (isinff(z) == 0 || signbit(z) == 0)
38311be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-Inf, 3.0) != -Inf");
38411be35a1SLionel Sambuc
38511be35a1SLionel Sambuc z = powf(x, 4.0);
38611be35a1SLionel Sambuc
38711be35a1SLionel Sambuc if (isinff(z) == 0 || signbit(z) != 0)
38811be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-Inf, 4.0) != +Inf");
38911be35a1SLionel Sambuc
39011be35a1SLionel Sambuc /*
39111be35a1SLionel Sambuc * If y is odd, y < 0, and x is -Inf, -0.0 is returned.
39211be35a1SLionel Sambuc * If y is even, y < 0, and x is -Inf, +0.0 is returned.
39311be35a1SLionel Sambuc */
39411be35a1SLionel Sambuc z = powf(x, -3.0);
39511be35a1SLionel Sambuc
39611be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) == 0) {
39711be35a1SLionel Sambuc atf_tc_expect_fail("PR lib/45372");
39811be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-Inf, -3.0) != -0.0");
39911be35a1SLionel Sambuc }
40011be35a1SLionel Sambuc
40111be35a1SLionel Sambuc z = powf(x, -4.0);
40211be35a1SLionel Sambuc
40311be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) != 0)
40411be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-Inf -4.0) != +0.0");
40511be35a1SLionel Sambuc }
40611be35a1SLionel Sambuc
40711be35a1SLionel Sambuc ATF_TC(powf_inf_neg_y);
ATF_TC_HEAD(powf_inf_neg_y,tc)40811be35a1SLionel Sambuc ATF_TC_HEAD(powf_inf_neg_y, tc)
40911be35a1SLionel Sambuc {
41011be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(x, -Inf) == +Inf || +0.0");
41111be35a1SLionel Sambuc }
41211be35a1SLionel Sambuc
ATF_TC_BODY(powf_inf_neg_y,tc)41311be35a1SLionel Sambuc ATF_TC_BODY(powf_inf_neg_y, tc)
41411be35a1SLionel Sambuc {
41511be35a1SLionel Sambuc const float y = -1.0L / 0.0L;
41611be35a1SLionel Sambuc float z;
41711be35a1SLionel Sambuc
41811be35a1SLionel Sambuc /*
41911be35a1SLionel Sambuc * If |x| < 1 and y is -Inf, +Inf is returned.
42011be35a1SLionel Sambuc * If |x| > 1 and y is -Inf, +0.0 is returned.
42111be35a1SLionel Sambuc */
42211be35a1SLionel Sambuc z = powf(0.1, y);
42311be35a1SLionel Sambuc
42411be35a1SLionel Sambuc if (isinff(z) == 0 || signbit(z) != 0)
42511be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(0.1, -Inf) != +Inf");
42611be35a1SLionel Sambuc
42711be35a1SLionel Sambuc z = powf(1.1, y);
42811be35a1SLionel Sambuc
42911be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) != 0)
43011be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(1.1, -Inf) != +0.0");
43111be35a1SLionel Sambuc }
43211be35a1SLionel Sambuc
43311be35a1SLionel Sambuc ATF_TC(powf_inf_pos_x);
ATF_TC_HEAD(powf_inf_pos_x,tc)43411be35a1SLionel Sambuc ATF_TC_HEAD(powf_inf_pos_x, tc)
43511be35a1SLionel Sambuc {
43611be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(+Inf, y) == +Inf || +0.0");
43711be35a1SLionel Sambuc }
43811be35a1SLionel Sambuc
ATF_TC_BODY(powf_inf_pos_x,tc)43911be35a1SLionel Sambuc ATF_TC_BODY(powf_inf_pos_x, tc)
44011be35a1SLionel Sambuc {
44111be35a1SLionel Sambuc const float x = 1.0L / 0.0L;
44211be35a1SLionel Sambuc float z;
44311be35a1SLionel Sambuc
44411be35a1SLionel Sambuc /*
44511be35a1SLionel Sambuc * For y < 0, if x is +Inf, +0.0 is returned.
44611be35a1SLionel Sambuc * For y > 0, if x is +Inf, +Inf is returned.
44711be35a1SLionel Sambuc */
44811be35a1SLionel Sambuc z = powf(x, -2.0);
44911be35a1SLionel Sambuc
45011be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) != 0)
45111be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(+Inf, -2.0) != +0.0");
45211be35a1SLionel Sambuc
45311be35a1SLionel Sambuc z = powf(x, 2.0);
45411be35a1SLionel Sambuc
45511be35a1SLionel Sambuc if (isinff(z) == 0 || signbit(z) != 0)
45611be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(+Inf, 2.0) != +Inf");
45711be35a1SLionel Sambuc }
45811be35a1SLionel Sambuc
45911be35a1SLionel Sambuc ATF_TC(powf_inf_pos_y);
ATF_TC_HEAD(powf_inf_pos_y,tc)46011be35a1SLionel Sambuc ATF_TC_HEAD(powf_inf_pos_y, tc)
46111be35a1SLionel Sambuc {
46211be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(x, +Inf) == +Inf || +0.0");
46311be35a1SLionel Sambuc }
46411be35a1SLionel Sambuc
ATF_TC_BODY(powf_inf_pos_y,tc)46511be35a1SLionel Sambuc ATF_TC_BODY(powf_inf_pos_y, tc)
46611be35a1SLionel Sambuc {
46711be35a1SLionel Sambuc const float y = 1.0L / 0.0L;
46811be35a1SLionel Sambuc float z;
46911be35a1SLionel Sambuc
47011be35a1SLionel Sambuc /*
47111be35a1SLionel Sambuc * If |x| < 1 and y is +Inf, +0.0 is returned.
47211be35a1SLionel Sambuc * If |x| > 1 and y is +Inf, +Inf is returned.
47311be35a1SLionel Sambuc */
47411be35a1SLionel Sambuc z = powf(0.1, y);
47511be35a1SLionel Sambuc
47611be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) != 0)
47711be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(0.1, +Inf) != +0.0");
47811be35a1SLionel Sambuc
47911be35a1SLionel Sambuc z = powf(1.1, y);
48011be35a1SLionel Sambuc
48111be35a1SLionel Sambuc if (isinff(z) == 0 || signbit(z) != 0)
48211be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(1.1, +Inf) != +Inf");
48311be35a1SLionel Sambuc }
48411be35a1SLionel Sambuc
48511be35a1SLionel Sambuc ATF_TC(powf_one_neg_x);
ATF_TC_HEAD(powf_one_neg_x,tc)48611be35a1SLionel Sambuc ATF_TC_HEAD(powf_one_neg_x, tc)
48711be35a1SLionel Sambuc {
48811be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(-1.0, +-Inf) == 1.0");
48911be35a1SLionel Sambuc }
49011be35a1SLionel Sambuc
ATF_TC_BODY(powf_one_neg_x,tc)49111be35a1SLionel Sambuc ATF_TC_BODY(powf_one_neg_x, tc)
49211be35a1SLionel Sambuc {
49311be35a1SLionel Sambuc const float infp = 1.0L / 0.0L;
49411be35a1SLionel Sambuc const float infn = -1.0L / 0.0L;
49511be35a1SLionel Sambuc
49611be35a1SLionel Sambuc /*
49711be35a1SLionel Sambuc * If x is -1.0, and y is +-Inf, 1.0 shall be returned.
49811be35a1SLionel Sambuc */
49911be35a1SLionel Sambuc ATF_REQUIRE(isinff(infp) != 0);
50011be35a1SLionel Sambuc ATF_REQUIRE(isinff(infn) != 0);
50111be35a1SLionel Sambuc
50211be35a1SLionel Sambuc if (powf(-1.0, infp) != 1.0) {
50311be35a1SLionel Sambuc atf_tc_expect_fail("PR lib/45372");
50411be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-1.0, +Inf) != 1.0");
50511be35a1SLionel Sambuc }
50611be35a1SLionel Sambuc
50711be35a1SLionel Sambuc if (powf(-1.0, infn) != 1.0) {
50811be35a1SLionel Sambuc atf_tc_expect_fail("PR lib/45372");
50911be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-1.0, -Inf) != 1.0");
51011be35a1SLionel Sambuc }
51111be35a1SLionel Sambuc }
51211be35a1SLionel Sambuc
51311be35a1SLionel Sambuc ATF_TC(powf_one_pos_x);
ATF_TC_HEAD(powf_one_pos_x,tc)51411be35a1SLionel Sambuc ATF_TC_HEAD(powf_one_pos_x, tc)
51511be35a1SLionel Sambuc {
51611be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(1.0, y) == 1.0");
51711be35a1SLionel Sambuc }
51811be35a1SLionel Sambuc
ATF_TC_BODY(powf_one_pos_x,tc)51911be35a1SLionel Sambuc ATF_TC_BODY(powf_one_pos_x, tc)
52011be35a1SLionel Sambuc {
52111be35a1SLionel Sambuc const float y[] = { 0.0, 0.1, 2.0, -3.0, 99.0, 99.99, 9999999.9 };
52211be35a1SLionel Sambuc const float z = 0.0L / 0.0L;
52311be35a1SLionel Sambuc size_t i;
52411be35a1SLionel Sambuc
52511be35a1SLionel Sambuc /*
52611be35a1SLionel Sambuc * For any value of y (including NaN),
52711be35a1SLionel Sambuc * if x is 1.0, 1.0 shall be returned.
52811be35a1SLionel Sambuc */
52911be35a1SLionel Sambuc if (powf(1.0, z) != 1.0)
53011be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(1.0, NaN) != 1.0");
53111be35a1SLionel Sambuc
53211be35a1SLionel Sambuc for (i = 0; i < __arraycount(y); i++) {
53311be35a1SLionel Sambuc
53411be35a1SLionel Sambuc if (powf(1.0, y[i]) != 1.0)
53511be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(1.0, %0.01f) != 1.0", y[i]);
53611be35a1SLionel Sambuc }
53711be35a1SLionel Sambuc }
53811be35a1SLionel Sambuc
53911be35a1SLionel Sambuc ATF_TC(powf_zero_x);
ATF_TC_HEAD(powf_zero_x,tc)54011be35a1SLionel Sambuc ATF_TC_HEAD(powf_zero_x, tc)
54111be35a1SLionel Sambuc {
54211be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(+-0.0, y) == +-0.0 || HUGE");
54311be35a1SLionel Sambuc }
54411be35a1SLionel Sambuc
ATF_TC_BODY(powf_zero_x,tc)54511be35a1SLionel Sambuc ATF_TC_BODY(powf_zero_x, tc)
54611be35a1SLionel Sambuc {
54711be35a1SLionel Sambuc float z;
54811be35a1SLionel Sambuc
54911be35a1SLionel Sambuc /*
55011be35a1SLionel Sambuc * If x is +0.0 or -0.0, y > 0, and y
55111be35a1SLionel Sambuc * is an odd integer, x is returned.
55211be35a1SLionel Sambuc */
55311be35a1SLionel Sambuc z = powf(+0.0, 3.0);
55411be35a1SLionel Sambuc
55511be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) != 0)
55611be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(+0.0, 3.0) != +0.0");
55711be35a1SLionel Sambuc
55811be35a1SLionel Sambuc z = powf(-0.0, 3.0);
55911be35a1SLionel Sambuc
56011be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) == 0)
56111be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-0.0, 3.0) != -0.0");
56211be35a1SLionel Sambuc
56311be35a1SLionel Sambuc /*
56411be35a1SLionel Sambuc * If y > 0 and not an odd integer,
56511be35a1SLionel Sambuc * if x is +0.0 or -0.0, +0.0 is returned.
56611be35a1SLionel Sambuc */
56711be35a1SLionel Sambuc z = powf(+0.0, 4.0);
56811be35a1SLionel Sambuc
56911be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) != 0)
57011be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(+0.0, 4.0) != +0.0");
57111be35a1SLionel Sambuc
57211be35a1SLionel Sambuc z = powf(-0.0, 4.0);
57311be35a1SLionel Sambuc
57411be35a1SLionel Sambuc if (fabsf(z) > 0.0 || signbit(z) != 0)
57511be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-0.0, 4.0) != +0.0");
57611be35a1SLionel Sambuc
57711be35a1SLionel Sambuc /*
57811be35a1SLionel Sambuc * If y < 0 and x is +0.0 or -0.0, either +-HUGE_VAL,
57911be35a1SLionel Sambuc * +-HUGE_VALF, or +-HUGE_VALL shall be returned.
58011be35a1SLionel Sambuc */
58111be35a1SLionel Sambuc z = powf(+0.0, -4.0);
58211be35a1SLionel Sambuc
58311be35a1SLionel Sambuc if (z != HUGE_VALF) {
58411be35a1SLionel Sambuc atf_tc_expect_fail("PR port-amd64/45391");
58511be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(+0.0, -4.0) != HUGE_VALF");
58611be35a1SLionel Sambuc }
58711be35a1SLionel Sambuc
58811be35a1SLionel Sambuc z = powf(-0.0, -4.0);
58911be35a1SLionel Sambuc
59011be35a1SLionel Sambuc if (z != HUGE_VALF) {
59111be35a1SLionel Sambuc atf_tc_expect_fail("PR port-amd64/45391");
59211be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-0.0, -4.0) != HUGE_VALF");
59311be35a1SLionel Sambuc }
59411be35a1SLionel Sambuc
59511be35a1SLionel Sambuc z = powf(+0.0, -5.0);
59611be35a1SLionel Sambuc
59711be35a1SLionel Sambuc if (z != HUGE_VALF) {
59811be35a1SLionel Sambuc atf_tc_expect_fail("PR port-amd64/45391");
59911be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(+0.0, -5.0) != HUGE_VALF");
60011be35a1SLionel Sambuc }
60111be35a1SLionel Sambuc
60211be35a1SLionel Sambuc z = powf(-0.0, -5.0);
60311be35a1SLionel Sambuc
60411be35a1SLionel Sambuc if (z != -HUGE_VALF)
60511be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(-0.0, -5.0) != -HUGE_VALF");
60611be35a1SLionel Sambuc }
60711be35a1SLionel Sambuc
60811be35a1SLionel Sambuc ATF_TC(powf_zero_y);
ATF_TC_HEAD(powf_zero_y,tc)60911be35a1SLionel Sambuc ATF_TC_HEAD(powf_zero_y, tc)
61011be35a1SLionel Sambuc {
61111be35a1SLionel Sambuc atf_tc_set_md_var(tc, "descr", "Test powf(x, +-0.0) == 1.0");
61211be35a1SLionel Sambuc }
61311be35a1SLionel Sambuc
ATF_TC_BODY(powf_zero_y,tc)61411be35a1SLionel Sambuc ATF_TC_BODY(powf_zero_y, tc)
61511be35a1SLionel Sambuc {
61611be35a1SLionel Sambuc const float x[] = { 0.1, -3.0, 77.0, 99.99, 101.0000001 };
61711be35a1SLionel Sambuc const float z = 0.0L / 0.0L;
61811be35a1SLionel Sambuc size_t i;
61911be35a1SLionel Sambuc
62011be35a1SLionel Sambuc /*
62111be35a1SLionel Sambuc * For any value of x (including NaN),
62211be35a1SLionel Sambuc * if y is +0.0 or -0.0, 1.0 is returned.
62311be35a1SLionel Sambuc */
62411be35a1SLionel Sambuc if (powf(z, +0.0) != 1.0)
62511be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(NaN, +0.0) != 1.0");
62611be35a1SLionel Sambuc
62711be35a1SLionel Sambuc if (powf(z, -0.0) != 1.0)
62811be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(NaN, -0.0) != 1.0");
62911be35a1SLionel Sambuc
63011be35a1SLionel Sambuc for (i = 0; i < __arraycount(x); i++) {
63111be35a1SLionel Sambuc
63211be35a1SLionel Sambuc if (powf(x[i], +0.0) != 1.0)
63311be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(%0.01f, +0.0) != 1.0",x[i]);
63411be35a1SLionel Sambuc
63511be35a1SLionel Sambuc if (powf(x[i], -0.0) != 1.0)
63611be35a1SLionel Sambuc atf_tc_fail_nonfatal("powf(%0.01f, -0.0) != 1.0",x[i]);
63711be35a1SLionel Sambuc }
63811be35a1SLionel Sambuc }
63911be35a1SLionel Sambuc
ATF_TP_ADD_TCS(tp)64011be35a1SLionel Sambuc ATF_TP_ADD_TCS(tp)
64111be35a1SLionel Sambuc {
64211be35a1SLionel Sambuc
64311be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_nan_x);
64411be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_nan_y);
64511be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_inf_neg_x);
64611be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_inf_neg_y);
64711be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_inf_pos_x);
64811be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_inf_pos_y);
64911be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_one_neg_x);
65011be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_one_pos_x);
65111be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_zero_x);
65211be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, pow_zero_y);
65311be35a1SLionel Sambuc
65411be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_nan_x);
65511be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_nan_y);
65611be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_inf_neg_x);
65711be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_inf_neg_y);
65811be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_inf_pos_x);
65911be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_inf_pos_y);
66011be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_one_neg_x);
66111be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_one_pos_x);
66211be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_zero_x);
66311be35a1SLionel Sambuc ATF_TP_ADD_TC(tp, powf_zero_y);
66411be35a1SLionel Sambuc
66511be35a1SLionel Sambuc return atf_no_error();
66611be35a1SLionel Sambuc }
667