[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r23047 - in /fsf/trunk/libc: ChangeLog NEWS math/libm-test.inc
- To: commits@xxxxxxxxxx
- Subject: [Commits] r23047 - in /fsf/trunk/libc: ChangeLog NEWS math/libm-test.inc
- From: eglibc@xxxxxxxxxx
- Date: Sun, 12 May 2013 00:02:04 -0000
Author: eglibc
Date: Sun May 12 00:02:03 2013
New Revision: 23047
Log:
Import glibc-mainline for 2013-05-12
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/NEWS
fsf/trunk/libc/math/libm-test.inc
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun May 12 00:02:03 2013
@@ -1,3 +1,156 @@
+2013-05-11 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
+
+ * math/libm-test.inc (fma_test): Use max_value instead of local
+ variable fltmax.
+ (nextafter_test): Likewise.
+
+ * math/libm-test.inc (acos_towardzero_test_data): New variable.
+ (acos_test_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (acos_downward_test_data): New variable.
+ (acos_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (acos_upward_test_data): New variable.
+ (acos_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (acosh_test_data): New variable.
+ (acosh_test): Run tests with RUN_TEST_LOOP_f_f.
+ (asin_test_data): New variable.
+ (asin_test): Run tests with RUN_TEST_LOOP_f_f.
+ (asin_tonearest_test_data): New variable.
+ (asin_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+ (asin_towardzero_test_data): New variable.
+ (asin_test_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (asin_downward_test_data): New variable.
+ (asin_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (asin_upward_test_data): New variable.
+ (asin_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (asinh_test_data): New variable.
+ (asinh_test): Run tests with RUN_TEST_LOOP_f_f.
+ (atan_test_data): New variable.
+ (atan_test): Run tests with RUN_TEST_LOOP_f_f.
+ (atanh_test_data): New variable.
+ (atanh_test): Run tests with RUN_TEST_LOOP_f_f.
+ (cbrt_test_data): New variable.
+ (cbrt_test): Run tests with RUN_TEST_LOOP_f_f.
+ (ceil_test_data): New variable.
+ (ceil_test): Run tests with RUN_TEST_LOOP_f_f.
+ (cos_test_data): New variable.
+ (cos_test): Run tests with RUN_TEST_LOOP_f_f.
+ (cos_tonearest_test_data): New variable.
+ (cos_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+ (cos_towardzero_test_data): New variable.
+ (cos_test_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (cos_downward_test_data): New variable.
+ (cos_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (cos_upward_test_data): New variable.
+ (cos_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (cosh_test_data): New variable.
+ (cosh_test): Run tests with RUN_TEST_LOOP_f_f.
+ (cosh_tonearest_test_data): New variable.
+ (cosh_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+ (cosh_towardzero_test_data): New variable.
+ (cosh_test_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (cosh_downward_test_data): New variable.
+ (cosh_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (cosh_upward_test_data): New variable.
+ (cosh_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (erf_test_data): New variable.
+ (erf_test): Run tests with RUN_TEST_LOOP_f_f.
+ (erfc_test_data): New variable.
+ (erfc_test): Run tests with RUN_TEST_LOOP_f_f.
+ (exp_test_data): New variable.
+ (exp_test): Run tests with RUN_TEST_LOOP_f_f.
+ (exp_tonearest_test_data): New variable.
+ (exp_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+ (exp_towardzero_test_data): New variable.
+ (exp_test_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (exp_downward_test_data): New variable.
+ (exp_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (exp_upward_test_data): New variable.
+ (exp_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (exp10_test_data): New variable.
+ (exp10_test): Run tests with RUN_TEST_LOOP_f_f.
+ (exp2_test_data): New variable.
+ (exp2_test): Run tests with RUN_TEST_LOOP_f_f.
+ (expm1_test_data): New variable.
+ (expm1_test): Run tests with RUN_TEST_LOOP_f_f.
+ (fabs_test_data): New variable.
+ (fabs_test): Run tests with RUN_TEST_LOOP_f_f.
+ (floor_test_data): New variable.
+ (floor_test): Run tests with RUN_TEST_LOOP_f_f.
+ (j0_test_data): New variable.
+ (j0_test): Run tests with RUN_TEST_LOOP_f_f.
+ (j1_test_data): New variable.
+ (j1_test): Run tests with RUN_TEST_LOOP_f_f.
+ (log_test_data): New variable.
+ (log_test): Run tests with RUN_TEST_LOOP_f_f.
+ (log10_test_data): New variable.
+ (log10_test): Run tests with RUN_TEST_LOOP_f_f.
+ (log1p_test_data): New variable.
+ (log1p_test): Run tests with RUN_TEST_LOOP_f_f.
+ (log2_test_data): New variable.
+ (log2_test): Run tests with RUN_TEST_LOOP_f_f.
+ (logb_test_data): New variable.
+ (logb_test): Run tests with RUN_TEST_LOOP_f_f.
+ (logb_downward_test_data): New variable.
+ (logb_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (nearbyint_test_data): New variable.
+ (nearbyint_test): Run tests with RUN_TEST_LOOP_f_f.
+ (rint_test_data): New variable.
+ (rint_test): Run tests with RUN_TEST_LOOP_f_f.
+ (rint_tonearest_test_data): New variable.
+ (rint_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+ (rint_towardzero_test_data): New variable.
+ (rint_test_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (rint_downward_test_data): New variable.
+ (rint_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (rint_upward_test_data): New variable.
+ (rint_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (round_test_data): New variable.
+ (round_test): Run tests with RUN_TEST_LOOP_f_f.
+ (sin_test_data): New variable.
+ (sin_test): Run tests with RUN_TEST_LOOP_f_f.
+ (sin_tonearest_test_data): New variable.
+ (sin_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+ (sin_towardzero_test_data): New variable.
+ (sin_test_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (sin_downward_test_data): New variable.
+ (sin_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (sin_upward_test_data): New variable.
+ (sin_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (sinh_test_data): New variable.
+ (sinh_test): Run tests with RUN_TEST_LOOP_f_f.
+ (sinh_tonearest_test_data): New variable.
+ (sinh_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+ (sinh_towardzero_test_data): New variable.
+ (sinh_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (sinh_downward_test_data): New variable.
+ (sinh_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (sinh_upward_test_data): New variable.
+ (sinh_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (sqrt_test_data): New variable.
+ (sqrt_test): Run tests with RUN_TEST_LOOP_f_f.
+ (tan_test_data): New variable.
+ (tan_test): Run tests with RUN_TEST_LOOP_f_f.
+ (tan_tonearest_test_data): New variable.
+ (tan_test_tonearest): Run tests with RUN_TEST_LOOP_f_f.
+ (tan_towardzero_test_data): New variable.
+ (tan_test_towardzero): Run tests with RUN_TEST_LOOP_f_f.
+ (tan_downward_test_data): New variable.
+ (tan_test_downward): Run tests with RUN_TEST_LOOP_f_f.
+ (tan_upward_test_data): New variable.
+ (tan_test_upward): Run tests with RUN_TEST_LOOP_f_f.
+ (tanh_test_data): New variable.
+ (tanh_test): Run tests with RUN_TEST_LOOP_f_f.
+ (tgamma_test_data): New variable.
+ (tgamma_test): Run tests with RUN_TEST_LOOP_f_f.
+ (trunc_test_data): New variable.
+ (trunc_test): Run tests with RUN_TEST_LOOP_f_f.
+ (y0_test_data): New variable.
+ (y0_test): Run tests with RUN_TEST_LOOP_f_f.
+ (y1_test_data): New variable.
+ (y1_test): Run tests with RUN_TEST_LOOP_f_f.
+ (significand_test_data): New variable.
+ (significand_test): Run tests with RUN_TEST_LOOP_f_f.
+
2013-05-10 Christian GrÃÂnke <cgr_bugs@xxxxxxxxx>
[BZ #12387]
@@ -11016,6 +11169,7 @@
2012-07-31 Roland McGrath <roland@xxxxxxxxxxxxx>
+ [BZ #10191]
* include/sys/socket.h (__libc_accept, __libc_accept4):
Add attribute_hidden.
* socket/accept4.c (__libc_accept4): Remove libc_hidden_def.
Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sun May 12 00:02:03 2013
@@ -45,20 +45,20 @@
* The following bugs are resolved with this release:
1349, 3439, 3479, 3665, 5044, 5246, 5298, 5400, 6530, 6677, 6778, 6808,
- 9685, 9914, 10014, 10038, 10114, 10631, 10873, 11438, 11607, 11638, 11741,
- 12140, 13013, 13412, 13542, 13601, 13603, 13604, 13629, 13679, 13696,
- 13698, 13717, 13741, 13759, 13761, 13763, 13881, 13939, 13950, 13952,
- 13966, 14042, 14047, 14090, 14150, 14151, 14152, 14154, 14157, 14166,
- 14173, 14195, 14197, 14237, 14246, 14251, 14252, 14283, 14298, 14303,
- 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14368, 14376, 14417,
- 14447, 14459, 14476, 14477, 14501, 14505, 14510, 14516, 14518, 14519,
- 14530, 14532, 14538, 14543, 14544, 14545, 14557, 14562, 14568, 14576,
- 14579, 14583, 14587, 14595, 14602, 14610, 14621, 14638, 14645, 14648,
- 14652, 14660, 14661, 14669, 14672, 14683, 14694, 14716, 14719, 14743,
- 14767, 14783, 14784, 14785, 14793, 14796, 14797, 14801, 14803, 14805,
- 14807, 14811, 14815, 14821, 14822, 14824, 14828, 14831, 14833, 14835,
- 14838, 14856, 14863, 14865, 14866, 14868, 14869, 14871, 14872, 14879,
- 14889, 14893, 14898, 14914.
+ 9685, 9914, 10014, 10038, 10114, 10191, 10631, 10873, 11438, 11607, 11638,
+ 11741, 12140, 13013, 13412, 13542, 13601, 13603, 13604, 13629, 13679,
+ 13696, 13698, 13717, 13741, 13759, 13761, 13763, 13881, 13939, 13950,
+ 13952, 13966, 14042, 14047, 14090, 14150, 14151, 14152, 14154, 14157,
+ 14166, 14173, 14195, 14197, 14237, 14246, 14251, 14252, 14283, 14298,
+ 14303, 14307, 14328, 14331, 14336, 14337, 14347, 14349, 14368, 14376,
+ 14417, 14447, 14459, 14476, 14477, 14501, 14505, 14510, 14516, 14518,
+ 14519, 14530, 14532, 14538, 14543, 14544, 14545, 14557, 14562, 14568,
+ 14576, 14579, 14583, 14587, 14595, 14602, 14610, 14621, 14638, 14645,
+ 14648, 14652, 14660, 14661, 14669, 14672, 14683, 14694, 14716, 14719,
+ 14743, 14767, 14783, 14784, 14785, 14793, 14796, 14797, 14801, 14803,
+ 14805, 14807, 14811, 14815, 14821, 14822, 14824, 14828, 14831, 14833,
+ 14835, 14838, 14856, 14863, 14865, 14866, 14868, 14869, 14871, 14872,
+ 14879, 14889, 14893, 14898, 14914.
* Optimization of memcpy for MIPS.
Modified: fsf/trunk/libc/math/libm-test.inc
==============================================================================
--- fsf/trunk/libc/math/libm-test.inc (original)
+++ fsf/trunk/libc/math/libm-test.inc Sun May 12 00:02:03 2013
@@ -1132,10 +1132,21 @@
}
+static const struct test_f_f_data acos_towardzero_test_data[] =
+ {
+ START_DATA (acos_towardzero),
+ TEST_f_f (acos, 0, M_PI_2l),
+ TEST_f_f (acos, minus_zero, M_PI_2l),
+ TEST_f_f (acos, 1, 0),
+ TEST_f_f (acos, -1, M_PIl),
+ TEST_f_f (acos, 0.5, M_PI_6l*2.0),
+ TEST_f_f (acos, -0.5, M_PI_6l*4.0),
+ END_DATA (acos_towardzero)
+ };
+
static void
acos_test_towardzero (void)
{
- int save_round_mode;
errno = 0;
FUNC(acos) (0);
if (errno == ENOSYS)
@@ -1143,29 +1154,26 @@
return;
START (acos_towardzero);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TOWARDZERO))
- {
- TEST_f_f (acos, 0, M_PI_2l);
- TEST_f_f (acos, minus_zero, M_PI_2l);
- TEST_f_f (acos, 1, 0);
- TEST_f_f (acos, -1, M_PIl);
- TEST_f_f (acos, 0.5, M_PI_6l*2.0);
- TEST_f_f (acos, -0.5, M_PI_6l*4.0);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (acos, acos_towardzero_test_data, FE_TOWARDZERO);
END (acos_towardzero);
}
+static const struct test_f_f_data acos_downward_test_data[] =
+ {
+ START_DATA (acos_downward),
+ TEST_f_f (acos, 0, M_PI_2l),
+ TEST_f_f (acos, minus_zero, M_PI_2l),
+ TEST_f_f (acos, 1, 0),
+ TEST_f_f (acos, -1, M_PIl),
+ TEST_f_f (acos, 0.5, M_PI_6l*2.0),
+ TEST_f_f (acos, -0.5, M_PI_6l*4.0),
+ END_DATA (acos_downward)
+ };
+
static void
acos_test_downward (void)
{
- int save_round_mode;
errno = 0;
FUNC(acos) (0);
if (errno == ENOSYS)
@@ -1173,29 +1181,26 @@
return;
START (acos_downward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_DOWNWARD))
- {
- TEST_f_f (acos, 0, M_PI_2l);
- TEST_f_f (acos, minus_zero, M_PI_2l);
- TEST_f_f (acos, 1, 0);
- TEST_f_f (acos, -1, M_PIl);
- TEST_f_f (acos, 0.5, M_PI_6l*2.0);
- TEST_f_f (acos, -0.5, M_PI_6l*4.0);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (acos, acos_downward_test_data, FE_DOWNWARD);
END (acos_downward);
}
+static const struct test_f_f_data acos_upward_test_data[] =
+ {
+ START_DATA (acos_upward),
+ TEST_f_f (acos, 0, M_PI_2l),
+ TEST_f_f (acos, minus_zero, M_PI_2l),
+ TEST_f_f (acos, 1, 0),
+ TEST_f_f (acos, -1, M_PIl),
+ TEST_f_f (acos, 0.5, M_PI_6l*2.0),
+ TEST_f_f (acos, -0.5, M_PI_6l*4.0),
+ END_DATA (acos_upward)
+ };
+
static void
acos_test_upward (void)
{
- int save_round_mode;
errno = 0;
FUNC(acos) (0);
if (errno == ENOSYS)
@@ -1203,23 +1208,25 @@
return;
START (acos_upward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_UPWARD))
- {
- TEST_f_f (acos, 0, M_PI_2l);
- TEST_f_f (acos, minus_zero, M_PI_2l);
- TEST_f_f (acos, 1, 0);
- TEST_f_f (acos, -1, M_PIl);
- TEST_f_f (acos, 0.5, M_PI_6l*2.0);
- TEST_f_f (acos, -0.5, M_PI_6l*4.0);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (acos, acos_upward_test_data, FE_UPWARD);
END (acos_upward);
}
+
+static const struct test_f_f_data acosh_test_data[] =
+ {
+ START_DATA (acosh),
+ TEST_f_f (acosh, plus_infty, plus_infty),
+ TEST_f_f (acosh, minus_infty, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (acosh, qnan_value, qnan_value),
+
+ /* x < 1: */
+ TEST_f_f (acosh, -1.125L, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (acosh, -max_value, qnan_value, INVALID_EXCEPTION),
+
+ TEST_f_f (acosh, 1, 0),
+ TEST_f_f (acosh, 7, 2.63391579384963341725009269461593689L),
+ END_DATA (acosh)
+ };
static void
acosh_test (void)
@@ -1231,20 +1238,44 @@
return;
START (acosh);
-
- TEST_f_f (acosh, plus_infty, plus_infty);
- TEST_f_f (acosh, minus_infty, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (acosh, qnan_value, qnan_value);
-
- /* x < 1: */
- TEST_f_f (acosh, -1.125L, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (acosh, -max_value, qnan_value, INVALID_EXCEPTION);
-
- TEST_f_f (acosh, 1, 0);
- TEST_f_f (acosh, 7, 2.63391579384963341725009269461593689L);
-
+ RUN_TEST_LOOP_f_f (acosh, acosh_test_data, );
END (acosh);
}
+
+static const struct test_f_f_data asin_test_data[] =
+ {
+ START_DATA (asin),
+ TEST_f_f (asin, plus_infty, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (asin, minus_infty, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (asin, qnan_value, qnan_value),
+
+ /* asin x == qNaN plus invalid exception for |x| > 1. */
+ TEST_f_f (asin, 1.125L, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (asin, -1.125L, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (asin, max_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (asin, -max_value, qnan_value, INVALID_EXCEPTION),
+
+ TEST_f_f (asin, 0, 0),
+ TEST_f_f (asin, minus_zero, minus_zero),
+ TEST_f_f (asin, 0.5, M_PI_6l),
+ TEST_f_f (asin, -0.5, -M_PI_6l),
+ TEST_f_f (asin, 1.0, M_PI_2l),
+ TEST_f_f (asin, -1.0, -M_PI_2l),
+ TEST_f_f (asin, 0.75L, 0.848062078981481008052944338998418080L),
+ TEST_f_f (asin, 0x0.ffffffp0L, 1.5704510598101804156437184421571127056013L),
+ TEST_f_f (asin, -0x0.ffffffp0L, -1.5704510598101804156437184421571127056013L),
+#ifndef TEST_FLOAT
+ TEST_f_f (asin, 0x0.ffffffff8p0L, 1.5707810680058339712015850710748035974710L),
+ TEST_f_f (asin, -0x0.ffffffff8p0L, -1.5707810680058339712015850710748035974710L),
+ TEST_f_f (asin, 0x0.ffffffffffffp0L, 1.5707962425011995974432331617542781977068L),
+ TEST_f_f (asin, -0x0.ffffffffffffp0L, -1.5707962425011995974432331617542781977068L),
+#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
+ TEST_f_f (asin, 0x0.ffffffffffffffffp0L, 1.5707963264656243652399620683025688888978L),
+ TEST_f_f (asin, -0x0.ffffffffffffffffp0L, -1.5707963264656243652399620683025688888978L),
+#endif
+ END_DATA (asin)
+ };
static void
asin_test (void)
@@ -1256,45 +1287,26 @@
return;
START (asin);
-
- TEST_f_f (asin, plus_infty, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (asin, minus_infty, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (asin, qnan_value, qnan_value);
-
- /* asin x == qNaN plus invalid exception for |x| > 1. */
- TEST_f_f (asin, 1.125L, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (asin, -1.125L, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (asin, max_value, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (asin, -max_value, qnan_value, INVALID_EXCEPTION);
-
- TEST_f_f (asin, 0, 0);
- TEST_f_f (asin, minus_zero, minus_zero);
- TEST_f_f (asin, 0.5, M_PI_6l);
- TEST_f_f (asin, -0.5, -M_PI_6l);
- TEST_f_f (asin, 1.0, M_PI_2l);
- TEST_f_f (asin, -1.0, -M_PI_2l);
- TEST_f_f (asin, 0.75L, 0.848062078981481008052944338998418080L);
- TEST_f_f (asin, 0x0.ffffffp0L, 1.5704510598101804156437184421571127056013L);
- TEST_f_f (asin, -0x0.ffffffp0L, -1.5704510598101804156437184421571127056013L);
-#ifndef TEST_FLOAT
- TEST_f_f (asin, 0x0.ffffffff8p0L, 1.5707810680058339712015850710748035974710L);
- TEST_f_f (asin, -0x0.ffffffff8p0L, -1.5707810680058339712015850710748035974710L);
- TEST_f_f (asin, 0x0.ffffffffffffp0L, 1.5707962425011995974432331617542781977068L);
- TEST_f_f (asin, -0x0.ffffffffffffp0L, -1.5707962425011995974432331617542781977068L);
-#endif
-#if defined TEST_LDOUBLE && LDBL_MANT_DIG >= 64
- TEST_f_f (asin, 0x0.ffffffffffffffffp0L, 1.5707963264656243652399620683025688888978L);
- TEST_f_f (asin, -0x0.ffffffffffffffffp0L, -1.5707963264656243652399620683025688888978L);
-#endif
-
+ RUN_TEST_LOOP_f_f (asin, asin_test_data, );
END (asin);
}
+static const struct test_f_f_data asin_tonearest_test_data[] =
+ {
+ START_DATA (asin_tonearest),
+ TEST_f_f (asin, 0, 0),
+ TEST_f_f (asin, minus_zero, minus_zero),
+ TEST_f_f (asin, 0.5, M_PI_6l),
+ TEST_f_f (asin, -0.5, -M_PI_6l),
+ TEST_f_f (asin, 1.0, M_PI_2l),
+ TEST_f_f (asin, -1.0, -M_PI_2l),
+ END_DATA (asin_tonearest)
+ };
+
static void
asin_test_tonearest (void)
{
- int save_round_mode;
errno = 0;
FUNC(asin) (0);
if (errno == ENOSYS)
@@ -1302,29 +1314,26 @@
return;
START (asin_tonearest);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TONEAREST))
- {
- TEST_f_f (asin, 0, 0);
- TEST_f_f (asin, minus_zero, minus_zero);
- TEST_f_f (asin, 0.5, M_PI_6l);
- TEST_f_f (asin, -0.5, -M_PI_6l);
- TEST_f_f (asin, 1.0, M_PI_2l);
- TEST_f_f (asin, -1.0, -M_PI_2l);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (asin, asin_tonearest_test_data, FE_TONEAREST);
END (asin_tonearest);
}
+static const struct test_f_f_data asin_towardzero_test_data[] =
+ {
+ START_DATA (asin_towardzero),
+ TEST_f_f (asin, 0, 0),
+ TEST_f_f (asin, minus_zero, minus_zero),
+ TEST_f_f (asin, 0.5, M_PI_6l),
+ TEST_f_f (asin, -0.5, -M_PI_6l),
+ TEST_f_f (asin, 1.0, M_PI_2l),
+ TEST_f_f (asin, -1.0, -M_PI_2l),
+ END_DATA (asin_towardzero)
+ };
+
static void
asin_test_towardzero (void)
{
- int save_round_mode;
errno = 0;
FUNC(asin) (0);
if (errno == ENOSYS)
@@ -1332,29 +1341,26 @@
return;
START (asin_towardzero);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TOWARDZERO))
- {
- TEST_f_f (asin, 0, 0);
- TEST_f_f (asin, minus_zero, minus_zero);
- TEST_f_f (asin, 0.5, M_PI_6l);
- TEST_f_f (asin, -0.5, -M_PI_6l);
- TEST_f_f (asin, 1.0, M_PI_2l);
- TEST_f_f (asin, -1.0, -M_PI_2l);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (asin, asin_towardzero_test_data, FE_TOWARDZERO);
END (asin_towardzero);
}
+static const struct test_f_f_data asin_downward_test_data[] =
+ {
+ START_DATA (asin_downward),
+ TEST_f_f (asin, 0, 0),
+ TEST_f_f (asin, minus_zero, minus_zero),
+ TEST_f_f (asin, 0.5, M_PI_6l),
+ TEST_f_f (asin, -0.5, -M_PI_6l),
+ TEST_f_f (asin, 1.0, M_PI_2l),
+ TEST_f_f (asin, -1.0, -M_PI_2l),
+ END_DATA (asin_downward)
+ };
+
static void
asin_test_downward (void)
{
- int save_round_mode;
errno = 0;
FUNC(asin) (0);
if (errno == ENOSYS)
@@ -1362,29 +1368,26 @@
return;
START (asin_downward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_DOWNWARD))
- {
- TEST_f_f (asin, 0, 0);
- TEST_f_f (asin, minus_zero, minus_zero);
- TEST_f_f (asin, 0.5, M_PI_6l);
- TEST_f_f (asin, -0.5, -M_PI_6l);
- TEST_f_f (asin, 1.0, M_PI_2l);
- TEST_f_f (asin, -1.0, -M_PI_2l);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (asin, asin_downward_test_data, FE_DOWNWARD);
END (asin_downward);
}
+static const struct test_f_f_data asin_upward_test_data[] =
+ {
+ START_DATA (asin_upward),
+ TEST_f_f (asin, 0, 0),
+ TEST_f_f (asin, minus_zero, minus_zero),
+ TEST_f_f (asin, 0.5, M_PI_6l),
+ TEST_f_f (asin, -0.5, -M_PI_6l),
+ TEST_f_f (asin, 1.0, M_PI_2l),
+ TEST_f_f (asin, -1.0, -M_PI_2l),
+ END_DATA (asin_upward)
+ };
+
static void
asin_test_upward (void)
{
- int save_round_mode;
errno = 0;
FUNC(asin) (0);
if (errno == ENOSYS)
@@ -1392,23 +1395,23 @@
return;
START (asin_upward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_UPWARD))
- {
- TEST_f_f (asin, 0, 0);
- TEST_f_f (asin, minus_zero, minus_zero);
- TEST_f_f (asin, 0.5, M_PI_6l);
- TEST_f_f (asin, -0.5, -M_PI_6l);
- TEST_f_f (asin, 1.0, M_PI_2l);
- TEST_f_f (asin, -1.0, -M_PI_2l);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (asin, asin_upward_test_data, FE_UPWARD);
END (asin_upward);
}
+
+static const struct test_f_f_data asinh_test_data[] =
+ {
+ START_DATA (asinh),
+ TEST_f_f (asinh, 0, 0),
+ TEST_f_f (asinh, minus_zero, minus_zero),
+#ifndef TEST_INLINE
+ TEST_f_f (asinh, plus_infty, plus_infty),
+ TEST_f_f (asinh, minus_infty, minus_infty),
+#endif
+ TEST_f_f (asinh, qnan_value, qnan_value),
+ TEST_f_f (asinh, 0.75L, 0.693147180559945309417232121458176568L),
+ END_DATA (asinh)
+ };
static void
asinh_test (void)
@@ -1420,18 +1423,36 @@
return;
START (asinh);
-
- TEST_f_f (asinh, 0, 0);
- TEST_f_f (asinh, minus_zero, minus_zero);
-#ifndef TEST_INLINE
- TEST_f_f (asinh, plus_infty, plus_infty);
- TEST_f_f (asinh, minus_infty, minus_infty);
-#endif
- TEST_f_f (asinh, qnan_value, qnan_value);
- TEST_f_f (asinh, 0.75L, 0.693147180559945309417232121458176568L);
-
+ RUN_TEST_LOOP_f_f (asinh, asinh_test_data, );
END (asinh);
}
+
+static const struct test_f_f_data atan_test_data[] =
+ {
+ START_DATA (atan),
+ TEST_f_f (atan, 0, 0),
+ TEST_f_f (atan, minus_zero, minus_zero),
+
+ TEST_f_f (atan, plus_infty, M_PI_2l),
+ TEST_f_f (atan, minus_infty, -M_PI_2l),
+ TEST_f_f (atan, qnan_value, qnan_value),
+ TEST_f_f (atan, max_value, M_PI_2l),
+ TEST_f_f (atan, -max_value, -M_PI_2l),
+
+ TEST_f_f (atan, 1, M_PI_4l),
+ TEST_f_f (atan, -1, -M_PI_4l),
+
+ TEST_f_f (atan, 0.75L, 0.643501108793284386802809228717322638L),
+
+ TEST_f_f (atan, 0x1p-100L, 0x1p-100L),
+#ifndef TEST_FLOAT
+ TEST_f_f (atan, 0x1p-600L, 0x1p-600L),
+#endif
+#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
+ TEST_f_f (atan, 0x1p-10000L, 0x1p-10000L),
+#endif
+ END_DATA (atan)
+ };
static void
atan_test (void)
@@ -1443,33 +1464,31 @@
return;
START (atan);
-
- TEST_f_f (atan, 0, 0);
- TEST_f_f (atan, minus_zero, minus_zero);
-
- TEST_f_f (atan, plus_infty, M_PI_2l);
- TEST_f_f (atan, minus_infty, -M_PI_2l);
- TEST_f_f (atan, qnan_value, qnan_value);
- TEST_f_f (atan, max_value, M_PI_2l);
- TEST_f_f (atan, -max_value, -M_PI_2l);
-
- TEST_f_f (atan, 1, M_PI_4l);
- TEST_f_f (atan, -1, -M_PI_4l);
-
- TEST_f_f (atan, 0.75L, 0.643501108793284386802809228717322638L);
-
- TEST_f_f (atan, 0x1p-100L, 0x1p-100L);
-#ifndef TEST_FLOAT
- TEST_f_f (atan, 0x1p-600L, 0x1p-600L);
-#endif
-#if defined TEST_LDOUBLE && LDBL_MIN_EXP <= -16381
- TEST_f_f (atan, 0x1p-10000L, 0x1p-10000L);
-#endif
-
+ RUN_TEST_LOOP_f_f (atan, atan_test_data, );
END (atan);
}
+
+static const struct test_f_f_data atanh_test_data[] =
+ {
+ START_DATA (atanh),
+ TEST_f_f (atanh, 0, 0),
+ TEST_f_f (atanh, minus_zero, minus_zero),
+
+ TEST_f_f (atanh, 1, plus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+ TEST_f_f (atanh, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+ TEST_f_f (atanh, qnan_value, qnan_value),
+
+ /* atanh (x) == qNaN plus invalid exception if |x| > 1. */
+ TEST_f_f (atanh, 1.125L, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (atanh, -1.125L, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (atanh, max_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (atanh, -max_value, qnan_value, INVALID_EXCEPTION),
+
+ TEST_f_f (atanh, 0.75L, 0.972955074527656652552676371721589865L),
+ END_DATA (atanh)
+ };
static void
atanh_test (void)
@@ -1481,23 +1500,7 @@
return;
START (atanh);
-
-
- TEST_f_f (atanh, 0, 0);
- TEST_f_f (atanh, minus_zero, minus_zero);
-
- TEST_f_f (atanh, 1, plus_infty, DIVIDE_BY_ZERO_EXCEPTION);
- TEST_f_f (atanh, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
- TEST_f_f (atanh, qnan_value, qnan_value);
-
- /* atanh (x) == qNaN plus invalid exception if |x| > 1. */
- TEST_f_f (atanh, 1.125L, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (atanh, -1.125L, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (atanh, max_value, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (atanh, -max_value, qnan_value, INVALID_EXCEPTION);
-
- TEST_f_f (atanh, 0.75L, 0.972955074527656652552676371721589865L);
-
+ RUN_TEST_LOOP_f_f (atanh, atanh_test_data, );
END (atanh);
}
@@ -5500,6 +5503,24 @@
END (catanh, complex);
}
+static const struct test_f_f_data cbrt_test_data[] =
+ {
+ START_DATA (cbrt),
+ TEST_f_f (cbrt, 0.0, 0.0),
+ TEST_f_f (cbrt, minus_zero, minus_zero),
+
+ TEST_f_f (cbrt, plus_infty, plus_infty),
+ TEST_f_f (cbrt, minus_infty, minus_infty),
+ TEST_f_f (cbrt, qnan_value, qnan_value),
+
+ TEST_f_f (cbrt, -0.001L, -0.1L),
+ TEST_f_f (cbrt, 8, 2),
+ TEST_f_f (cbrt, -27.0, -3.0),
+ TEST_f_f (cbrt, 0.9921875L, 0.997389022060725270579075195353955217L),
+ TEST_f_f (cbrt, 0.75L, 0.908560296416069829445605878163630251L),
+ END_DATA (cbrt)
+ };
+
static void
cbrt_test (void)
{
@@ -5510,20 +5531,7 @@
return;
START (cbrt);
-
- TEST_f_f (cbrt, 0.0, 0.0);
- TEST_f_f (cbrt, minus_zero, minus_zero);
-
- TEST_f_f (cbrt, plus_infty, plus_infty);
- TEST_f_f (cbrt, minus_infty, minus_infty);
- TEST_f_f (cbrt, qnan_value, qnan_value);
-
- TEST_f_f (cbrt, -0.001L, -0.1L);
- TEST_f_f (cbrt, 8, 2);
- TEST_f_f (cbrt, -27.0, -3.0);
- TEST_f_f (cbrt, 0.9921875L, 0.997389022060725270579075195353955217L);
- TEST_f_f (cbrt, 0.75L, 0.908560296416069829445605878163630251L);
-
+ RUN_TEST_LOOP_f_f (cbrt, cbrt_test_data, );
END (cbrt);
}
@@ -5733,96 +5741,101 @@
}
+static const struct test_f_f_data ceil_test_data[] =
+ {
+ START_DATA (ceil),
+ TEST_f_f (ceil, 0.0, 0.0),
+ TEST_f_f (ceil, minus_zero, minus_zero),
+ TEST_f_f (ceil, plus_infty, plus_infty),
+ TEST_f_f (ceil, minus_infty, minus_infty),
+ TEST_f_f (ceil, qnan_value, qnan_value),
+
+ TEST_f_f (ceil, M_PIl, 4.0),
+ TEST_f_f (ceil, -M_PIl, -3.0),
+ TEST_f_f (ceil, 0.1, 1.0),
+ TEST_f_f (ceil, 0.25, 1.0),
+ TEST_f_f (ceil, 0.625, 1.0),
+ TEST_f_f (ceil, -0.1, minus_zero),
+ TEST_f_f (ceil, -0.25, minus_zero),
+ TEST_f_f (ceil, -0.625, minus_zero),
+
+#ifdef TEST_LDOUBLE
+ /* The result can only be represented in long double. */
+ TEST_f_f (ceil, 4503599627370495.5L, 4503599627370496.0L),
+ TEST_f_f (ceil, 4503599627370496.25L, 4503599627370497.0L),
+ TEST_f_f (ceil, 4503599627370496.5L, 4503599627370497.0L),
+ TEST_f_f (ceil, 4503599627370496.75L, 4503599627370497.0L),
+ TEST_f_f (ceil, 4503599627370497.5L, 4503599627370498.0L),
+
+ TEST_f_f (ceil, -4503599627370495.5L, -4503599627370495.0L),
+ TEST_f_f (ceil, -4503599627370496.25L, -4503599627370496.0L),
+ TEST_f_f (ceil, -4503599627370496.5L, -4503599627370496.0L),
+ TEST_f_f (ceil, -4503599627370496.75L, -4503599627370496.0L),
+ TEST_f_f (ceil, -4503599627370497.5L, -4503599627370497.0L),
+
+# if LDBL_MANT_DIG > 100
+ TEST_f_f (ceil, 4503599627370494.5000000000001L, 4503599627370495.0L),
+ TEST_f_f (ceil, 4503599627370495.5000000000001L, 4503599627370496.0L),
+ TEST_f_f (ceil, 4503599627370496.5000000000001L, 4503599627370497.0L),
+ TEST_f_f (ceil, -4503599627370494.5000000000001L, -4503599627370494.0L),
+ TEST_f_f (ceil, -4503599627370495.5000000000001L, -4503599627370495.0L),
+ TEST_f_f (ceil, -4503599627370496.5000000000001L, -4503599627370496.0L),
+# endif
+
+ TEST_f_f (ceil, 9007199254740991.5L, 9007199254740992.0L),
+ TEST_f_f (ceil, 9007199254740992.25L, 9007199254740993.0L),
+ TEST_f_f (ceil, 9007199254740992.5L, 9007199254740993.0L),
+ TEST_f_f (ceil, 9007199254740992.75L, 9007199254740993.0L),
+ TEST_f_f (ceil, 9007199254740993.5L, 9007199254740994.0L),
+
+ TEST_f_f (ceil, -9007199254740991.5L, -9007199254740991.0L),
+ TEST_f_f (ceil, -9007199254740992.25L, -9007199254740992.0L),
+ TEST_f_f (ceil, -9007199254740992.5L, -9007199254740992.0L),
+ TEST_f_f (ceil, -9007199254740992.75L, -9007199254740992.0L),
+ TEST_f_f (ceil, -9007199254740993.5L, -9007199254740993.0L),
+
+# if LDBL_MANT_DIG > 100
+ TEST_f_f (ceil, 9007199254740991.0000000000001L, 9007199254740992.0L),
+ TEST_f_f (ceil, 9007199254740992.0000000000001L, 9007199254740993.0L),
+ TEST_f_f (ceil, 9007199254740993.0000000000001L, 9007199254740994.0L),
+ TEST_f_f (ceil, 9007199254740991.5000000000001L, 9007199254740992.0L),
+ TEST_f_f (ceil, 9007199254740992.5000000000001L, 9007199254740993.0L),
+ TEST_f_f (ceil, 9007199254740993.5000000000001L, 9007199254740994.0L),
+
+ TEST_f_f (ceil, -9007199254740991.0000000000001L, -9007199254740991.0L),
+ TEST_f_f (ceil, -9007199254740992.0000000000001L, -9007199254740992.0L),
+ TEST_f_f (ceil, -9007199254740993.0000000000001L, -9007199254740993.0L),
+ TEST_f_f (ceil, -9007199254740991.5000000000001L, -9007199254740991.0L),
+ TEST_f_f (ceil, -9007199254740992.5000000000001L, -9007199254740992.0L),
+ TEST_f_f (ceil, -9007199254740993.5000000000001L, -9007199254740993.0L),
+# endif
+
+ TEST_f_f (ceil, 72057594037927935.5L, 72057594037927936.0L),
+ TEST_f_f (ceil, 72057594037927936.25L, 72057594037927937.0L),
+ TEST_f_f (ceil, 72057594037927936.5L, 72057594037927937.0L),
+ TEST_f_f (ceil, 72057594037927936.75L, 72057594037927937.0L),
+ TEST_f_f (ceil, 72057594037927937.5L, 72057594037927938.0L),
+
+ TEST_f_f (ceil, -72057594037927935.5L, -72057594037927935.0L),
+ TEST_f_f (ceil, -72057594037927936.25L, -72057594037927936.0L),
+ TEST_f_f (ceil, -72057594037927936.5L, -72057594037927936.0L),
+ TEST_f_f (ceil, -72057594037927936.75L, -72057594037927936.0L),
+ TEST_f_f (ceil, -72057594037927937.5L, -72057594037927937.0L),
+
+ TEST_f_f (ceil, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L),
+ TEST_f_f (ceil, 10141204801825835211973625643008.25L, 10141204801825835211973625643009.0L),
+ TEST_f_f (ceil, 10141204801825835211973625643008.5L, 10141204801825835211973625643009.0L),
+ TEST_f_f (ceil, 10141204801825835211973625643008.75L, 10141204801825835211973625643009.0L),
+ TEST_f_f (ceil, 10141204801825835211973625643009.5L, 10141204801825835211973625643010.0L),
+#endif
+ END_DATA (ceil)
+ };
+
static void
ceil_test (void)
{
START (ceil);
-
- TEST_f_f (ceil, 0.0, 0.0);
- TEST_f_f (ceil, minus_zero, minus_zero);
- TEST_f_f (ceil, plus_infty, plus_infty);
- TEST_f_f (ceil, minus_infty, minus_infty);
- TEST_f_f (ceil, qnan_value, qnan_value);
-
- TEST_f_f (ceil, M_PIl, 4.0);
- TEST_f_f (ceil, -M_PIl, -3.0);
- TEST_f_f (ceil, 0.1, 1.0);
- TEST_f_f (ceil, 0.25, 1.0);
- TEST_f_f (ceil, 0.625, 1.0);
- TEST_f_f (ceil, -0.1, minus_zero);
- TEST_f_f (ceil, -0.25, minus_zero);
- TEST_f_f (ceil, -0.625, minus_zero);
-
-#ifdef TEST_LDOUBLE
- /* The result can only be represented in long double. */
- TEST_f_f (ceil, 4503599627370495.5L, 4503599627370496.0L);
- TEST_f_f (ceil, 4503599627370496.25L, 4503599627370497.0L);
- TEST_f_f (ceil, 4503599627370496.5L, 4503599627370497.0L);
- TEST_f_f (ceil, 4503599627370496.75L, 4503599627370497.0L);
- TEST_f_f (ceil, 4503599627370497.5L, 4503599627370498.0L);
-
- TEST_f_f (ceil, -4503599627370495.5L, -4503599627370495.0L);
- TEST_f_f (ceil, -4503599627370496.25L, -4503599627370496.0L);
- TEST_f_f (ceil, -4503599627370496.5L, -4503599627370496.0L);
- TEST_f_f (ceil, -4503599627370496.75L, -4503599627370496.0L);
- TEST_f_f (ceil, -4503599627370497.5L, -4503599627370497.0L);
-
-# if LDBL_MANT_DIG > 100
- TEST_f_f (ceil, 4503599627370494.5000000000001L, 4503599627370495.0L);
- TEST_f_f (ceil, 4503599627370495.5000000000001L, 4503599627370496.0L);
- TEST_f_f (ceil, 4503599627370496.5000000000001L, 4503599627370497.0L);
- TEST_f_f (ceil, -4503599627370494.5000000000001L, -4503599627370494.0L);
- TEST_f_f (ceil, -4503599627370495.5000000000001L, -4503599627370495.0L);
- TEST_f_f (ceil, -4503599627370496.5000000000001L, -4503599627370496.0L);
-# endif
-
- TEST_f_f (ceil, 9007199254740991.5L, 9007199254740992.0L);
- TEST_f_f (ceil, 9007199254740992.25L, 9007199254740993.0L);
- TEST_f_f (ceil, 9007199254740992.5L, 9007199254740993.0L);
- TEST_f_f (ceil, 9007199254740992.75L, 9007199254740993.0L);
- TEST_f_f (ceil, 9007199254740993.5L, 9007199254740994.0L);
-
- TEST_f_f (ceil, -9007199254740991.5L, -9007199254740991.0L);
- TEST_f_f (ceil, -9007199254740992.25L, -9007199254740992.0L);
- TEST_f_f (ceil, -9007199254740992.5L, -9007199254740992.0L);
- TEST_f_f (ceil, -9007199254740992.75L, -9007199254740992.0L);
- TEST_f_f (ceil, -9007199254740993.5L, -9007199254740993.0L);
-
-# if LDBL_MANT_DIG > 100
- TEST_f_f (ceil, 9007199254740991.0000000000001L, 9007199254740992.0L);
- TEST_f_f (ceil, 9007199254740992.0000000000001L, 9007199254740993.0L);
- TEST_f_f (ceil, 9007199254740993.0000000000001L, 9007199254740994.0L);
- TEST_f_f (ceil, 9007199254740991.5000000000001L, 9007199254740992.0L);
- TEST_f_f (ceil, 9007199254740992.5000000000001L, 9007199254740993.0L);
- TEST_f_f (ceil, 9007199254740993.5000000000001L, 9007199254740994.0L);
-
- TEST_f_f (ceil, -9007199254740991.0000000000001L, -9007199254740991.0L);
- TEST_f_f (ceil, -9007199254740992.0000000000001L, -9007199254740992.0L);
- TEST_f_f (ceil, -9007199254740993.0000000000001L, -9007199254740993.0L);
- TEST_f_f (ceil, -9007199254740991.5000000000001L, -9007199254740991.0L);
- TEST_f_f (ceil, -9007199254740992.5000000000001L, -9007199254740992.0L);
- TEST_f_f (ceil, -9007199254740993.5000000000001L, -9007199254740993.0L);
-# endif
-
- TEST_f_f (ceil, 72057594037927935.5L, 72057594037927936.0L);
- TEST_f_f (ceil, 72057594037927936.25L, 72057594037927937.0L);
- TEST_f_f (ceil, 72057594037927936.5L, 72057594037927937.0L);
- TEST_f_f (ceil, 72057594037927936.75L, 72057594037927937.0L);
- TEST_f_f (ceil, 72057594037927937.5L, 72057594037927938.0L);
-
- TEST_f_f (ceil, -72057594037927935.5L, -72057594037927935.0L);
- TEST_f_f (ceil, -72057594037927936.25L, -72057594037927936.0L);
- TEST_f_f (ceil, -72057594037927936.5L, -72057594037927936.0L);
- TEST_f_f (ceil, -72057594037927936.75L, -72057594037927936.0L);
- TEST_f_f (ceil, -72057594037927937.5L, -72057594037927937.0L);
-
- TEST_f_f (ceil, 10141204801825835211973625643007.5L, 10141204801825835211973625643008.0L);
- TEST_f_f (ceil, 10141204801825835211973625643008.25L, 10141204801825835211973625643009.0L);
- TEST_f_f (ceil, 10141204801825835211973625643008.5L, 10141204801825835211973625643009.0L);
- TEST_f_f (ceil, 10141204801825835211973625643008.75L, 10141204801825835211973625643009.0L);
- TEST_f_f (ceil, 10141204801825835211973625643009.5L, 10141204801825835211973625643010.0L);
-#endif
-
+ RUN_TEST_LOOP_f_f (ceil, ceil_test_data, );
END (ceil);
}
@@ -6440,6 +6453,72 @@
}
+static const struct test_f_f_data cos_test_data[] =
+ {
+ START_DATA (cos),
+ TEST_f_f (cos, 0, 1),
+ TEST_f_f (cos, minus_zero, 1),
+ TEST_f_f (cos, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_f_f (cos, minus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM),
+ TEST_f_f (cos, qnan_value, qnan_value, ERRNO_UNCHANGED),
+
+ TEST_f_f (cos, M_PI_6l * 2.0, 0.5),
+ TEST_f_f (cos, M_PI_6l * 4.0, -0.5),
+
+ /* The value of M_PI_2l is never exactly PI/2, and therefore the
+ answer is never exactly zero. The answer is equal to the error
+ in rounding PI/2 for the type used. Thus the answer is unique
+ to each type. */
+#ifdef TEST_FLOAT
+ /* 32-bit float. */
+ TEST_f_f (cos, M_PI_2l, -0x1.777a5cp-25L),
+#endif
+#if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MANT_DIG == 53)
+ /* 64-bit double or 64-bit long double. */
+ TEST_f_f (cos, M_PI_2l, 0x1.1a62633145c07p-54L),
+#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 64
+ /* 96-bit long double. */
+ TEST_f_f (cos, M_PI_2l, -0xe.ce675d1fc8f8cbbp-69L),
+#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 106
+ /* 128-bit IBM long double. */
+ TEST_f_f (cos, M_PI_2l, 0x1.c1cd129024e088a67cc74020bcp-107L),
+#endif
+#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 113
+ /* 128-bit long double. */
+ TEST_f_f (cos, M_PI_2l, 0x1.cd129024e088a67cc74020bbea64p-115L),
+#endif
+
+ TEST_f_f (cos, 0.75L, 0.731688868873820886311838753000084544L),
+
+ TEST_f_f (cos, 0x1p65, 0.99888622066058013610642172179340364209972L),
+ TEST_f_f (cos, -0x1p65, 0.99888622066058013610642172179340364209972L),
+
+#ifdef TEST_DOUBLE
+ TEST_f_f (cos, 0.80190127184058835, 0.69534156199418473),
+#endif
+
+ TEST_f_f (cos, 0x1.442f74p+15, 2.4407839902314016628485779006274989801517e-06L),
+
+#ifndef TEST_FLOAT
+ TEST_f_f (cos, 1e22, 0.5232147853951389454975944733847094921409L),
+ TEST_f_f (cos, 0x1p1023, -0.826369834614147994500785680811743734805L),
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_f_f (cos, 0x1p16383L, 0.9210843909921906206874509522505756251609L),
+#endif
+
+ TEST_f_f (cos, 0x1p+120, -9.25879022854837867303861764107414946730833e-01L),
+ TEST_f_f (cos, 0x1p+127, 7.81914638714960072263910298466369236613162e-01L),
+ TEST_f_f (cos, 0x1.fffff8p+127, 9.98819362551949040703862043664101081064641e-01L),
+ TEST_f_f (cos, 0x1.fffffep+127, 8.53021039830304158051791467692161107353094e-01L),
+ TEST_f_f (cos, 0x1p+50, 8.68095904660550604334592502063501320395739e-01L),
+ TEST_f_f (cos, 0x1p+28, -1.65568979490578758865468278195361551113358e-01L),
+ END_DATA (cos)
+ };
+
static void
cos_test (void)
{
@@ -6450,76 +6529,30 @@
return;
START (cos);
-
- TEST_f_f (cos, 0, 1);
- TEST_f_f (cos, minus_zero, 1);
- TEST_f_f (cos, plus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM);
- TEST_f_f (cos, minus_infty, qnan_value, INVALID_EXCEPTION|ERRNO_EDOM);
- TEST_f_f (cos, qnan_value, qnan_value, ERRNO_UNCHANGED);
-
- TEST_f_f (cos, M_PI_6l * 2.0, 0.5);
- TEST_f_f (cos, M_PI_6l * 4.0, -0.5);
-
- /* The value of M_PI_2l is never exactly PI/2, and therefore the
- answer is never exactly zero. The answer is equal to the error
- in rounding PI/2 for the type used. Thus the answer is unique
- to each type. */
-#ifdef TEST_FLOAT
- /* 32-bit float. */
- TEST_f_f (cos, M_PI_2l, -0x1.777a5cp-25L);
-#endif
-#if defined TEST_DOUBLE || (defined TEST_LDOUBLE && LDBL_MANT_DIG == 53)
- /* 64-bit double or 64-bit long double. */
- TEST_f_f (cos, M_PI_2l, 0x1.1a62633145c07p-54L);
-#endif
-#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 64
- /* 96-bit long double. */
- TEST_f_f (cos, M_PI_2l, -0xe.ce675d1fc8f8cbbp-69L);
-#endif
-#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 106
- /* 128-bit IBM long double. */
- TEST_f_f (cos, M_PI_2l, 0x1.c1cd129024e088a67cc74020bcp-107L);
-#endif
-#if defined TEST_LDOUBLE && LDBL_MANT_DIG == 113
- /* 128-bit long double. */
- TEST_f_f (cos, M_PI_2l, 0x1.cd129024e088a67cc74020bbea64p-115L);
-#endif
-
- TEST_f_f (cos, 0.75L, 0.731688868873820886311838753000084544L);
-
- TEST_f_f (cos, 0x1p65, 0.99888622066058013610642172179340364209972L);
- TEST_f_f (cos, -0x1p65, 0.99888622066058013610642172179340364209972L);
-
-#ifdef TEST_DOUBLE
- TEST_f_f (cos, 0.80190127184058835, 0.69534156199418473);
-#endif
-
- TEST_f_f (cos, 0x1.442f74p+15, 2.4407839902314016628485779006274989801517e-06L);
-
-#ifndef TEST_FLOAT
- TEST_f_f (cos, 1e22, 0.5232147853951389454975944733847094921409L);
- TEST_f_f (cos, 0x1p1023, -0.826369834614147994500785680811743734805L);
-#endif
-
-#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
- TEST_f_f (cos, 0x1p16383L, 0.9210843909921906206874509522505756251609L);
-#endif
-
- TEST_f_f (cos, 0x1p+120, -9.25879022854837867303861764107414946730833e-01L);
- TEST_f_f (cos, 0x1p+127, 7.81914638714960072263910298466369236613162e-01L);
- TEST_f_f (cos, 0x1.fffff8p+127, 9.98819362551949040703862043664101081064641e-01L);
- TEST_f_f (cos, 0x1.fffffep+127, 8.53021039830304158051791467692161107353094e-01L);
- TEST_f_f (cos, 0x1p+50, 8.68095904660550604334592502063501320395739e-01L);
- TEST_f_f (cos, 0x1p+28, -1.65568979490578758865468278195361551113358e-01L);
-
+ RUN_TEST_LOOP_f_f (cos, cos_test_data, );
END (cos);
}
+static const struct test_f_f_data cos_tonearest_test_data[] =
+ {
+ START_DATA (cos_tonearest),
+ TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L),
+ TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L),
+ TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L),
+ TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L),
+ TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L),
+ TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L),
+ TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L),
+ TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L),
+ TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L),
+ TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L),
+ END_DATA (cos_tonearest)
+ };
+
static void
cos_test_tonearest (void)
{
- int save_round_mode;
errno = 0;
FUNC(cos) (0);
if (errno == ENOSYS)
@@ -6527,33 +6560,30 @@
return;
START (cos_tonearest);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TONEAREST))
- {
- TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
- TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
- TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
- TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
- TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
- TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
- TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
- TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
- TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
- TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (cos, cos_tonearest_test_data, FE_TONEAREST);
END (cos_tonearest);
}
+static const struct test_f_f_data cos_towardzero_test_data[] =
+ {
+ START_DATA (cos_towardzero),
+ TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L),
+ TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L),
+ TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L),
+ TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L),
+ TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L),
+ TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L),
+ TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L),
+ TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L),
+ TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L),
+ TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L),
+ END_DATA (cos_towardzero)
+ };
+
static void
cos_test_towardzero (void)
{
- int save_round_mode;
errno = 0;
FUNC(cos) (0);
if (errno == ENOSYS)
@@ -6561,33 +6591,30 @@
return;
START (cos_towardzero);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TOWARDZERO))
- {
- TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
- TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
- TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
- TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
- TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
- TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
- TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
- TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
- TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
- TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (cos, cos_towardzero_test_data, FE_TOWARDZERO);
END (cos_towardzero);
}
+static const struct test_f_f_data cos_downward_test_data[] =
+ {
+ START_DATA (cos_downward),
+ TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L),
+ TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L),
+ TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L),
+ TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L),
+ TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L),
+ TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L),
+ TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L),
+ TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L),
+ TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L),
+ TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L),
+ END_DATA (cos_downward)
+ };
+
static void
cos_test_downward (void)
{
- int save_round_mode;
errno = 0;
FUNC(cos) (0);
if (errno == ENOSYS)
@@ -6595,33 +6622,30 @@
return;
START (cos_downward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_DOWNWARD))
- {
- TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
- TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
- TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
- TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
- TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
- TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
- TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
- TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
- TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
- TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (cos, cos_downward_test_data, FE_DOWNWARD);
END (cos_downward);
}
+static const struct test_f_f_data cos_upward_test_data[] =
+ {
+ START_DATA (cos_upward),
+ TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L),
+ TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L),
+ TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L),
+ TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L),
+ TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L),
+ TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L),
+ TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L),
+ TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L),
+ TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L),
+ TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L),
+ END_DATA (cos_upward)
+ };
+
static void
cos_test_upward (void)
{
- int save_round_mode;
errno = 0;
FUNC(cos) (0);
if (errno == ENOSYS)
@@ -6629,28 +6653,31 @@
return;
START (cos_upward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_UPWARD))
- {
- TEST_f_f (cos, 1, 0.5403023058681397174009366074429766037323L);
- TEST_f_f (cos, 2, -0.4161468365471423869975682295007621897660L);
- TEST_f_f (cos, 3, -0.9899924966004454572715727947312613023937L);
- TEST_f_f (cos, 4, -0.6536436208636119146391681830977503814241L);
- TEST_f_f (cos, 5, 0.2836621854632262644666391715135573083344L);
- TEST_f_f (cos, 6, 0.9601702866503660205456522979229244054519L);
- TEST_f_f (cos, 7, 0.7539022543433046381411975217191820122183L);
- TEST_f_f (cos, 8, -0.1455000338086135258688413818311946826093L);
- TEST_f_f (cos, 9, -0.9111302618846769883682947111811653112463L);
- TEST_f_f (cos, 10, -0.8390715290764524522588639478240648345199L);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (cos, cos_upward_test_data, FE_UPWARD);
END (cos_upward);
}
+
+static const struct test_f_f_data cosh_test_data[] =
+ {
+ START_DATA (cosh),
+ TEST_f_f (cosh, 0, 1),
+ TEST_f_f (cosh, minus_zero, 1),
+
+#ifndef TEST_INLINE
+ TEST_f_f (cosh, plus_infty, plus_infty),
+ TEST_f_f (cosh, minus_infty, plus_infty),
+#endif
+ TEST_f_f (cosh, qnan_value, qnan_value),
+
+ TEST_f_f (cosh, 0.75L, 1.29468328467684468784170818539018176L),
+
+#ifndef TEST_FLOAT
+ TEST_f_f (cosh, 709.8893558127259666434838436543941497802734375L, 9.9999998999995070652573675944761818416035e+307L),
+ TEST_f_f (cosh, -709.8893558127259666434838436543941497802734375L, 9.9999998999995070652573675944761818416035e+307L),
+#endif
+ END_DATA (cosh)
+ };
static void
cosh_test (void)
@@ -6662,30 +6689,23 @@
return;
START (cosh);
- TEST_f_f (cosh, 0, 1);
- TEST_f_f (cosh, minus_zero, 1);
-
-#ifndef TEST_INLINE
- TEST_f_f (cosh, plus_infty, plus_infty);
- TEST_f_f (cosh, minus_infty, plus_infty);
-#endif
- TEST_f_f (cosh, qnan_value, qnan_value);
-
- TEST_f_f (cosh, 0.75L, 1.29468328467684468784170818539018176L);
-
-#ifndef TEST_FLOAT
- TEST_f_f (cosh, 709.8893558127259666434838436543941497802734375L, 9.9999998999995070652573675944761818416035e+307L);
- TEST_f_f (cosh, -709.8893558127259666434838436543941497802734375L, 9.9999998999995070652573675944761818416035e+307L);
-#endif
-
+ RUN_TEST_LOOP_f_f (cosh, cosh_test_data, );
END (cosh);
}
+static const struct test_f_f_data cosh_tonearest_test_data[] =
+ {
+ START_DATA (cosh_tonearest),
+ TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L),
+ TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L),
+ TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L),
+ END_DATA (cosh_tonearest)
+ };
+
static void
cosh_test_tonearest (void)
{
- int save_round_mode;
errno = 0;
FUNC(cosh) (0);
if (errno == ENOSYS)
@@ -6693,26 +6713,23 @@
return;
START (cosh_tonearest);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TONEAREST))
- {
- TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
- TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
- TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (cosh, cosh_tonearest_test_data, FE_TONEAREST);
END (cosh_tonearest);
}
+static const struct test_f_f_data cosh_towardzero_test_data[] =
+ {
+ START_DATA (cosh_towardzero),
+ TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L),
+ TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L),
+ TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L),
+ END_DATA (cosh_towardzero)
+ };
+
static void
cosh_test_towardzero (void)
{
- int save_round_mode;
errno = 0;
FUNC(cosh) (0);
if (errno == ENOSYS)
@@ -6720,26 +6737,23 @@
return;
START (cosh_towardzero);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TOWARDZERO))
- {
- TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
- TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
- TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (cosh, cosh_towardzero_test_data, FE_TOWARDZERO);
END (cosh_towardzero);
}
+static const struct test_f_f_data cosh_downward_test_data[] =
+ {
+ START_DATA (cosh_downward),
+ TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L),
+ TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L),
+ TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L),
+ END_DATA (cosh_downward)
+ };
+
static void
cosh_test_downward (void)
{
- int save_round_mode;
errno = 0;
FUNC(cosh) (0);
if (errno == ENOSYS)
@@ -6747,26 +6761,23 @@
return;
START (cosh_downward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_DOWNWARD))
- {
- TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
- TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
- TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (cosh, cosh_downward_test_data, FE_DOWNWARD);
END (cosh_downward);
}
+static const struct test_f_f_data cosh_upward_test_data[] =
+ {
+ START_DATA (cosh_upward),
+ TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L),
+ TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L),
+ TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L),
+ END_DATA (cosh_upward)
+ };
+
static void
cosh_test_upward (void)
{
- int save_round_mode;
errno = 0;
FUNC(cosh) (0);
if (errno == ENOSYS)
@@ -6774,18 +6785,7 @@
return;
START (cosh_upward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_UPWARD))
- {
- TEST_f_f (cosh, 22, 1792456423.065795780980053377632656584997L);
- TEST_f_f (cosh, 23, 4872401723.124451300068625740569997090344L);
- TEST_f_f (cosh, 24, 13244561064.92173614708845674912733665919L);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (cosh, cosh_upward_test_data, FE_UPWARD);
END (cosh_upward);
}
@@ -7622,6 +7622,24 @@
}
+static const struct test_f_f_data erf_test_data[] =
+ {
+ START_DATA (erf),
+ TEST_f_f (erf, 0, 0),
+ TEST_f_f (erf, minus_zero, minus_zero),
+ TEST_f_f (erf, plus_infty, 1),
+ TEST_f_f (erf, minus_infty, -1),
+ TEST_f_f (erf, qnan_value, qnan_value),
+
+ TEST_f_f (erf, 0.125L, 0.140316204801333817393029446521623398L),
+ TEST_f_f (erf, 0.75L, 0.711155633653515131598937834591410777L),
+ TEST_f_f (erf, 1.25L, 0.922900128256458230136523481197281140L),
+ TEST_f_f (erf, 2.0L, 0.995322265018952734162069256367252929L),
+ TEST_f_f (erf, 4.125L, 0.999999994576599200434933994687765914L),
+ TEST_f_f (erf, 27.0L, 1.0L),
+ END_DATA (erf)
+ };
+
static void
erf_test (void)
{
@@ -7632,23 +7650,39 @@
return;
START (erf);
-
- TEST_f_f (erf, 0, 0);
- TEST_f_f (erf, minus_zero, minus_zero);
- TEST_f_f (erf, plus_infty, 1);
- TEST_f_f (erf, minus_infty, -1);
- TEST_f_f (erf, qnan_value, qnan_value);
-
- TEST_f_f (erf, 0.125L, 0.140316204801333817393029446521623398L);
- TEST_f_f (erf, 0.75L, 0.711155633653515131598937834591410777L);
- TEST_f_f (erf, 1.25L, 0.922900128256458230136523481197281140L);
- TEST_f_f (erf, 2.0L, 0.995322265018952734162069256367252929L);
- TEST_f_f (erf, 4.125L, 0.999999994576599200434933994687765914L);
- TEST_f_f (erf, 27.0L, 1.0L);
-
+ RUN_TEST_LOOP_f_f (erf, erf_test_data, );
END (erf);
}
+
+static const struct test_f_f_data erfc_test_data[] =
+ {
+ START_DATA (erfc),
+ TEST_f_f (erfc, plus_infty, 0.0),
+ TEST_f_f (erfc, minus_infty, 2.0),
+ TEST_f_f (erfc, 0.0, 1.0),
+ TEST_f_f (erfc, minus_zero, 1.0),
+ TEST_f_f (erfc, qnan_value, qnan_value),
+
+ TEST_f_f (erfc, 0.125L, 0.859683795198666182606970553478376602L),
+ TEST_f_f (erfc, 0.75L, 0.288844366346484868401062165408589223L),
+ TEST_f_f (erfc, 1.25L, 0.0770998717435417698634765188027188596L),
+ TEST_f_f (erfc, 2.0L, 0.00467773498104726583793074363274707139L),
+ TEST_f_f (erfc, 0x1.f7303cp+1L, 2.705500297238986897105236321218861842255e-8L),
+ TEST_f_f (erfc, 4.125L, 0.542340079956506600531223408575531062e-8L),
+ TEST_f_f (erfc, 0x1.ffa002p+2L, 1.233585992097580296336099501489175967033e-29L),
+ TEST_f_f (erfc, 0x1.ffffc8p+2L, 1.122671365033056305522366683719541099329e-29L),
+#ifdef TEST_LDOUBLE
+ /* The result can only be represented in long double. */
+# if LDBL_MIN_10_EXP < -319
+ TEST_f_f (erfc, 27.0L, 0.523704892378925568501606768284954709e-318L),
+# endif
+# if LDBL_MANT_DIG >= 106
+ TEST_f_f (erfc, 0x1.ffff56789abcdef0123456789a8p+2L, 1.123161416304655390092138725253789378459e-29L),
+# endif
+#endif
+ END_DATA (erfc)
+ };
static void
erfc_test (void)
@@ -7660,34 +7694,46 @@
return;
START (erfc);
-
- TEST_f_f (erfc, plus_infty, 0.0);
- TEST_f_f (erfc, minus_infty, 2.0);
- TEST_f_f (erfc, 0.0, 1.0);
- TEST_f_f (erfc, minus_zero, 1.0);
- TEST_f_f (erfc, qnan_value, qnan_value);
-
- TEST_f_f (erfc, 0.125L, 0.859683795198666182606970553478376602L);
- TEST_f_f (erfc, 0.75L, 0.288844366346484868401062165408589223L);
- TEST_f_f (erfc, 1.25L, 0.0770998717435417698634765188027188596L);
- TEST_f_f (erfc, 2.0L, 0.00467773498104726583793074363274707139L);
- TEST_f_f (erfc, 0x1.f7303cp+1L, 2.705500297238986897105236321218861842255e-8L);
- TEST_f_f (erfc, 4.125L, 0.542340079956506600531223408575531062e-8L);
- TEST_f_f (erfc, 0x1.ffa002p+2L, 1.233585992097580296336099501489175967033e-29L);
- TEST_f_f (erfc, 0x1.ffffc8p+2L, 1.122671365033056305522366683719541099329e-29L);
-#ifdef TEST_LDOUBLE
- /* The result can only be represented in long double. */
-# if LDBL_MIN_10_EXP < -319
- TEST_f_f (erfc, 27.0L, 0.523704892378925568501606768284954709e-318L);
-# endif
-# if LDBL_MANT_DIG >= 106
- TEST_f_f (erfc, 0x1.ffff56789abcdef0123456789a8p+2L, 1.123161416304655390092138725253789378459e-29L);
-# endif
-#endif
-
+ RUN_TEST_LOOP_f_f (erfc, erfc_test_data, );
END (erfc);
}
+
+static const struct test_f_f_data exp_test_data[] =
+ {
+ START_DATA (exp),
+ TEST_f_f (exp, 0, 1),
+ TEST_f_f (exp, minus_zero, 1),
+
+#ifndef TEST_INLINE
+ TEST_f_f (exp, plus_infty, plus_infty),
+ TEST_f_f (exp, minus_infty, 0),
+#endif
+ TEST_f_f (exp, qnan_value, qnan_value),
+ TEST_f_f (exp, 1, M_El),
+
+ TEST_f_f (exp, 2, M_E2l),
+ TEST_f_f (exp, 3, M_E3l),
+ TEST_f_f (exp, 0.75L, 2.11700001661267466854536981983709561L),
+ TEST_f_f (exp, 50.0L, 5184705528587072464087.45332293348538L),
+ TEST_f_f (exp, 88.72269439697265625L, 3.40233126623160774937554134772290447915e38L),
+#ifndef TEST_FLOAT
+ TEST_f_f (exp, 709.75L, 1.739836873264160557698252711673830393864768e+308L),
+#endif
+#if defined TEST_LDOUBLE && __LDBL_MAX_EXP__ > 1024
+ /* The result can only be represented in sane long double. */
+ TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L),
+#endif
+
+#if !(defined TEST_LDOUBLE && LDBL_MAX_EXP > 1024)
+ TEST_f_f (exp, 710, plus_infty, OVERFLOW_EXCEPTION),
+ TEST_f_f (exp, -1234, plus_zero, UNDERFLOW_EXCEPTION),
+#endif
+ TEST_f_f (exp, 1e5, plus_infty, OVERFLOW_EXCEPTION),
+ TEST_f_f (exp, max_value, plus_infty, OVERFLOW_EXCEPTION),
+ TEST_f_f (exp, -max_value, 0, UNDERFLOW_EXCEPTION),
+ END_DATA (exp)
+ };
static void
exp_test (void)
@@ -7699,46 +7745,23 @@
return;
START (exp);
-
- TEST_f_f (exp, 0, 1);
- TEST_f_f (exp, minus_zero, 1);
-
-#ifndef TEST_INLINE
- TEST_f_f (exp, plus_infty, plus_infty);
- TEST_f_f (exp, minus_infty, 0);
-#endif
- TEST_f_f (exp, qnan_value, qnan_value);
- TEST_f_f (exp, 1, M_El);
-
- TEST_f_f (exp, 2, M_E2l);
- TEST_f_f (exp, 3, M_E3l);
- TEST_f_f (exp, 0.75L, 2.11700001661267466854536981983709561L);
- TEST_f_f (exp, 50.0L, 5184705528587072464087.45332293348538L);
- TEST_f_f (exp, 88.72269439697265625L, 3.40233126623160774937554134772290447915e38L);
-#ifndef TEST_FLOAT
- TEST_f_f (exp, 709.75L, 1.739836873264160557698252711673830393864768e+308L);
-#endif
-#if defined TEST_LDOUBLE && __LDBL_MAX_EXP__ > 1024
- /* The result can only be represented in sane long double. */
- TEST_f_f (exp, 1000.0L, 0.197007111401704699388887935224332313e435L);
-#endif
-
-#if !(defined TEST_LDOUBLE && LDBL_MAX_EXP > 1024)
- TEST_f_f (exp, 710, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp, -1234, plus_zero, UNDERFLOW_EXCEPTION);
-#endif
- TEST_f_f (exp, 1e5, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp, -max_value, 0, UNDERFLOW_EXCEPTION);
-
+ RUN_TEST_LOOP_f_f (exp, exp_test_data, );
END (exp);
}
+static const struct test_f_f_data exp_tonearest_test_data[] =
+ {
+ START_DATA (exp_tonearest),
+ TEST_f_f (exp, 1, M_El),
+ TEST_f_f (exp, 2, M_E2l),
+ TEST_f_f (exp, 3, M_E3l),
+ END_DATA (exp_tonearest)
+ };
+
static void
exp_test_tonearest (void)
{
- int save_round_mode;
errno = 0;
FUNC(exp) (0);
if (errno == ENOSYS)
@@ -7746,26 +7769,23 @@
return;
START (exp_tonearest);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TONEAREST))
- {
- TEST_f_f (exp, 1, M_El);
- TEST_f_f (exp, 2, M_E2l);
- TEST_f_f (exp, 3, M_E3l);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (exp, exp_tonearest_test_data, FE_TONEAREST);
END (exp_tonearest);
}
+static const struct test_f_f_data exp_towardzero_test_data[] =
+ {
+ START_DATA (exp_towardzero),
+ TEST_f_f (exp, 1, M_El),
+ TEST_f_f (exp, 2, M_E2l),
+ TEST_f_f (exp, 3, M_E3l),
+ END_DATA (exp_towardzero)
+ };
+
static void
exp_test_towardzero (void)
{
- int save_round_mode;
errno = 0;
FUNC(exp) (0);
if (errno == ENOSYS)
@@ -7773,26 +7793,23 @@
return;
START (exp_towardzero);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_TOWARDZERO))
- {
- TEST_f_f (exp, 1, M_El);
- TEST_f_f (exp, 2, M_E2l);
- TEST_f_f (exp, 3, M_E3l);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (exp, exp_towardzero_test_data, FE_TOWARDZERO);
END (exp_towardzero);
}
+static const struct test_f_f_data exp_downward_test_data[] =
+ {
+ START_DATA (exp_downward),
+ TEST_f_f (exp, 1, M_El),
+ TEST_f_f (exp, 2, M_E2l),
+ TEST_f_f (exp, 3, M_E3l),
+ END_DATA (exp_downward)
+ };
+
static void
exp_test_downward (void)
{
- int save_round_mode;
errno = 0;
FUNC(exp) (0);
if (errno == ENOSYS)
@@ -7800,26 +7817,23 @@
return;
START (exp_downward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_DOWNWARD))
- {
- TEST_f_f (exp, 1, M_El);
- TEST_f_f (exp, 2, M_E2l);
- TEST_f_f (exp, 3, M_E3l);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (exp, exp_downward_test_data, FE_DOWNWARD);
END (exp_downward);
}
+static const struct test_f_f_data exp_upward_test_data[] =
+ {
+ START_DATA (exp_upward),
+ TEST_f_f (exp, 1, M_El),
+ TEST_f_f (exp, 2, M_E2l),
+ TEST_f_f (exp, 3, M_E3l),
+ END_DATA (exp_upward)
+ };
+
static void
exp_test_upward (void)
{
- int save_round_mode;
errno = 0;
FUNC(exp) (0);
if (errno == ENOSYS)
@@ -7827,21 +7841,39 @@
return;
START (exp_upward);
-
- save_round_mode = fegetround ();
-
- if (!fesetround (FE_UPWARD))
- {
- TEST_f_f (exp, 1, M_El);
- TEST_f_f (exp, 2, M_E2l);
- TEST_f_f (exp, 3, M_E3l);
- }
-
- fesetround (save_round_mode);
-
+ RUN_TEST_LOOP_f_f (exp, exp_upward_test_data, FE_UPWARD);
END (exp_upward);
}
+
+static const struct test_f_f_data exp10_test_data[] =
+ {
+ START_DATA (exp10),
+ TEST_f_f (exp10, 0, 1),
+ TEST_f_f (exp10, minus_zero, 1),
+
+ TEST_f_f (exp10, plus_infty, plus_infty),
+ TEST_f_f (exp10, minus_infty, 0),
+ TEST_f_f (exp10, qnan_value, qnan_value),
+ TEST_f_f (exp10, 3, 1000),
+ TEST_f_f (exp10, -1, 0.1L),
+ TEST_f_f (exp10, 36, 1.0e36L),
+ TEST_f_f (exp10, -36, 1.0e-36L),
+#ifndef TEST_FLOAT
+ TEST_f_f (exp10, 305, 1.0e305L),
+ TEST_f_f (exp10, -305, 1.0e-305L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM),
+#endif
+#if defined TEST_LDOUBLE && LDBL_MAX_10_EXP >= 4932
+ TEST_f_f (exp10, 4932, 1.0e4932L),
+ TEST_f_f (exp10, -4932, 1.0e-4932L, UNDERFLOW_EXCEPTION),
+#endif
+ TEST_f_f (exp10, 1e6, plus_infty, OVERFLOW_EXCEPTION),
+ TEST_f_f (exp10, -1e6, 0, UNDERFLOW_EXCEPTION),
+ TEST_f_f (exp10, max_value, plus_infty, OVERFLOW_EXCEPTION),
+ TEST_f_f (exp10, -max_value, 0, UNDERFLOW_EXCEPTION),
+ TEST_f_f (exp10, 0.75L, 5.62341325190349080394951039776481231L),
+ END_DATA (exp10)
+ };
static void
exp10_test (void)
@@ -7853,34 +7885,44 @@
return;
START (exp10);
-
- TEST_f_f (exp10, 0, 1);
- TEST_f_f (exp10, minus_zero, 1);
-
- TEST_f_f (exp10, plus_infty, plus_infty);
- TEST_f_f (exp10, minus_infty, 0);
- TEST_f_f (exp10, qnan_value, qnan_value);
- TEST_f_f (exp10, 3, 1000);
- TEST_f_f (exp10, -1, 0.1L);
- TEST_f_f (exp10, 36, 1.0e36L);
- TEST_f_f (exp10, -36, 1.0e-36L);
+ RUN_TEST_LOOP_f_f (exp10, exp10_test_data, );
+ END (exp10);
+}
+
+
+static const struct test_f_f_data exp2_test_data[] =
+ {
+ START_DATA (exp2),
+ TEST_f_f (exp2, 0, 1),
+ TEST_f_f (exp2, minus_zero, 1),
+ TEST_f_f (exp2, plus_infty, plus_infty),
+ TEST_f_f (exp2, minus_infty, 0),
+ TEST_f_f (exp2, qnan_value, qnan_value),
+
+ TEST_f_f (exp2, 10, 1024),
+ TEST_f_f (exp2, -1, 0.5),
+ TEST_f_f (exp2, 1e6, plus_infty, OVERFLOW_EXCEPTION),
+ TEST_f_f (exp2, -1e6, 0, UNDERFLOW_EXCEPTION),
+ TEST_f_f (exp2, max_value, plus_infty, OVERFLOW_EXCEPTION),
+ TEST_f_f (exp2, -max_value, 0, UNDERFLOW_EXCEPTION),
+ TEST_f_f (exp2, 0.75L, 1.68179283050742908606225095246642979L),
+
+ TEST_f_f (exp2, 100.5, 1.792728671193156477399422023278661496394e+30L),
+ TEST_f_f (exp2, 127, 0x1p127),
+ TEST_f_f (exp2, -149, 0x1p-149),
+
#ifndef TEST_FLOAT
- TEST_f_f (exp10, 305, 1.0e305L);
- TEST_f_f (exp10, -305, 1.0e-305L, UNDERFLOW_EXCEPTION_LDOUBLE_IBM);
-#endif
-#if defined TEST_LDOUBLE && LDBL_MAX_10_EXP >= 4932
- TEST_f_f (exp10, 4932, 1.0e4932L);
- TEST_f_f (exp10, -4932, 1.0e-4932L, UNDERFLOW_EXCEPTION);
-#endif
- TEST_f_f (exp10, 1e6, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp10, -1e6, 0, UNDERFLOW_EXCEPTION);
- TEST_f_f (exp10, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp10, -max_value, 0, UNDERFLOW_EXCEPTION);
- TEST_f_f (exp10, 0.75L, 5.62341325190349080394951039776481231L);
-
- END (exp10);
-}
-
+ TEST_f_f (exp2, 1000.25, 1.274245659452564874772384918171765416737e+301L),
+ TEST_f_f (exp2, 1023, 0x1p1023),
+ TEST_f_f (exp2, -1074, 0x1p-1074),
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_f_f (exp2, 16383, 0x1p16383L),
+ TEST_f_f (exp2, -16400, 0x1p-16400L),
+#endif
+ END_DATA (exp2)
+ };
static void
exp2_test (void)
@@ -7892,39 +7934,63 @@
return;
START (exp2);
-
- TEST_f_f (exp2, 0, 1);
- TEST_f_f (exp2, minus_zero, 1);
- TEST_f_f (exp2, plus_infty, plus_infty);
- TEST_f_f (exp2, minus_infty, 0);
- TEST_f_f (exp2, qnan_value, qnan_value);
-
- TEST_f_f (exp2, 10, 1024);
- TEST_f_f (exp2, -1, 0.5);
- TEST_f_f (exp2, 1e6, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp2, -1e6, 0, UNDERFLOW_EXCEPTION);
- TEST_f_f (exp2, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (exp2, -max_value, 0, UNDERFLOW_EXCEPTION);
- TEST_f_f (exp2, 0.75L, 1.68179283050742908606225095246642979L);
-
- TEST_f_f (exp2, 100.5, 1.792728671193156477399422023278661496394e+30L);
- TEST_f_f (exp2, 127, 0x1p127);
- TEST_f_f (exp2, -149, 0x1p-149);
+ RUN_TEST_LOOP_f_f (exp2, exp2_test_data, );
+ END (exp2);
+}
+
+
+static const struct test_f_f_data expm1_test_data[] =
+ {
+ START_DATA (expm1),
+ TEST_f_f (expm1, 0, 0),
+ TEST_f_f (expm1, minus_zero, minus_zero),
+
+#ifndef TEST_INLINE
+ TEST_f_f (expm1, plus_infty, plus_infty),
+ TEST_f_f (expm1, minus_infty, -1),
+#endif
+ TEST_f_f (expm1, qnan_value, qnan_value),
+
+ TEST_f_f (expm1, 1, M_El - 1.0),
+ TEST_f_f (expm1, 0.75L, 1.11700001661267466854536981983709561L),
+
+ TEST_f_f (expm1, 50.0L, 5.1847055285870724640864533229334853848275e+21L),
#ifndef TEST_FLOAT
- TEST_f_f (exp2, 1000.25, 1.274245659452564874772384918171765416737e+301L);
- TEST_f_f (exp2, 1023, 0x1p1023);
- TEST_f_f (exp2, -1074, 0x1p-1074);
+ TEST_f_f (expm1, 127.0L, 1.4302079958348104463583671072905261080748e+55L),
+ TEST_f_f (expm1, 500.0L, 1.4035922178528374107397703328409120821806e+217L),
#endif
#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
- TEST_f_f (exp2, 16383, 0x1p16383L);
- TEST_f_f (exp2, -16400, 0x1p-16400L);
-#endif
-
- END (exp2);
-}
-
+ TEST_f_f (expm1, 11356.25L, 9.05128237311923300051376115753226014206e+4931L),
+#endif
+
+ TEST_f_f (expm1, -10.0, -0.9999546000702375151484644084844394493898L),
+ TEST_f_f (expm1, -16.0, -0.9999998874648252807408854862248209398728L),
+ TEST_f_f (expm1, -17.0, -0.9999999586006228121483334034897228104472L),
+ TEST_f_f (expm1, -18.0, -0.9999999847700202552873715638633707664826L),
+ TEST_f_f (expm1, -36.0, -0.9999999999999997680477169756430611687736L),
+ TEST_f_f (expm1, -37.0, -0.9999999999999999146695237425593420572195L),
+ TEST_f_f (expm1, -38.0, -0.9999999999999999686086720795197037129104L),
+ TEST_f_f (expm1, -44.0, -0.9999999999999999999221886775886620348429L),
+ TEST_f_f (expm1, -45.0, -0.9999999999999999999713748141945060635553L),
+ TEST_f_f (expm1, -46.0, -0.9999999999999999999894693826424461876212L),
+ TEST_f_f (expm1, -73.0, -0.9999999999999999999999999999999802074012L),
+ TEST_f_f (expm1, -74.0, -0.9999999999999999999999999999999927187098L),
+ TEST_f_f (expm1, -75.0, -0.9999999999999999999999999999999973213630L),
+ TEST_f_f (expm1, -78.0, -0.9999999999999999999999999999999998666385L),
+ TEST_f_f (expm1, -79.0, -0.9999999999999999999999999999999999509391L),
+ TEST_f_f (expm1, -80.0, -0.9999999999999999999999999999999999819515L),
+ TEST_f_f (expm1, -100.0, -1.0),
+ TEST_f_f (expm1, -1000.0, -1.0),
+ TEST_f_f (expm1, -10000.0, -1.0),
+ TEST_f_f (expm1, -100000.0, -1.0),
+
+ TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION|ERRNO_ERANGE),
+ TEST_f_f (expm1, max_value, plus_infty, OVERFLOW_EXCEPTION),
+ TEST_f_f (expm1, -max_value, -1),
+ END_DATA (expm1)
+ };
static void
expm1_test (void)
@@ -7936,74 +8002,31 @@
return;
START (expm1);
-
- TEST_f_f (expm1, 0, 0);
- TEST_f_f (expm1, minus_zero, minus_zero);
-
-#ifndef TEST_INLINE
- TEST_f_f (expm1, plus_infty, plus_infty);
- TEST_f_f (expm1, minus_infty, -1);
-#endif
- TEST_f_f (expm1, qnan_value, qnan_value);
-
- TEST_f_f (expm1, 1, M_El - 1.0);
- TEST_f_f (expm1, 0.75L, 1.11700001661267466854536981983709561L);
-
- TEST_f_f (expm1, 50.0L, 5.1847055285870724640864533229334853848275e+21L);
-
-#ifndef TEST_FLOAT
- TEST_f_f (expm1, 127.0L, 1.4302079958348104463583671072905261080748e+55L);
- TEST_f_f (expm1, 500.0L, 1.4035922178528374107397703328409120821806e+217L);
-#endif
-
-#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
- TEST_f_f (expm1, 11356.25L, 9.05128237311923300051376115753226014206e+4931L);
-#endif
-
- TEST_f_f (expm1, -10.0, -0.9999546000702375151484644084844394493898L);
- TEST_f_f (expm1, -16.0, -0.9999998874648252807408854862248209398728L);
- TEST_f_f (expm1, -17.0, -0.9999999586006228121483334034897228104472L);
- TEST_f_f (expm1, -18.0, -0.9999999847700202552873715638633707664826L);
- TEST_f_f (expm1, -36.0, -0.9999999999999997680477169756430611687736L);
- TEST_f_f (expm1, -37.0, -0.9999999999999999146695237425593420572195L);
- TEST_f_f (expm1, -38.0, -0.9999999999999999686086720795197037129104L);
- TEST_f_f (expm1, -44.0, -0.9999999999999999999221886775886620348429L);
- TEST_f_f (expm1, -45.0, -0.9999999999999999999713748141945060635553L);
- TEST_f_f (expm1, -46.0, -0.9999999999999999999894693826424461876212L);
- TEST_f_f (expm1, -73.0, -0.9999999999999999999999999999999802074012L);
- TEST_f_f (expm1, -74.0, -0.9999999999999999999999999999999927187098L);
- TEST_f_f (expm1, -75.0, -0.9999999999999999999999999999999973213630L);
- TEST_f_f (expm1, -78.0, -0.9999999999999999999999999999999998666385L);
- TEST_f_f (expm1, -79.0, -0.9999999999999999999999999999999999509391L);
- TEST_f_f (expm1, -80.0, -0.9999999999999999999999999999999999819515L);
- TEST_f_f (expm1, -100.0, -1.0);
- TEST_f_f (expm1, -1000.0, -1.0);
- TEST_f_f (expm1, -10000.0, -1.0);
- TEST_f_f (expm1, -100000.0, -1.0);
-
- TEST_f_f (expm1, 100000.0, plus_infty, OVERFLOW_EXCEPTION|ERRNO_ERANGE);
- TEST_f_f (expm1, max_value, plus_infty, OVERFLOW_EXCEPTION);
- TEST_f_f (expm1, -max_value, -1);
-
+ RUN_TEST_LOOP_f_f (expm1, expm1_test_data, );
END (expm1);
}
+static const struct test_f_f_data fabs_test_data[] =
+ {
+ START_DATA (fabs),
+ TEST_f_f (fabs, 0, 0),
+ TEST_f_f (fabs, minus_zero, 0),
+
+ TEST_f_f (fabs, plus_infty, plus_infty),
+ TEST_f_f (fabs, minus_infty, plus_infty),
+ TEST_f_f (fabs, qnan_value, qnan_value),
+
+ TEST_f_f (fabs, 38.0, 38.0),
+ TEST_f_f (fabs, -M_El, M_El),
+ END_DATA (fabs)
+ };
+
static void
fabs_test (void)
{
START (fabs);
-
- TEST_f_f (fabs, 0, 0);
- TEST_f_f (fabs, minus_zero, 0);
-
- TEST_f_f (fabs, plus_infty, plus_infty);
- TEST_f_f (fabs, minus_infty, plus_infty);
- TEST_f_f (fabs, qnan_value, qnan_value);
-
- TEST_f_f (fabs, 38.0, 38.0);
- TEST_f_f (fabs, -M_El, M_El);
-
+ RUN_TEST_LOOP_f_f (fabs, fabs_test_data, );
END (fabs);
}
@@ -8062,103 +8085,108 @@
}
+static const struct test_f_f_data floor_test_data[] =
+ {
+ START_DATA (floor),
+ TEST_f_f (floor, 0.0, 0.0),
+ TEST_f_f (floor, minus_zero, minus_zero),
+ TEST_f_f (floor, plus_infty, plus_infty),
+ TEST_f_f (floor, minus_infty, minus_infty),
+ TEST_f_f (floor, qnan_value, qnan_value),
+
+ TEST_f_f (floor, M_PIl, 3.0),
+ TEST_f_f (floor, -M_PIl, -4.0),
+
+ TEST_f_f (floor, 0.1, 0.0),
+ TEST_f_f (floor, 0.25, 0.0),
+ TEST_f_f (floor, 0.625, 0.0),
+ TEST_f_f (floor, -0.1, -1.0),
+ TEST_f_f (floor, -0.25, -1.0),
+ TEST_f_f (floor, -0.625, -1.0),
+
+#ifdef TEST_LDOUBLE
+ /* The result can only be represented in long double. */
+ TEST_f_f (floor, 4503599627370495.5L, 4503599627370495.0L),
+ TEST_f_f (floor, 4503599627370496.25L, 4503599627370496.0L),
+ TEST_f_f (floor, 4503599627370496.5L, 4503599627370496.0L),
+ TEST_f_f (floor, 4503599627370496.75L, 4503599627370496.0L),
+ TEST_f_f (floor, 4503599627370497.5L, 4503599627370497.0L),
+# if LDBL_MANT_DIG > 100
+ TEST_f_f (floor, 4503599627370494.5000000000001L, 4503599627370494.0L),
+ TEST_f_f (floor, 4503599627370495.5000000000001L, 4503599627370495.0L),
+ TEST_f_f (floor, 4503599627370496.5000000000001L, 4503599627370496.0L),
+# endif
+
+ TEST_f_f (floor, -4503599627370495.5L, -4503599627370496.0L),
+ TEST_f_f (floor, -4503599627370496.25L, -4503599627370497.0L),
+ TEST_f_f (floor, -4503599627370496.5L, -4503599627370497.0L),
+ TEST_f_f (floor, -4503599627370496.75L, -4503599627370497.0L),
+ TEST_f_f (floor, -4503599627370497.5L, -4503599627370498.0L),
+# if LDBL_MANT_DIG > 100
+ TEST_f_f (floor, -4503599627370494.5000000000001L, -4503599627370495.0L),
+ TEST_f_f (floor, -4503599627370495.5000000000001L, -4503599627370496.0L),
+ TEST_f_f (floor, -4503599627370496.5000000000001L, -4503599627370497.0L),
+# endif
+
+ TEST_f_f (floor, 9007199254740991.5L, 9007199254740991.0L),
+ TEST_f_f (floor, 9007199254740992.25L, 9007199254740992.0L),
+ TEST_f_f (floor, 9007199254740992.5L, 9007199254740992.0L),
+ TEST_f_f (floor, 9007199254740992.75L, 9007199254740992.0L),
+ TEST_f_f (floor, 9007199254740993.5L, 9007199254740993.0L),
+
+# if LDBL_MANT_DIG > 100
+ TEST_f_f (floor, 9007199254740991.0000000000001L, 9007199254740991.0L),
+ TEST_f_f (floor, 9007199254740992.0000000000001L, 9007199254740992.0L),
+ TEST_f_f (floor, 9007199254740993.0000000000001L, 9007199254740993.0L),
+ TEST_f_f (floor, 9007199254740991.5000000000001L, 9007199254740991.0L),
+ TEST_f_f (floor, 9007199254740992.5000000000001L, 9007199254740992.0L),
+ TEST_f_f (floor, 9007199254740993.5000000000001L, 9007199254740993.0L),
+# endif
+
+ TEST_f_f (floor, -9007199254740991.5L, -9007199254740992.0L),
+ TEST_f_f (floor, -9007199254740992.25L, -9007199254740993.0L),
+ TEST_f_f (floor, -9007199254740992.5L, -9007199254740993.0L),
+ TEST_f_f (floor, -9007199254740992.75L, -9007199254740993.0L),
+ TEST_f_f (floor, -9007199254740993.5L, -9007199254740994.0L),
+
+# if LDBL_MANT_DIG > 100
+ TEST_f_f (floor, -9007199254740991.0000000000001L, -9007199254740992.0L),
+ TEST_f_f (floor, -9007199254740992.0000000000001L, -9007199254740993.0L),
+ TEST_f_f (floor, -9007199254740993.0000000000001L, -9007199254740994.0L),
+ TEST_f_f (floor, -9007199254740991.5000000000001L, -9007199254740992.0L),
+ TEST_f_f (floor, -9007199254740992.5000000000001L, -9007199254740993.0L),
+ TEST_f_f (floor, -9007199254740993.5000000000001L, -9007199254740994.0L),
+# endif
+
+ TEST_f_f (floor, 72057594037927935.5L, 72057594037927935.0L),
+ TEST_f_f (floor, 72057594037927936.25L, 72057594037927936.0L),
+ TEST_f_f (floor, 72057594037927936.5L, 72057594037927936.0L),
+ TEST_f_f (floor, 72057594037927936.75L, 72057594037927936.0L),
+ TEST_f_f (floor, 72057594037927937.5L, 72057594037927937.0L),
+
+ TEST_f_f (floor, -72057594037927935.5L, -72057594037927936.0L),
+ TEST_f_f (floor, -72057594037927936.25L, -72057594037927937.0L),
+ TEST_f_f (floor, -72057594037927936.5L, -72057594037927937.0L),
+ TEST_f_f (floor, -72057594037927936.75L, -72057594037927937.0L),
+ TEST_f_f (floor, -72057594037927937.5L, -72057594037927938.0L),
+
+ TEST_f_f (floor, 10141204801825835211973625643007.5L, 10141204801825835211973625643007.0L),
+ TEST_f_f (floor, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L),
+ TEST_f_f (floor, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L),
+ TEST_f_f (floor, 10141204801825835211973625643008.75L, 10141204801825835211973625643008.0L),
+ TEST_f_f (floor, 10141204801825835211973625643009.5L, 10141204801825835211973625643009.0L),
+
+ TEST_f_f (floor, 0xf.ffffffffffffff8p+47L, 0xf.fffffffffffep+47L),
+ TEST_f_f (floor, -0x8.000000000000004p+48L, -0x8.000000000001p+48L),
+#endif
+ END_DATA (floor)
+ };
+
static void
floor_test (void)
{
START (floor);
-
- TEST_f_f (floor, 0.0, 0.0);
- TEST_f_f (floor, minus_zero, minus_zero);
- TEST_f_f (floor, plus_infty, plus_infty);
- TEST_f_f (floor, minus_infty, minus_infty);
- TEST_f_f (floor, qnan_value, qnan_value);
-
- TEST_f_f (floor, M_PIl, 3.0);
- TEST_f_f (floor, -M_PIl, -4.0);
-
- TEST_f_f (floor, 0.1, 0.0);
- TEST_f_f (floor, 0.25, 0.0);
- TEST_f_f (floor, 0.625, 0.0);
- TEST_f_f (floor, -0.1, -1.0);
- TEST_f_f (floor, -0.25, -1.0);
- TEST_f_f (floor, -0.625, -1.0);
-
-#ifdef TEST_LDOUBLE
- /* The result can only be represented in long double. */
- TEST_f_f (floor, 4503599627370495.5L, 4503599627370495.0L);
- TEST_f_f (floor, 4503599627370496.25L, 4503599627370496.0L);
- TEST_f_f (floor, 4503599627370496.5L, 4503599627370496.0L);
- TEST_f_f (floor, 4503599627370496.75L, 4503599627370496.0L);
- TEST_f_f (floor, 4503599627370497.5L, 4503599627370497.0L);
-# if LDBL_MANT_DIG > 100
- TEST_f_f (floor, 4503599627370494.5000000000001L, 4503599627370494.0L);
- TEST_f_f (floor, 4503599627370495.5000000000001L, 4503599627370495.0L);
- TEST_f_f (floor, 4503599627370496.5000000000001L, 4503599627370496.0L);
-# endif
-
- TEST_f_f (floor, -4503599627370495.5L, -4503599627370496.0L);
- TEST_f_f (floor, -4503599627370496.25L, -4503599627370497.0L);
- TEST_f_f (floor, -4503599627370496.5L, -4503599627370497.0L);
- TEST_f_f (floor, -4503599627370496.75L, -4503599627370497.0L);
- TEST_f_f (floor, -4503599627370497.5L, -4503599627370498.0L);
-# if LDBL_MANT_DIG > 100
- TEST_f_f (floor, -4503599627370494.5000000000001L, -4503599627370495.0L);
- TEST_f_f (floor, -4503599627370495.5000000000001L, -4503599627370496.0L);
- TEST_f_f (floor, -4503599627370496.5000000000001L, -4503599627370497.0L);
-# endif
-
- TEST_f_f (floor, 9007199254740991.5L, 9007199254740991.0L);
- TEST_f_f (floor, 9007199254740992.25L, 9007199254740992.0L);
- TEST_f_f (floor, 9007199254740992.5L, 9007199254740992.0L);
- TEST_f_f (floor, 9007199254740992.75L, 9007199254740992.0L);
- TEST_f_f (floor, 9007199254740993.5L, 9007199254740993.0L);
-
-# if LDBL_MANT_DIG > 100
- TEST_f_f (floor, 9007199254740991.0000000000001L, 9007199254740991.0L);
- TEST_f_f (floor, 9007199254740992.0000000000001L, 9007199254740992.0L);
- TEST_f_f (floor, 9007199254740993.0000000000001L, 9007199254740993.0L);
- TEST_f_f (floor, 9007199254740991.5000000000001L, 9007199254740991.0L);
- TEST_f_f (floor, 9007199254740992.5000000000001L, 9007199254740992.0L);
- TEST_f_f (floor, 9007199254740993.5000000000001L, 9007199254740993.0L);
-# endif
-
- TEST_f_f (floor, -9007199254740991.5L, -9007199254740992.0L);
- TEST_f_f (floor, -9007199254740992.25L, -9007199254740993.0L);
- TEST_f_f (floor, -9007199254740992.5L, -9007199254740993.0L);
- TEST_f_f (floor, -9007199254740992.75L, -9007199254740993.0L);
- TEST_f_f (floor, -9007199254740993.5L, -9007199254740994.0L);
-
-# if LDBL_MANT_DIG > 100
- TEST_f_f (floor, -9007199254740991.0000000000001L, -9007199254740992.0L);
- TEST_f_f (floor, -9007199254740992.0000000000001L, -9007199254740993.0L);
- TEST_f_f (floor, -9007199254740993.0000000000001L, -9007199254740994.0L);
- TEST_f_f (floor, -9007199254740991.5000000000001L, -9007199254740992.0L);
- TEST_f_f (floor, -9007199254740992.5000000000001L, -9007199254740993.0L);
- TEST_f_f (floor, -9007199254740993.5000000000001L, -9007199254740994.0L);
-# endif
-
- TEST_f_f (floor, 72057594037927935.5L, 72057594037927935.0L);
- TEST_f_f (floor, 72057594037927936.25L, 72057594037927936.0L);
- TEST_f_f (floor, 72057594037927936.5L, 72057594037927936.0L);
- TEST_f_f (floor, 72057594037927936.75L, 72057594037927936.0L);
- TEST_f_f (floor, 72057594037927937.5L, 72057594037927937.0L);
-
- TEST_f_f (floor, -72057594037927935.5L, -72057594037927936.0L);
- TEST_f_f (floor, -72057594037927936.25L, -72057594037927937.0L);
- TEST_f_f (floor, -72057594037927936.5L, -72057594037927937.0L);
- TEST_f_f (floor, -72057594037927936.75L, -72057594037927937.0L);
- TEST_f_f (floor, -72057594037927937.5L, -72057594037927938.0L);
-
- TEST_f_f (floor, 10141204801825835211973625643007.5L, 10141204801825835211973625643007.0L);
- TEST_f_f (floor, 10141204801825835211973625643008.25L, 10141204801825835211973625643008.0L);
- TEST_f_f (floor, 10141204801825835211973625643008.5L, 10141204801825835211973625643008.0L);
- TEST_f_f (floor, 10141204801825835211973625643008.75L, 10141204801825835211973625643008.0L);
- TEST_f_f (floor, 10141204801825835211973625643009.5L, 10141204801825835211973625643009.0L);
-
- TEST_f_f (floor, 0xf.ffffffffffffff8p+47L, 0xf.fffffffffffep+47L);
- TEST_f_f (floor, -0x8.000000000000004p+48L, -0x8.000000000001p+48L);
-#endif
-
+ RUN_TEST_LOOP_f_f (floor, floor_test_data, );
END (floor);
}
@@ -8192,12 +8220,10 @@
TEST_fff_f (fma, 1.25L, 0.75L, 0.0625L, 1.0L);
- FLOAT fltmax = CHOOSE (LDBL_MAX, DBL_MAX, FLT_MAX,
- LDBL_MAX, DBL_MAX, FLT_MAX);
- TEST_fff_f (fma, -fltmax, -fltmax, minus_infty, minus_infty);
- TEST_fff_f (fma, fltmax / 2, fltmax / 2, minus_infty, minus_infty);
- TEST_fff_f (fma, -fltmax, fltmax, plus_infty, plus_infty);
- TEST_fff_f (fma, fltmax / 2, -fltmax / 4, plus_infty, plus_infty);
+ TEST_fff_f (fma, -max_value, -max_value, minus_infty, minus_infty);
+ TEST_fff_f (fma, max_value / 2, max_value / 2, minus_infty, minus_infty);
+ TEST_fff_f (fma, -max_value, max_value, plus_infty, plus_infty);
+ TEST_fff_f (fma, max_value / 2, -max_value / 4, plus_infty, plus_infty);
TEST_fff_f (fma, plus_infty, 4, plus_infty, plus_infty);
TEST_fff_f (fma, 2, minus_infty, minus_infty, minus_infty);
TEST_fff_f (fma, minus_infty, minus_infty, plus_infty, plus_infty);
@@ -9620,6 +9646,38 @@
END (isunordered);
}
+static const struct test_f_f_data j0_test_data[] =
+ {
+ START_DATA (j0),
+ /* j0 is the Bessel function of the first kind of order 0 */
+ TEST_f_f (j0, qnan_value, qnan_value),
+ TEST_f_f (j0, plus_infty, 0),
+ TEST_f_f (j0, -1.0, 0.765197686557966551449717526102663221L),
+ TEST_f_f (j0, 0.0, 1.0),
+ TEST_f_f (j0, 0.125L, 0.996097563041985204620768999453174712L),
+ TEST_f_f (j0, 0.75L, 0.864242275166648623555731103820923211L),
+ TEST_f_f (j0, 1.0, 0.765197686557966551449717526102663221L),
+ TEST_f_f (j0, 1.5, 0.511827671735918128749051744283411720L),
+ TEST_f_f (j0, 2.0, 0.223890779141235668051827454649948626L),
+ TEST_f_f (j0, 8.0, 0.171650807137553906090869407851972001L),
+ TEST_f_f (j0, 10.0, -0.245935764451348335197760862485328754L),
+ TEST_f_f (j0, 4.0, -3.9714980986384737228659076845169804197562E-1L),
+ TEST_f_f (j0, -4.0, -3.9714980986384737228659076845169804197562E-1L),
+
+ TEST_f_f (j0, 0x1.d7ce3ap+107L, 2.775523647291230802651040996274861694514e-17L),
+
+#ifndef TEST_FLOAT
+ TEST_f_f (j0, -0x1.001000001p+593L, -3.927269966354206207832593635798954916263e-90L),
+ TEST_f_f (j0, 0x1p1023L, -1.5665258060609012834424478437196679802783e-155L),
+#endif
+
+#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
+ TEST_f_f (j0, 0x1p16382L, -1.2193782500509000574176799046642541129387e-2466L),
+ TEST_f_f (j0, 0x1p16383L, 9.5859502826270374691362975419147645151233e-2467L),
+#endif
+ END_DATA (j0)
+ };
+
static void
j0_test (void)
{
@@ -9635,37 +9693,41 @@
return;
START (j0);
-
- /* j0 is the Bessel function of the first kind of order 0 */
- TEST_f_f (j0, qnan_value, qnan_value);
- TEST_f_f (j0, plus_infty, 0);
- TEST_f_f (j0, -1.0, 0.765197686557966551449717526102663221L);
- TEST_f_f (j0, 0.0, 1.0);
- TEST_f_f (j0, 0.125L, 0.996097563041985204620768999453174712L);
- TEST_f_f (j0, 0.75L, 0.864242275166648623555731103820923211L);
- TEST_f_f (j0, 1.0, 0.765197686557966551449717526102663221L);
- TEST_f_f (j0, 1.5, 0.511827671735918128749051744283411720L);
- TEST_f_f (j0, 2.0, 0.223890779141235668051827454649948626L);
- TEST_f_f (j0, 8.0, 0.171650807137553906090869407851972001L);
- TEST_f_f (j0, 10.0, -0.245935764451348335197760862485328754L);
- TEST_f_f (j0, 4.0, -3.9714980986384737228659076845169804197562E-1L);
- TEST_f_f (j0, -4.0, -3.9714980986384737228659076845169804197562E-1L);
-
- TEST_f_f (j0, 0x1.d7ce3ap+107L, 2.775523647291230802651040996274861694514e-17L);
+ RUN_TEST_LOOP_f_f (j0, j0_test_data, );
+ END (j0);
+}
+
+
+static const struct test_f_f_data j1_test_data[] =
+ {
+ START_DATA (j1),
+ /* j1 is the Bessel function of the first kind of order 1 */
+ TEST_f_f (j1, qnan_value, qnan_value),
+ TEST_f_f (j1, plus_infty, 0),
+
+ TEST_f_f (j1, -1.0, -0.440050585744933515959682203718914913L),
+ TEST_f_f (j1, 0.0, 0.0),
+ TEST_f_f (j1, 0.125L, 0.0623780091344946810942311355879361177L),
+ TEST_f_f (j1, 0.75L, 0.349243602174862192523281016426251335L),
+ TEST_f_f (j1, 1.0, 0.440050585744933515959682203718914913L),
+ TEST_f_f (j1, 1.5, 0.557936507910099641990121213156089400L),
+ TEST_f_f (j1, 2.0, 0.576724807756873387202448242269137087L),
+ TEST_f_f (j1, 8.0, 0.234636346853914624381276651590454612L),
+ TEST_f_f (j1, 10.0, 0.0434727461688614366697487680258592883L),
+
+ TEST_f_f (j1, 0x1.3ffp+74L, 1.818984347516051243459364437186082741567e-12L),
#ifndef TEST_FLOAT
- TEST_f_f (j0, -0x1.001000001p+593L, -3.927269966354206207832593635798954916263e-90L);
- TEST_f_f (j0, 0x1p1023L, -1.5665258060609012834424478437196679802783e-155L);
+ TEST_f_f (j1, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L),
+ TEST_f_f (j1, 0x1p1023L, 8.2687542933709649327986678723012001545638e-155L),
#endif
#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
- TEST_f_f (j0, 0x1p16382L, -1.2193782500509000574176799046642541129387e-2466L);
- TEST_f_f (j0, 0x1p16383L, 9.5859502826270374691362975419147645151233e-2467L);
-#endif
-
- END (j0);
-}
-
+ TEST_f_f (j1, 0x1p16382L, 8.0839224448726336195866026476176740513439e-2467L),
+ TEST_f_f (j1, 0x1p16383L, -3.8895531955766020648617743624167352352217e-2467L),
+#endif
+ END_DATA (j1)
+ };
static void
j1_test (void)
@@ -9681,35 +9743,8 @@
/* Function not implemented. */
return;
- /* j1 is the Bessel function of the first kind of order 1 */
-
START (j1);
-
- TEST_f_f (j1, qnan_value, qnan_value);
- TEST_f_f (j1, plus_infty, 0);
-
- TEST_f_f (j1, -1.0, -0.440050585744933515959682203718914913L);
- TEST_f_f (j1, 0.0, 0.0);
- TEST_f_f (j1, 0.125L, 0.0623780091344946810942311355879361177L);
- TEST_f_f (j1, 0.75L, 0.349243602174862192523281016426251335L);
- TEST_f_f (j1, 1.0, 0.440050585744933515959682203718914913L);
- TEST_f_f (j1, 1.5, 0.557936507910099641990121213156089400L);
- TEST_f_f (j1, 2.0, 0.576724807756873387202448242269137087L);
- TEST_f_f (j1, 8.0, 0.234636346853914624381276651590454612L);
- TEST_f_f (j1, 10.0, 0.0434727461688614366697487680258592883L);
-
- TEST_f_f (j1, 0x1.3ffp+74L, 1.818984347516051243459364437186082741567e-12L);
-
-#ifndef TEST_FLOAT
- TEST_f_f (j1, 0x1.ff00000000002p+840L, 1.846591691699331493194965158699937660696e-127L);
- TEST_f_f (j1, 0x1p1023L, 8.2687542933709649327986678723012001545638e-155L);
-#endif
-
-#if defined TEST_LDOUBLE && LDBL_MAX_EXP >= 16384
- TEST_f_f (j1, 0x1p16382L, 8.0839224448726336195866026476176740513439e-2467L);
- TEST_f_f (j1, 0x1p16383L, -3.8895531955766020648617743624167352352217e-2467L);
-#endif
-
+ RUN_TEST_LOOP_f_f (j1, j1_test_data, );
END (j1);
}
@@ -10729,6 +10764,28 @@
}
+static const struct test_f_f_data log_test_data[] =
+ {
+ START_DATA (log),
+ TEST_f_f (log, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+ TEST_f_f (log, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+
+ TEST_f_f (log, 1, 0),
+
+ TEST_f_f (log, -1, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log, -max_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log, minus_infty, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log, plus_infty, plus_infty),
+ TEST_f_f (log, qnan_value, qnan_value),
+
+ TEST_f_f (log, M_El, 1),
+ TEST_f_f (log, 1.0 / M_El, -1),
+ TEST_f_f (log, 2, M_LN2l),
+ TEST_f_f (log, 10, M_LN10l),
+ TEST_f_f (log, 0.75L, -0.287682072451780927439219005993827432L),
+ END_DATA (log)
+ };
+
static void
log_test (void)
{
@@ -10738,27 +10795,35 @@
/* Function not implemented. */
return;
START (log);
-
- TEST_f_f (log, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
- TEST_f_f (log, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
-
- TEST_f_f (log, 1, 0);
-
- TEST_f_f (log, -1, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log, -max_value, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log, minus_infty, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log, plus_infty, plus_infty);
- TEST_f_f (log, qnan_value, qnan_value);
-
- TEST_f_f (log, M_El, 1);
- TEST_f_f (log, 1.0 / M_El, -1);
- TEST_f_f (log, 2, M_LN2l);
- TEST_f_f (log, 10, M_LN10l);
- TEST_f_f (log, 0.75L, -0.287682072451780927439219005993827432L);
-
+ RUN_TEST_LOOP_f_f (log, log_test_data, );
END (log);
}
+
+static const struct test_f_f_data log10_test_data[] =
+ {
+ START_DATA (log10),
+ TEST_f_f (log10, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+ TEST_f_f (log10, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+
+ TEST_f_f (log10, 1, 0),
+
+ /* log10 (x) == qNaN plus invalid exception if x < 0. */
+ TEST_f_f (log10, -1, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log10, -max_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log10, minus_infty, qnan_value, INVALID_EXCEPTION),
+
+ TEST_f_f (log10, plus_infty, plus_infty),
+ TEST_f_f (log10, qnan_value, qnan_value),
+
+ TEST_f_f (log10, 0.1L, -1),
+ TEST_f_f (log10, 10.0, 1),
+ TEST_f_f (log10, 100.0, 2),
+ TEST_f_f (log10, 10000.0, 4),
+ TEST_f_f (log10, M_El, M_LOG10El),
+ TEST_f_f (log10, 0.75L, -0.124938736608299953132449886193870744L),
+ END_DATA (log10)
+ };
static void
log10_test (void)
@@ -10770,30 +10835,31 @@
return;
START (log10);
-
- TEST_f_f (log10, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
- TEST_f_f (log10, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
-
- TEST_f_f (log10, 1, 0);
-
- /* log10 (x) == qNaN plus invalid exception if x < 0. */
- TEST_f_f (log10, -1, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log10, -max_value, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log10, minus_infty, qnan_value, INVALID_EXCEPTION);
-
- TEST_f_f (log10, plus_infty, plus_infty);
- TEST_f_f (log10, qnan_value, qnan_value);
-
- TEST_f_f (log10, 0.1L, -1);
- TEST_f_f (log10, 10.0, 1);
- TEST_f_f (log10, 100.0, 2);
- TEST_f_f (log10, 10000.0, 4);
- TEST_f_f (log10, M_El, M_LOG10El);
- TEST_f_f (log10, 0.75L, -0.124938736608299953132449886193870744L);
-
+ RUN_TEST_LOOP_f_f (log10, log10_test_data, );
END (log10);
}
+
+static const struct test_f_f_data log1p_test_data[] =
+ {
+ START_DATA (log1p),
+ TEST_f_f (log1p, 0, 0),
+ TEST_f_f (log1p, minus_zero, minus_zero),
+
+ TEST_f_f (log1p, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+ TEST_f_f (log1p, -2, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log1p, -max_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log1p, minus_infty, qnan_value, INVALID_EXCEPTION),
+
+ TEST_f_f (log1p, plus_infty, plus_infty),
+ TEST_f_f (log1p, qnan_value, qnan_value),
+
+ TEST_f_f (log1p, M_El - 1.0, 1),
+
+ TEST_f_f (log1p, -0.25L, -0.287682072451780927439219005993827432L),
+ TEST_f_f (log1p, -0.875, -2.07944154167983592825169636437452970L),
+ END_DATA (log1p)
+ };
static void
log1p_test (void)
@@ -10805,26 +10871,33 @@
return;
START (log1p);
-
- TEST_f_f (log1p, 0, 0);
- TEST_f_f (log1p, minus_zero, minus_zero);
-
- TEST_f_f (log1p, -1, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
- TEST_f_f (log1p, -2, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log1p, -max_value, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log1p, minus_infty, qnan_value, INVALID_EXCEPTION);
-
- TEST_f_f (log1p, plus_infty, plus_infty);
- TEST_f_f (log1p, qnan_value, qnan_value);
-
- TEST_f_f (log1p, M_El - 1.0, 1);
-
- TEST_f_f (log1p, -0.25L, -0.287682072451780927439219005993827432L);
- TEST_f_f (log1p, -0.875, -2.07944154167983592825169636437452970L);
-
+ RUN_TEST_LOOP_f_f (log1p, log1p_test_data, );
END (log1p);
}
+
+static const struct test_f_f_data log2_test_data[] =
+ {
+ START_DATA (log2),
+ TEST_f_f (log2, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+ TEST_f_f (log2, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+
+ TEST_f_f (log2, 1, 0),
+
+ TEST_f_f (log2, -1, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log2, -max_value, qnan_value, INVALID_EXCEPTION),
+ TEST_f_f (log2, minus_infty, qnan_value, INVALID_EXCEPTION),
+
+ TEST_f_f (log2, plus_infty, plus_infty),
+ TEST_f_f (log2, qnan_value, qnan_value),
+
+ TEST_f_f (log2, M_El, M_LOG2El),
+ TEST_f_f (log2, 2.0, 1),
+ TEST_f_f (log2, 16.0, 4),
+ TEST_f_f (log2, 256.0, 8),
+ TEST_f_f (log2, 0.75L, -.415037499278843818546261056052183492L),
+ END_DATA (log2)
+ };
static void
log2_test (void)
@@ -10836,70 +10909,72 @@
return;
START (log2);
-
- TEST_f_f (log2, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
- TEST_f_f (log2, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
-
- TEST_f_f (log2, 1, 0);
-
- TEST_f_f (log2, -1, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log2, -max_value, qnan_value, INVALID_EXCEPTION);
- TEST_f_f (log2, minus_infty, qnan_value, INVALID_EXCEPTION);
-
- TEST_f_f (log2, plus_infty, plus_infty);
- TEST_f_f (log2, qnan_value, qnan_value);
-
- TEST_f_f (log2, M_El, M_LOG2El);
- TEST_f_f (log2, 2.0, 1);
- TEST_f_f (log2, 16.0, 4);
- TEST_f_f (log2, 256.0, 8);
- TEST_f_f (log2, 0.75L, -.415037499278843818546261056052183492L);
-
+ RUN_TEST_LOOP_f_f (log2, log2_test_data, );
END (log2);
}
+static const struct test_f_f_data logb_test_data[] =
+ {
+ START_DATA (logb),
+ TEST_f_f (logb, plus_infty, plus_infty),
+ TEST_f_f (logb, minus_infty, plus_infty),
+
+ TEST_f_f (logb, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+
+ TEST_f_f (logb, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION),
+ TEST_f_f (logb, qnan_value, qnan_value),
+
+ TEST_f_f (logb, 1, 0),
+ TEST_f_f (logb, M_El, 1),
+ TEST_f_f (logb, 1024, 10),
+ TEST_f_f (logb, -2000, 10),
+
+ TEST_f_f (logb, 0x0.1p-127, -131),
+ TEST_f_f (logb, 0x0.01p-127, -135),
+ TEST_f_f (logb, 0x0.011p-127, -135),
+#ifndef TEST_FLOAT
+ TEST_f_f (logb, 0x0.8p-1022, -1023),
+ TEST_f_f (logb, 0x0.1p-1022, -1026),
+ TEST_f_f (logb, 0x0.00111p-1022, -1034),
+ TEST_f_f (logb, 0x0.00001p-1022, -1042),
+ TEST_f_f (logb, 0x0.000011p-1022, -1042),
+ TEST_f_f (logb, 0x0.0000000000001p-1022, -1074),
+#endif
+#if defined TEST_LDOUBLE && LDBL_MIN_EXP - LDBL_MANT_DIG <= -16400
+ TEST_f_f (logb, 0x1p-16400L, -16400),
+ TEST_f_f (logb, 0x.00000000001p-16382L, -16426),
+#endif
+ END_DATA (logb)
+ };
+
static void
logb_test (void)
{
START (logb);
-
- TEST_f_f (logb, plus_infty, plus_infty);
- TEST_f_f (logb, minus_infty, plus_infty);
-
- TEST_f_f (logb, 0, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
-
- TEST_f_f (logb, minus_zero, minus_infty, DIVIDE_BY_ZERO_EXCEPTION);
- TEST_f_f (logb, qnan_value, qnan_value);
-
- TEST_f_f (logb, 1, 0);
- TEST_f_f (logb, M_El, 1);
- TEST_f_f (logb, 1024, 10);
- TEST_f_f (logb, -2000, 10);
-
- TEST_f_f (logb, 0x0.1p-127, -131);
- TEST_f_f (logb, 0x0.01p-127, -135);
- TEST_f_f (logb, 0x0.011p-127, -135);
-#ifndef TEST_FLOAT
- TEST_f_f (logb, 0x0.8p-1022, -1023);
- TEST_f_f (logb, 0x0.1p-1022, -1026);
- TEST_f_f (logb, 0x0.00111p-1022, -1034);
- TEST_f_f (logb, 0x0.00001p-1022, -1042);
- TEST_f_f (logb, 0x0.000011p-1022, -1042);
- TEST_f_f (logb, 0x0.0000000000001p-1022, -1074);
-#endif
-#if defined TEST_LDOUBLE && LDBL_MIN_EXP - LDBL_MANT_DIG <= -16400
- TEST_f_f (logb, 0x1p-16400L, -16400);
- TEST_f_f (logb, 0x.00000000001p-16382L, -16426);
-#endif
-
+ RUN_TEST_LOOP_f_f (logb, logb_test_data, );
END (logb);
}
+static const struct test_f_f_data logb_downward_test_data[] =
+ {
+ START_DATA (logb_downward),
+ /* IEEE 754-2008 says (section 5.3.3) that "logB(1) is +0.". Libm
+ should not return -0 from logb in any rounding mode. PowerPC32 has
+ failed with this test for power4 logb (and logbl on all PowerPC
+ platforms) in the past due to instruction selection. GCC PR 52775
+ provides the availability of the fcfid insn in 32-bit mode which
[... 3676 lines stripped ...]
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits