NetBSD-Bugs archive

[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

>Number:         46433
>Category:       lib
>Synopsis:       tests/lib/libm/t_exp should not use exp() itself
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>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:
 - expf_product
 - exp2_product
 - exp2f_product

See the source code.
N/A, Sorry.

Home | Main Index | Thread Index | Old Index