Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2012 07:56:48 +1000
From:      Peter Jeremy <peter@rulingia.com>
To:        freebsd-numerics@freebsd.org
Subject:   Re: Use of C99 extra long double math functions after r236148
Message-ID:  <20120812215648.GA19810@server.rulingia.com>
In-Reply-To: <20120728125824.GA26553@server.rulingia.com>
References:  <20120717225328.GA86902@server.rulingia.com> <20120717232740.GA95026@troutmask.apl.washington.edu> <20120718001337.GA87817@server.rulingia.com> <20120718123627.D1575@besplex.bde.org> <20120722121219.GC73662@server.rulingia.com> <500DAD41.5030104@missouri.edu> <20120724113214.G934@besplex.bde.org> <501204AD.30605@missouri.edu> <20120727032611.GB25690@server.rulingia.com> <20120728125824.GA26553@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Q68bSM7Ycu6FN28Q
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On 2012-Jul-28 22:58:24 +1000, Peter Jeremy <peter@server.rulingia.com> wro=
te:
>My test harness can be found at http://www.rulingia.com/~peter/ctest.c
>There are no special compilation options, it just needs to be linked
>with '-lm' (and '-ldl' on Linux).  For normal use, just run the
>executable - it will report any failures.  For "finite" arguments, it
>currently uses 3=CF=80/4 and 32769 other random numbers (the latter is
>S_COUNT+1).

stephen@ found that it wasn't checking long-double NAN results (it
checked float results twice due to a typo).  I've fixed that and can't
see any other similar errors.  An updated version can be found at
http://www.rulingia.com/~peter/ctest.c

Also, because it uses dlfunc() to locate functions for testing, all
test functions have to be in shared libraries - it won't detect
functions directly linked in.  This means you need Makefile entries
similar to:

ctest: ctest.c libfoo.so
	cc ${CFLAGS} -Wl,-rpath=3D. ctest.c -o ctest -L. -lfoo -lm

libfoo.so: foo.c
	cc ${CFLAGS} -fPIC -c foo.c
	cc ${CFLAGS} -shared -Wl,-soname,libfoo.so -o libfoo.so foo.o

And, since I don't think I mentioned it before, it does bitwise
comparisons of finite results.  Particularly in cases where the result
is a transcendental number, this can result in false positives where
the result is out by a few ULP.  You will need to interpret the
actual report to decide whether the result is acceptable.

--=20
Peter Jeremy

--Q68bSM7Ycu6FN28Q
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iEYEARECAAYFAlAoJqAACgkQ/opHv/APuIdqGACdE2bxIMKI1o1qIQKEcs3gaS1G
9qQAoKVbKzrHD2f9OKZ5C2HHMARh+u+0
=PGQt
-----END PGP SIGNATURE-----

--Q68bSM7Ycu6FN28Q--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120812215648.GA19810>