Correctly compute ulp near zero.
commite96e37676f0b3dd2a7c42898bbf9aabb90f91d75
authorCarlos O'Donell <carlos@redhat.com>
Fri, 24 May 2013 18:03:14 +0000 (24 14:03 -0400)
committerCarlos O'Donell <carlos@redhat.com>
Fri, 24 May 2013 18:23:15 +0000 (24 14:23 -0400)
tree1a4dbd60415ff53df5fc0930658747df7d614c66
parent86bd05fbc8b3a635148f6a7d8b4fb89c9a524e58
Correctly compute ulp near zero.

The current value used for ulp near zero is wrong,
and this commit fixes it such that ulp(0) is the smallest
subnormal value nearest to zero, which makes the most
sense for testing values near zero. Note that this is not
what Java does; they use the nearest normal value, which
is less accurate than what we want for glibc. Note that
there is no correct implementation of ulp since there
is no strict mathmatical definition that is accepted by
all groups using IEEE 754.

Previously with the large ulp values near zero there
were tests that previously passed, but were in fact
billions of ulp away from the precise answer. With this
commit we now need to disable one of the cpow tests which
is revealed to be inaccurate (bug 14473).

---

2013-05-24  Carlos O'Donell  <carlos@redhat.com>

* math/libm-test.inc (MAX_EXP): Define.
(ULPDIFF): Define.
(ulp): New function.
(check_float_internal): Use ULPDIFF.
(cpow_test): Disable failing test.
(check_ulp): Test ulp() implemetnation.
(main): Call check_ulp before starting tests.
ChangeLog
math/libm-test.inc