Use of C99 extra long double math functions after r236148

Peter Jeremy peter at rulingia.com
Sun Aug 12 21:56:58 UTC 2012


On 2012-Jul-28 22:58:24 +1000, Peter Jeremy <peter at server.rulingia.com> wrote:
>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π/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=. 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.

-- 
Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-numerics/attachments/20120812/419eae22/attachment.pgp


More information about the freebsd-numerics mailing list