Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libm Adjust and add some printfs.
details: https://anonhg.NetBSD.org/src/rev/ec3c5efb57ed
branches: trunk
changeset: 770464:ec3c5efb57ed
user: jruoho <jruoho%NetBSD.org@localhost>
date: Tue Oct 18 04:51:01 2011 +0000
description:
Adjust and add some printfs.
diffstat:
tests/lib/libm/t_cosh.c | 16 ++++++++++++----
tests/lib/libm/t_sinh.c | 16 ++++++++++++----
2 files changed, 24 insertions(+), 8 deletions(-)
diffs (116 lines):
diff -r ee3fcd52f4a2 -r ec3c5efb57ed tests/lib/libm/t_cosh.c
--- a/tests/lib/libm/t_cosh.c Tue Oct 18 00:33:47 2011 +0000
+++ b/tests/lib/libm/t_cosh.c Tue Oct 18 04:51:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_cosh.c,v 1.2 2011/10/16 13:42:22 jruoho Exp $ */
+/* $NetBSD: t_cosh.c,v 1.3 2011/10/18 04:51:01 jruoho Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_cosh.c,v 1.2 2011/10/16 13:42:22 jruoho Exp $");
+__RCSID("$NetBSD: t_cosh.c,v 1.3 2011/10/18 04:51:01 jruoho Exp $");
#include <atf-c.h>
#include <math.h>
@@ -47,7 +47,7 @@
ATF_TC_BODY(cosh_def, tc)
{
#ifndef __vax__
- const double x[] = { -9.0, -1.0, -0.05, 0.0, 1.0, 10.0, 20.0 };
+ const double x[] = { 0.005, 0.05, 0.0, 1.0, 10.0, 20.0 };
const double eps = 1.0e-8;
double y, z;
size_t i;
@@ -57,6 +57,10 @@
y = cosh(x[i]);
z = (exp(x[i]) + exp(-x[i])) / 2;
+ (void)fprintf(stderr,
+ "cosh(%0.03f) = %f\n(exp(%0.03f) + "
+ "exp(-%0.03f)) / 2 = %f\n", x[i], y, x[i], x[i], z);
+
if (fabs(y - z) > eps)
atf_tc_fail_nonfatal("cosh(%0.03f) != %0.03f\n",
x[i], z);
@@ -158,7 +162,7 @@
ATF_TC_BODY(coshf_def, tc)
{
#ifndef __vax__
- const float x[] = { -9.0, -1.0, -0.05, 0.0, 1.0, 10.0, 20.0 };
+ const double x[] = { 0.005, 0.05, 0.0, 1.0, 10.0, 20.0 };
const float eps = 1.0e-7;
float y, z;
size_t i;
@@ -168,6 +172,10 @@
y = coshf(x[i]);
z = (expf(x[i]) + expf(-x[i])) / 2;
+ (void)fprintf(stderr,
+ "coshf(%0.03f) = %f\n(expf(%0.03f) + "
+ "expf(-%0.03f)) / 2 = %f\n", x[i], y, x[i], x[i], z);
+
if (fabsf(y - z) > eps)
atf_tc_fail_nonfatal("coshf(%0.03f) != %0.03f\n",
x[i], z);
diff -r ee3fcd52f4a2 -r ec3c5efb57ed tests/lib/libm/t_sinh.c
--- a/tests/lib/libm/t_sinh.c Tue Oct 18 00:33:47 2011 +0000
+++ b/tests/lib/libm/t_sinh.c Tue Oct 18 04:51:01 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: t_sinh.c,v 1.2 2011/10/16 13:42:22 jruoho Exp $ */
+/* $NetBSD: t_sinh.c,v 1.3 2011/10/18 04:51:01 jruoho Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: t_sinh.c,v 1.2 2011/10/16 13:42:22 jruoho Exp $");
+__RCSID("$NetBSD: t_sinh.c,v 1.3 2011/10/18 04:51:01 jruoho Exp $");
#include <atf-c.h>
#include <math.h>
@@ -47,7 +47,7 @@
ATF_TC_BODY(sinh_def, tc)
{
#ifndef __vax__
- const double x[] = { -9.0, -1.0, -0.05, 0.0, 1.0, 10.0, 20.0 };
+ const double x[] = { 0.005, 0.05, 0.0, 1.0, 10.0, 20.0 };
const double eps = 1.0e-8;
double y, z;
size_t i;
@@ -57,6 +57,10 @@
y = sinh(x[i]);
z = (exp(x[i]) - exp(-x[i])) / 2;
+ (void)fprintf(stderr,
+ "sinh(%0.03f) = %f\n(exp(%0.03f) - "
+ "exp(-%0.03f)) / 2 = %f\n", x[i], y, x[i], x[i], z);
+
if (fabs(y - z) > eps)
atf_tc_fail_nonfatal("sinh(%0.03f) != %0.03f\n",
x[i], z);
@@ -160,7 +164,7 @@
ATF_TC_BODY(sinhf_def, tc)
{
#ifndef __vax__
- const float x[] = { -9.0, -1.0, -0.05, 0.0, 1.0, 10.0, 20.0 };
+ const float x[] = { 0.005, 0.05, 0.0, 1.0, 10.0, 20.0 };
const float eps = 1.0e-4;
float y, z;
size_t i;
@@ -170,6 +174,10 @@
y = sinhf(x[i]);
z = (expf(x[i]) - expf(-x[i])) / 2;
+ (void)fprintf(stderr,
+ "sinhf(%0.03f) = %f\n(expf(%0.03f) - "
+ "expf(-%0.03f)) / 2 = %f\n", x[i], y, x[i], x[i], z);
+
if (fabsf(y - z) > eps)
atf_tc_fail_nonfatal("sinhf(%0.03f) != %0.03f\n",
x[i], z);
Home |
Main Index |
Thread Index |
Old Index