[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
lib/46433: tests/lib/libm/t_exp should not use exp() itself
>Synopsis: tests/lib/libm/t_exp should not use exp() itself
>Arrival-Date: Wed May 09 03:05:00 +0000 2012
>Originator: Tetsuya Isaki
>Release: NetBSD 6.0_BETA/i386
The 'exp_product' test in tests/lib/libm/t_exp.c (rev1.1)
uses the following formula:
exp(x + y) = exp(x) * exp(y)
therefore, the test code is:
if ( exp(x+y) - (exp(x) * exp(y)) > eps )
then it fails.
However, it is not appropriate to use exp() oneself for a test
for exp(). For example, this test will pass if a broken exp()
that always return zero.
The following tests have a similar problem as far as I found:
See the source code.
Main Index |
Thread Index |