[ieeefp-tests-devel] Tests for log of negative numbers?
Raymond Toy
raymond.toy at ericsson.com
Mon Aug 29 20:14:24 UTC 2005
In the test suite, there are quite a few tests for log of negative
numbers. I was in the process of converting the generated tests to
return +quiet-<float>-nan-mask+ for :uo tests. However, this caused a
huge increase in the number of failures.
One of them is SINGLE-LOG-VALUE.41:
Form: (PROGN
"logs n uo v 80800000 0"
(IEEEFP-TESTS::SET-UP-FPCW-STATE :NEAREST)
(LET ((IEEEFP-TESTS::RESULT
(LOG
(IEEE754:MAKE-SINGLE-FLOAT
IEEEFP-TESTS::+LEAST-NEGATIVE-NORMALIZED-SINGLE-FLOAT+))))
(IF (COMPLEXP IEEEFP-TESTS::RESULT)
T
(LET ((IEEEFP-TESTS::RESULT-BITS
(IEEE754:SINGLE-FLOAT-BITS IEEEFP-TESTS::RESULT)))
(= (LOGAND IEEEFP-TESTS::RESULT-BITS
IEEEFP-TESTS::+QUIET-SINGLE-FLOAT-NAN-MASK+)
IEEEFP-TESTS::+QUIET-SINGLE-FLOAT-NAN-MASK+)))))
Expected value: T
The tests expects (log <negative) to be a NaN, but we were passing the
test because we returned T because we got a complex result.
Is this the desired answer? In terms of the test, I think we should
fail the test. When I modify the test to return the logand result and
an expected answer of quiet-single-float-nan-mask, we do fail, of
course.
Another interesting test is single-log-value.54. CMUCL says (log
<negative quiet NaN>) is #c(<quiet nan> pi). That's seems debatable.
Anyway, I wanted your opinion on whether Lisp should fail
single-log-value.41.
Ray
More information about the Ieeefp-tests-devel
mailing list