Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libm Fix and revive test of atan_inf_neg, atan_inf...



details:   https://anonhg.NetBSD.org/src/rev/4fd5d7884bf8
branches:  trunk
changeset: 785573:4fd5d7884bf8
user:      isaki <isaki%NetBSD.org@localhost>
date:      Thu Mar 21 02:10:52 2013 +0000

description:
Fix and revive test of atan_inf_neg, atan_inf_pos and atan_tan on i386.
PR port-i386/46108.
The machine epsilon 1.0e-40 is too severe and nonsense for double
because DBL_EPSILON is about 2.2e-16 .  I think that 1.0e-15 is
enough good, in this case.
XXX However, test of atan_tan should be replaced for other reasons.

diffstat:

 tests/lib/libm/t_atan.c |  20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diffs (51 lines):

diff -r 4db4db56d600 -r 4fd5d7884bf8 tests/lib/libm/t_atan.c
--- a/tests/lib/libm/t_atan.c   Thu Mar 21 02:04:17 2013 +0000
+++ b/tests/lib/libm/t_atan.c   Thu Mar 21 02:10:52 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_atan.c,v 1.6 2012/03/11 06:36:05 jruoho Exp $ */
+/* $NetBSD: t_atan.c,v 1.7 2013/03/21 02:10:52 isaki Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -64,11 +64,7 @@
 {
 #ifndef __vax__
        const double x = -1.0L / 0.0L;
-       const double eps = 1.0e-40;
-
-       if (strcmp(atf_config_get("atf_arch"), "i386") == 0 &&
-           system("cpuctl identify 0 | grep -q QEMU") != 0)
-               atf_tc_expect_fail("PR port-i386/46108");
+       const double eps = 1.0e-15;
 
        if (fabs(atan(x) + M_PI_2) > eps)
                atf_tc_fail_nonfatal("atan(-Inf) != -pi/2");
@@ -85,11 +81,7 @@
 {
 #ifndef __vax__
        const double x = +1.0L / 0.0L;
-       const double eps = 1.0e-40;
-
-       if (strcmp(atf_config_get("atf_arch"), "i386") == 0 &&
-           system("cpuctl identify 0 | grep -q QEMU") != 0)
-               atf_tc_expect_fail("PR port-i386/46108");
+       const double eps = 1.0e-15;
 
        if (fabs(atan(x) - M_PI_2) > eps)
                atf_tc_fail_nonfatal("atan(+Inf) != pi/2");
@@ -106,14 +98,10 @@
 {
 #ifndef __vax__
        const double x[] = { 0.0, 1.0, M_PI / 2, M_PI / 3, M_PI / 6 };
-       const double eps = 1.0e-40;
+       const double eps = 1.0e-15;
        double y;
        size_t i;
 
-       if (strcmp(atf_config_get("atf_arch"), "i386") == 0 &&
-           system("cpuctl identify 0 | grep -q QEMU") != 0)
-               atf_tc_expect_fail("PR port-i386/46108");
-
        for (i = 0; i < __arraycount(x); i++) {
 
                y = atan(tan(x[i]));



Home | Main Index | Thread Index | Old Index