2 Copyright (C) 1997-2017 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 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.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #include "libm-test-driver.c"
21 static const struct test_ff_f_data pow_test_data[] =
23 TEST_ff_f (pow, qnan_value, 0, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC),
24 TEST_ff_f (pow, -qnan_value, 0, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC),
25 TEST_ff_f (pow, qnan_value, minus_zero, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC),
26 TEST_ff_f (pow, -qnan_value, minus_zero, 1, ERRNO_UNCHANGED|NO_TEST_MATHVEC),
27 TEST_ff_f (pow, snan_value, 0, qnan_value, INVALID_EXCEPTION|NO_TEST_MATHVEC),
28 TEST_ff_f (pow, -snan_value, 0, qnan_value, INVALID_EXCEPTION|NO_TEST_MATHVEC),
29 TEST_ff_f (pow, snan_value, minus_zero, qnan_value, INVALID_EXCEPTION|NO_TEST_MATHVEC),
30 TEST_ff_f (pow, -snan_value, minus_zero, qnan_value, INVALID_EXCEPTION|NO_TEST_MATHVEC),
32 TEST_ff_f (pow, 1.1L, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
33 TEST_ff_f (pow, plus_infty, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
34 TEST_ff_f (pow, -1.1L, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
35 TEST_ff_f (pow, minus_infty, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
37 TEST_ff_f (pow, 0.9L, plus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
38 TEST_ff_f (pow, 1e-7L, plus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
39 TEST_ff_f (pow, -0.9L, plus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
40 TEST_ff_f (pow, -1e-7L, plus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
42 TEST_ff_f (pow, 1.1L, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
43 TEST_ff_f (pow, plus_infty, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
44 TEST_ff_f (pow, -1.1L, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
45 TEST_ff_f (pow, minus_infty, minus_infty, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
47 TEST_ff_f (pow, 0.9L, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
48 TEST_ff_f (pow, 1e-7L, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
49 TEST_ff_f (pow, -0.9L, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
50 TEST_ff_f (pow, -1e-7L, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
52 TEST_ff_f (pow, plus_infty, 1e-7L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
53 TEST_ff_f (pow, plus_infty, 1, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
54 TEST_ff_f (pow, plus_infty, 1e7L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
55 TEST_ff_f (pow, plus_infty, min_subnorm_value, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
57 TEST_ff_f (pow, plus_infty, -1e-7L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
58 TEST_ff_f (pow, plus_infty, -1, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
59 TEST_ff_f (pow, plus_infty, -1e7L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
60 TEST_ff_f (pow, plus_infty, -min_subnorm_value, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
62 TEST_ff_f (pow, minus_infty, 1, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
63 TEST_ff_f (pow, minus_infty, 11, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
64 TEST_ff_f (pow, minus_infty, 1001, minus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
66 TEST_ff_f (pow, minus_infty, 2, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
67 TEST_ff_f (pow, minus_infty, 12, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
68 TEST_ff_f (pow, minus_infty, 1002, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
69 TEST_ff_f (pow, minus_infty, 0.1L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
70 TEST_ff_f (pow, minus_infty, 1.1L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
71 TEST_ff_f (pow, minus_infty, 11.1L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
72 TEST_ff_f (pow, minus_infty, 1001.1L, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
73 TEST_ff_f (pow, minus_infty, min_subnorm_value, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
75 TEST_ff_f (pow, minus_infty, -1, minus_zero, ERRNO_UNCHANGED|NO_TEST_INLINE),
76 TEST_ff_f (pow, minus_infty, -11, minus_zero, ERRNO_UNCHANGED|NO_TEST_INLINE),
77 TEST_ff_f (pow, minus_infty, -1001, minus_zero, ERRNO_UNCHANGED|NO_TEST_INLINE),
79 TEST_ff_f (pow, minus_infty, -2, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
80 TEST_ff_f (pow, minus_infty, -12, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
81 TEST_ff_f (pow, minus_infty, -1002, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
82 TEST_ff_f (pow, minus_infty, -0.1L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
83 TEST_ff_f (pow, minus_infty, -1.1L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
84 TEST_ff_f (pow, minus_infty, -11.1L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
85 TEST_ff_f (pow, minus_infty, -1001.1L, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
86 TEST_ff_f (pow, minus_infty, -min_subnorm_value, 0, ERRNO_UNCHANGED|NO_TEST_INLINE),
88 TEST_ff_f (pow, qnan_value, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
89 TEST_ff_f (pow, qnan_value, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
90 TEST_ff_f (pow, -qnan_value, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
91 TEST_ff_f (pow, -qnan_value, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
92 TEST_ff_f (pow, qnan_value, snan_value, qnan_value, INVALID_EXCEPTION),
93 TEST_ff_f (pow, qnan_value, -snan_value, qnan_value, INVALID_EXCEPTION),
94 TEST_ff_f (pow, -qnan_value, snan_value, qnan_value, INVALID_EXCEPTION),
95 TEST_ff_f (pow, -qnan_value, -snan_value, qnan_value, INVALID_EXCEPTION),
96 TEST_ff_f (pow, snan_value, qnan_value, qnan_value, INVALID_EXCEPTION),
97 TEST_ff_f (pow, snan_value, -qnan_value, qnan_value, INVALID_EXCEPTION),
98 TEST_ff_f (pow, -snan_value, qnan_value, qnan_value, INVALID_EXCEPTION),
99 TEST_ff_f (pow, -snan_value, -qnan_value, qnan_value, INVALID_EXCEPTION),
100 TEST_ff_f (pow, snan_value, snan_value, qnan_value, INVALID_EXCEPTION),
101 TEST_ff_f (pow, snan_value, -snan_value, qnan_value, INVALID_EXCEPTION),
102 TEST_ff_f (pow, -snan_value, snan_value, qnan_value, INVALID_EXCEPTION),
103 TEST_ff_f (pow, -snan_value, -snan_value, qnan_value, INVALID_EXCEPTION),
104 TEST_ff_f (pow, 0, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
105 TEST_ff_f (pow, 0, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
106 TEST_ff_f (pow, 0, snan_value, qnan_value, INVALID_EXCEPTION),
107 TEST_ff_f (pow, 0, -snan_value, qnan_value, INVALID_EXCEPTION),
108 TEST_ff_f (pow, 1, qnan_value, 1, ERRNO_UNCHANGED),
109 TEST_ff_f (pow, 1, -qnan_value, 1, ERRNO_UNCHANGED),
110 TEST_ff_f (pow, 1, snan_value, qnan_value, INVALID_EXCEPTION|NO_TEST_MATHVEC),
111 TEST_ff_f (pow, 1, -snan_value, qnan_value, INVALID_EXCEPTION|NO_TEST_MATHVEC),
112 TEST_ff_f (pow, -1, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
113 TEST_ff_f (pow, -1, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
114 TEST_ff_f (pow, -1, snan_value, qnan_value, INVALID_EXCEPTION),
115 TEST_ff_f (pow, -1, -snan_value, qnan_value, INVALID_EXCEPTION),
116 TEST_ff_f (pow, qnan_value, 1, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
117 TEST_ff_f (pow, -qnan_value, 1, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
118 TEST_ff_f (pow, snan_value, 1, qnan_value, INVALID_EXCEPTION),
119 TEST_ff_f (pow, -snan_value, 1, qnan_value, INVALID_EXCEPTION),
120 TEST_ff_f (pow, qnan_value, -1, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
121 TEST_ff_f (pow, -qnan_value, -1, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
122 TEST_ff_f (pow, snan_value, -1, qnan_value, INVALID_EXCEPTION),
123 TEST_ff_f (pow, -snan_value, -1, qnan_value, INVALID_EXCEPTION),
125 /* pow (x, qNaN or sNaN) == qNaN. */
126 TEST_ff_f (pow, 3.0, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
127 TEST_ff_f (pow, 3.0, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
128 TEST_ff_f (pow, minus_zero, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
129 TEST_ff_f (pow, minus_zero, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
130 TEST_ff_f (pow, plus_infty, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
131 TEST_ff_f (pow, plus_infty, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
132 TEST_ff_f (pow, -3.0, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
133 TEST_ff_f (pow, -3.0, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
134 TEST_ff_f (pow, minus_infty, qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
135 TEST_ff_f (pow, minus_infty, -qnan_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
136 TEST_ff_f (pow, 3.0, snan_value, qnan_value, INVALID_EXCEPTION),
137 TEST_ff_f (pow, 3.0, -snan_value, qnan_value, INVALID_EXCEPTION),
138 TEST_ff_f (pow, minus_zero, snan_value, qnan_value, INVALID_EXCEPTION),
139 TEST_ff_f (pow, minus_zero, -snan_value, qnan_value, INVALID_EXCEPTION),
140 TEST_ff_f (pow, plus_infty, snan_value, qnan_value, INVALID_EXCEPTION),
141 TEST_ff_f (pow, plus_infty, -snan_value, qnan_value, INVALID_EXCEPTION),
142 TEST_ff_f (pow, -3.0, snan_value, qnan_value, INVALID_EXCEPTION),
143 TEST_ff_f (pow, -3.0, -snan_value, qnan_value, INVALID_EXCEPTION),
144 TEST_ff_f (pow, minus_infty, snan_value, qnan_value, INVALID_EXCEPTION),
145 TEST_ff_f (pow, minus_infty, -snan_value, qnan_value, INVALID_EXCEPTION),
147 TEST_ff_f (pow, qnan_value, 3.0, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
148 TEST_ff_f (pow, -qnan_value, 3.0, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
149 TEST_ff_f (pow, qnan_value, -3.0, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
150 TEST_ff_f (pow, -qnan_value, -3.0, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
151 TEST_ff_f (pow, qnan_value, plus_infty, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
152 TEST_ff_f (pow, -qnan_value, plus_infty, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
153 TEST_ff_f (pow, qnan_value, minus_infty, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
154 TEST_ff_f (pow, -qnan_value, minus_infty, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
155 TEST_ff_f (pow, qnan_value, 2.5, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
156 TEST_ff_f (pow, -qnan_value, 2.5, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
157 TEST_ff_f (pow, qnan_value, -2.5, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
158 TEST_ff_f (pow, -qnan_value, -2.5, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
159 TEST_ff_f (pow, qnan_value, min_subnorm_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
160 TEST_ff_f (pow, -qnan_value, min_subnorm_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
161 TEST_ff_f (pow, qnan_value, -min_subnorm_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
162 TEST_ff_f (pow, -qnan_value, -min_subnorm_value, qnan_value, NO_INEXACT_EXCEPTION|ERRNO_UNCHANGED),
163 TEST_ff_f (pow, snan_value, 3.0, qnan_value, INVALID_EXCEPTION),
164 TEST_ff_f (pow, -snan_value, 3.0, qnan_value, INVALID_EXCEPTION),
165 TEST_ff_f (pow, snan_value, -3.0, qnan_value, INVALID_EXCEPTION),
166 TEST_ff_f (pow, -snan_value, -3.0, qnan_value, INVALID_EXCEPTION),
167 TEST_ff_f (pow, snan_value, plus_infty, qnan_value, INVALID_EXCEPTION),
168 TEST_ff_f (pow, -snan_value, plus_infty, qnan_value, INVALID_EXCEPTION),
169 TEST_ff_f (pow, snan_value, minus_infty, qnan_value, INVALID_EXCEPTION),
170 TEST_ff_f (pow, -snan_value, minus_infty, qnan_value, INVALID_EXCEPTION),
171 TEST_ff_f (pow, snan_value, 2.5, qnan_value, INVALID_EXCEPTION),
172 TEST_ff_f (pow, -snan_value, 2.5, qnan_value, INVALID_EXCEPTION),
173 TEST_ff_f (pow, snan_value, -2.5, qnan_value, INVALID_EXCEPTION),
174 TEST_ff_f (pow, -snan_value, -2.5, qnan_value, INVALID_EXCEPTION),
175 TEST_ff_f (pow, snan_value, min_subnorm_value, qnan_value, INVALID_EXCEPTION),
176 TEST_ff_f (pow, -snan_value, min_subnorm_value, qnan_value, INVALID_EXCEPTION),
177 TEST_ff_f (pow, snan_value, -min_subnorm_value, qnan_value, INVALID_EXCEPTION),
178 TEST_ff_f (pow, -snan_value, -min_subnorm_value, qnan_value, INVALID_EXCEPTION),
180 TEST_ff_f (pow, 1, plus_infty, 1, ERRNO_UNCHANGED),
181 TEST_ff_f (pow, -1, plus_infty, 1, ERRNO_UNCHANGED),
182 TEST_ff_f (pow, 1, minus_infty, 1, ERRNO_UNCHANGED),
183 TEST_ff_f (pow, -1, minus_infty, 1, ERRNO_UNCHANGED),
185 /* pow (x, +-0) == 1. */
186 TEST_ff_f (pow, plus_infty, 0, 1, ERRNO_UNCHANGED),
187 TEST_ff_f (pow, plus_infty, minus_zero, 1, ERRNO_UNCHANGED),
188 TEST_ff_f (pow, minus_infty, 0, 1, ERRNO_UNCHANGED),
189 TEST_ff_f (pow, minus_infty, minus_zero, 1, ERRNO_UNCHANGED),
191 TEST_ff_f (pow, -0.1L, 1.1L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
192 TEST_ff_f (pow, -0.1L, -1.1L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
193 TEST_ff_f (pow, -10.1L, 1.1L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
194 TEST_ff_f (pow, -10.1L, -1.1L, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
195 TEST_ff_f (pow, -1.01L, min_subnorm_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
196 TEST_ff_f (pow, -1.01L, -min_subnorm_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
197 TEST_ff_f (pow, -1.0L, min_subnorm_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
198 TEST_ff_f (pow, -1.0L, -min_subnorm_value, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
200 TEST_ff_f (pow, 0, -1, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
201 TEST_ff_f (pow, 0, -11, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
202 TEST_ff_f (pow, 0, -0xffffff, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
203 #if !TEST_COND_binary32
204 TEST_ff_f (pow, 0, -0x1.fffffffffffffp+52L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
207 TEST_ff_f (pow, 0, -0x1.fffffffffffffffep+63L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
209 TEST_ff_f (pow, 0, -0x1.ffffffffffffffffffffffffff8p+105L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
212 TEST_ff_f (pow, 0, -0x1.ffffffffffffffffffffffffffffp+112L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
215 TEST_ff_f (pow, minus_zero, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
216 TEST_ff_f (pow, minus_zero, -11L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
217 TEST_ff_f (pow, minus_zero, -0xffffff, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
218 TEST_ff_f (pow, minus_zero, -0x1fffffe, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
219 #if !TEST_COND_binary32
220 TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffp+52L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
221 TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffp+53L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
224 TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffffep+63L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
225 TEST_ff_f (pow, minus_zero, -0x1.fffffffffffffffep+64L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE|XFAIL_ROUNDING_IBM128_LIBGCC),
227 TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
228 TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE|XFAIL_ROUNDING_IBM128_LIBGCC),
231 TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
232 TEST_ff_f (pow, minus_zero, -0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
236 TEST_ff_f (pow, 0, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
237 TEST_ff_f (pow, 0, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
238 TEST_ff_f (pow, 0, -min_subnorm_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
239 TEST_ff_f (pow, 0, -0x1p24, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
240 TEST_ff_f (pow, 0, -0x1p127, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
241 TEST_ff_f (pow, 0, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
242 TEST_ff_f (pow, minus_zero, -2, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
243 TEST_ff_f (pow, minus_zero, -11.1L, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
244 TEST_ff_f (pow, minus_zero, -min_subnorm_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
245 TEST_ff_f (pow, minus_zero, -0x1p24, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
246 TEST_ff_f (pow, minus_zero, -0x1p127, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
247 TEST_ff_f (pow, minus_zero, -max_value, plus_infty, DIVIDE_BY_ZERO_EXCEPTION|ERRNO_ERANGE),
249 TEST_ff_f (pow, 0, plus_infty, 0, ERRNO_UNCHANGED),
250 TEST_ff_f (pow, minus_zero, plus_infty, 0, ERRNO_UNCHANGED),
251 TEST_ff_f (pow, 0, minus_infty, plus_infty, DIVIDE_BY_ZERO_EXCEPTION_OK|ERRNO_UNCHANGED),
252 TEST_ff_f (pow, minus_zero, minus_infty, plus_infty, DIVIDE_BY_ZERO_EXCEPTION_OK|ERRNO_UNCHANGED),
254 /* pow (x, +inf) == +inf for |x| > 1. */
255 TEST_ff_f (pow, 1.5, plus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
257 /* pow (x, +inf) == +0 for |x| < 1. */
258 TEST_ff_f (pow, 0.5, plus_infty, 0.0, ERRNO_UNCHANGED|NO_TEST_INLINE),
260 /* pow (x, -inf) == +0 for |x| > 1. */
261 TEST_ff_f (pow, 1.5, minus_infty, 0.0, ERRNO_UNCHANGED|NO_TEST_INLINE),
263 /* pow (x, -inf) == +inf for |x| < 1. */
264 TEST_ff_f (pow, 0.5, minus_infty, plus_infty, ERRNO_UNCHANGED|NO_TEST_INLINE),
266 /* pow (+inf, y) == +inf for y > 0. */
267 TEST_ff_f (pow, plus_infty, 2, plus_infty, ERRNO_UNCHANGED),
268 TEST_ff_f (pow, plus_infty, 0xffffff, plus_infty, ERRNO_UNCHANGED),
269 #if !TEST_COND_binary32
270 TEST_ff_f (pow, plus_infty, 0x1.fffffffffffffp+52L, plus_infty, ERRNO_UNCHANGED),
273 TEST_ff_f (pow, plus_infty, 0x1.fffffffffffffffep+63L, plus_infty, ERRNO_UNCHANGED),
275 TEST_ff_f (pow, plus_infty, 0x1.ffffffffffffffffffffffffff8p+105L, plus_infty, ERRNO_UNCHANGED),
278 TEST_ff_f (pow, plus_infty, 0x1.ffffffffffffffffffffffffffffp+112L, plus_infty, ERRNO_UNCHANGED),
281 TEST_ff_f (pow, plus_infty, 0x1p24, plus_infty, ERRNO_UNCHANGED),
282 TEST_ff_f (pow, plus_infty, 0x1p127, plus_infty, ERRNO_UNCHANGED),
283 TEST_ff_f (pow, plus_infty, max_value, plus_infty, ERRNO_UNCHANGED),
285 /* pow (+inf, y) == +0 for y < 0. */
286 TEST_ff_f (pow, plus_infty, -1, 0.0, ERRNO_UNCHANGED),
287 TEST_ff_f (pow, plus_infty, -0xffffff, 0.0, ERRNO_UNCHANGED),
288 #if !TEST_COND_binary32
289 TEST_ff_f (pow, plus_infty, -0x1.fffffffffffffp+52L, 0.0, ERRNO_UNCHANGED),
292 TEST_ff_f (pow, plus_infty, -0x1.fffffffffffffffep+63L, 0.0, ERRNO_UNCHANGED),
294 TEST_ff_f (pow, plus_infty, -0x1.ffffffffffffffffffffffffff8p+105L, 0.0, ERRNO_UNCHANGED),
297 TEST_ff_f (pow, plus_infty, -0x1.ffffffffffffffffffffffffffffp+112L, 0.0, ERRNO_UNCHANGED),
300 TEST_ff_f (pow, plus_infty, -0x1p24, 0.0, ERRNO_UNCHANGED),
301 TEST_ff_f (pow, plus_infty, -0x1p127, 0.0, ERRNO_UNCHANGED),
302 TEST_ff_f (pow, plus_infty, -max_value, 0.0, ERRNO_UNCHANGED),
304 /* pow (-inf, y) == -inf for y an odd integer > 0. */
305 TEST_ff_f (pow, minus_infty, 27, minus_infty, ERRNO_UNCHANGED),
306 TEST_ff_f (pow, minus_infty, 0xffffff, minus_infty, ERRNO_UNCHANGED),
307 TEST_ff_f (pow, minus_infty, 0x1fffffe, plus_infty, ERRNO_UNCHANGED),
308 #if !TEST_COND_binary32
309 TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffp+52L, minus_infty, ERRNO_UNCHANGED),
310 TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffp+53L, plus_infty, ERRNO_UNCHANGED),
313 TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffffep+63L, minus_infty, ERRNO_UNCHANGED),
314 TEST_ff_f (pow, minus_infty, 0x1.fffffffffffffffep+64L, plus_infty, ERRNO_UNCHANGED|XFAIL_ROUNDING_IBM128_LIBGCC),
316 TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffff8p+105L, minus_infty, ERRNO_UNCHANGED),
317 TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffff8p+106L, plus_infty, ERRNO_UNCHANGED|XFAIL_ROUNDING_IBM128_LIBGCC),
320 TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffffffp+112L, minus_infty, ERRNO_UNCHANGED),
321 TEST_ff_f (pow, minus_infty, 0x1.ffffffffffffffffffffffffffffp+113L, plus_infty, ERRNO_UNCHANGED),
325 /* pow (-inf, y) == +inf for y > 0 and not an odd integer. */
326 TEST_ff_f (pow, minus_infty, 0.5, plus_infty, ERRNO_UNCHANGED),
327 TEST_ff_f (pow, minus_infty, 28, plus_infty, ERRNO_UNCHANGED),
328 TEST_ff_f (pow, minus_infty, 0x1p24, plus_infty, ERRNO_UNCHANGED),
329 TEST_ff_f (pow, minus_infty, 0x1p127, plus_infty, ERRNO_UNCHANGED),
330 TEST_ff_f (pow, minus_infty, max_value, plus_infty, ERRNO_UNCHANGED),
332 /* pow (-inf, y) == -0 for y an odd integer < 0. */
333 TEST_ff_f (pow, minus_infty, -3, minus_zero, ERRNO_UNCHANGED),
334 TEST_ff_f (pow, minus_infty, -0xffffff, minus_zero, ERRNO_UNCHANGED),
335 TEST_ff_f (pow, minus_infty, -0x1fffffe, plus_zero, ERRNO_UNCHANGED),
336 #if !TEST_COND_binary32
337 TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffp+52L, minus_zero, ERRNO_UNCHANGED),
338 TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffp+53L, plus_zero, ERRNO_UNCHANGED),
341 TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffffep+63L, minus_zero, ERRNO_UNCHANGED),
342 TEST_ff_f (pow, minus_infty, -0x1.fffffffffffffffep+64L, plus_zero, ERRNO_UNCHANGED|XFAIL_ROUNDING_IBM128_LIBGCC),
344 TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffff8p+105L, minus_zero, ERRNO_UNCHANGED),
345 TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffff8p+106L, plus_zero, ERRNO_UNCHANGED|XFAIL_ROUNDING_IBM128_LIBGCC),
348 TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffffffp+112L, minus_zero, ERRNO_UNCHANGED),
349 TEST_ff_f (pow, minus_infty, -0x1.ffffffffffffffffffffffffffffp+113L, plus_zero, ERRNO_UNCHANGED),
352 /* pow (-inf, y) == +0 for y < 0 and not an odd integer. */
353 TEST_ff_f (pow, minus_infty, -2.0, 0.0, ERRNO_UNCHANGED),
354 TEST_ff_f (pow, minus_infty, -0x1p24, 0.0, ERRNO_UNCHANGED),
355 TEST_ff_f (pow, minus_infty, -0x1p127, 0.0, ERRNO_UNCHANGED),
356 TEST_ff_f (pow, minus_infty, -max_value, 0.0, ERRNO_UNCHANGED),
358 TEST_ff_f (pow, -max_value, 0.5, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
359 TEST_ff_f (pow, -max_value, 1.5, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
360 TEST_ff_f (pow, -max_value, 1000.5, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
362 TEST_ff_f (pow, -min_value, 0.5, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
363 TEST_ff_f (pow, -min_value, 1.5, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
364 TEST_ff_f (pow, -min_value, 1000.5, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
365 AUTO_TESTS_ff_f (pow),
371 ALL_RM_TEST (pow, 0, pow_test_data, RUN_TEST_LOOP_ff_f, END);