Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libm In the exp2_values test case, provide separat...
details: https://anonhg.NetBSD.org/src/rev/c6d5dc0e9d4d
branches: trunk
changeset: 332748:c6d5dc0e9d4d
user: gson <gson%NetBSD.org@localhost>
date: Tue Oct 07 16:53:44 2014 +0000
description:
In the exp2_values test case, provide separate expected return values
for the float case, reflecting the actual exp2f() argument value after
rounding to float precision. Fixes PR lib/49256. Thanks to Makoto
Kamada and Tetsuya Isaki for the analysis.
diffstat:
tests/lib/libm/t_exp.c | 36 +++++++++++++++++-------------------
1 files changed, 17 insertions(+), 19 deletions(-)
diffs (68 lines):
diff -r 32dc9c0d243e -r c6d5dc0e9d4d tests/lib/libm/t_exp.c
--- a/tests/lib/libm/t_exp.c Tue Oct 07 15:34:05 2014 +0000
+++ b/tests/lib/libm/t_exp.c Tue Oct 07 16:53:44 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_exp.c,v 1.7 2014/03/17 11:08:11 martin Exp $ */
+/* $NetBSD: t_exp.c,v 1.8 2014/10/07 16:53:44 gson Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -141,42 +141,40 @@
{
static const struct {
double x;
- double y;
+ double d_y;
+ float f_y;
double d_eps;
double f_eps;
} v[] = {
#if __DBL_MAX_EXP__ > 128
/* The largest double constant */
- { 0x1.fffffffffffffp9, 0x1.ffffffffffd3ap1023,
+ { 0x1.fffffffffffffp9, 0x1.ffffffffffd3ap1023, 0.00,
0x1p969, 0.0 },
/* The largest float constant */
- { 0x1.fffffep6, 0x1.ffff4ep+127, 6e30, 0.0 },
+ { 0x1.fffffep6, 0x1.ffff4ep+127, 0x1.ffff4ep+127, 6e30, 0.0 },
#endif
#ifdef T_LIBM_PLUS_INF
- { T_LIBM_PLUS_INF, T_LIBM_PLUS_INF, 0.0, 0.0 },
+ { T_LIBM_PLUS_INF, T_LIBM_PLUS_INF, T_LIBM_PLUS_INF, 0.0, 0.0 },
#endif
/* The few values from the old tests */
/* Results from i386/amd64, d_eps needed on i386 */
- { 1.1, 0x1.125fbee250664p+1, 0x1p-52, 0x1.8p-22 },
- { 2.2, 0x1.2611186bae675p+2, 0x1p-51, 0x1.8p-21 },
- { 3.3, 0x1.3b2c47bff8328p+3, 0x1p-50, 0x1.8p-20 },
- { 4.4, 0x1.51cb453b9536ep+4, 0x1p-49, 0x1.8p-19 },
- { 5.5, 0x1.6a09e667f3bcdp+5, 0x1p-48, 0x1.8p-18 },
- { 6.6, 0x1.8406003b2ae5bp+6, 0x1p-47, 0x1.8p-17 },
- /*
- * These two currently fail for 'float'.
- * 8.8 is definitely out by more than it should be.
- */
- { 7.7, 0x1.9fdf8bcce533ep+7, 0x1p-46, 0x1.8p-16 },
- { 8.8, 0x1.bdb8cdadbe124p+8, 0x1p-45, 0x1.8p-15 },
+ /* f_y values calculated using py-mpmath */
+ { 1.1, 0x1.125fbee250664p+1, 0x1.125fc0p+1, 0x1p-52, 0x1.8p-22 },
+ { 2.2, 0x1.2611186bae675p+2, 0x1.26111ap+2, 0x1p-51, 0x1.8p-21 },
+ { 3.3, 0x1.3b2c47bff8328p+3, 0x1.3b2c48p+3, 0x1p-50, 0x1.8p-20 },
+ { 4.4, 0x1.51cb453b9536ep+4, 0x1.51cb46p+4, 0x1p-49, 0x1.8p-19 },
+ { 5.5, 0x1.6a09e667f3bcdp+5, 0x1.6a09e6p+5, 0x1p-48, 0x1.8p-18 },
+ { 6.6, 0x1.8406003b2ae5bp+6, 0x1.8405fep+6, 0x1p-47, 0x1.8p-17 },
+ { 7.7, 0x1.9fdf8bcce533ep+7, 0x1.9fdf88p+7, 0x1p-46, 0x1.8p-16 },
+ { 8.8, 0x1.bdb8cdadbe124p+8, 0x1.bdb8d2p+8, 0x1p-45, 0x1.8p-15 },
};
unsigned int i;
for (i = 0; i < __arraycount(v); i++) {
- T_LIBM_CHECK(i, exp2, v[i].x, v[i].y, v[i].d_eps);
+ T_LIBM_CHECK(i, exp2, v[i].x, v[i].d_y, v[i].d_eps);
if (i > 1)
- T_LIBM_CHECK(i, exp2f, v[i].x, v[i].y, v[i].f_eps);
+ T_LIBM_CHECK(i, exp2f, v[i].x, v[i].f_y, v[i].f_eps);
}
}
Home |
Main Index |
Thread Index |
Old Index