History log of /netbsd-current/tests/lib/libm/t_cosh.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126
# 1.7 07-Nov-2018 riastradh

Fix up libm tests.

- Fix up last few digits of a lot of known-answer tests.

Confirmed with GNU mpfr to 200 bits of precision and cross-checked
with whatever libm Ubuntu ships with.

- Test relative error, not absolute error.

- Set bounds in terms of *_EPSILON, not magic numbers.

*_EPSILON is twice the largest relative error of a correctly
rounded operation, and equal to the largest relative error of an
operation with up to 1ulp error.

Most of the operations we're testing are not correctly rounded, but
they ought to be no more than 1ulp away. For the few cases where
that's not a priori clear (like comparing cbrt and pow(x, 1/3)),
use twice *_EPSILON to allow some leeway.

- Write the success condition positively as error <= eps.

This comes out false if the result is a NaN, meaning failure. In
contrast, if we write error > eps for the _failure_ condition, then
if the result is a NaN, it will also come out false, but meaning
success, which is not what we want.

- Fix the trigonometric test cases near bad spots.

sin(pi - d) for nonzero d is not zero; it is d + O(d^3). pi is not
a floating-point number, so these results should be approximately
the nonzero error of our approximation to pi. Likewise with
cos(pi/2 - d) and tan(pi + d).

(Yes, I know the sin _function_ is ill-conditioned near pi so you
shouldn't pass approximate inputs near there, but that's separate
from whether a sin _implementation_ gives an answer that is wrong
by quintillions of ulps.)

Since on x86 (i386 and amd64 alike) we currently use x87 hardware
trigonometric instructions, which are bad, these are marked xfail
on x86 for now until we switch to software implementations (coming
soon to a repository near you).

- Use %.8g, %.17g, %.35g to print float, double, long double in failures.

This should be enough to identify the problematic outputs and/or
reproduce the computation, even if long double is binary128 with
115 bits of precision.

If there are any new libm test failures after this, tell me what
architecture you're on and send me the atf output and I'll try to
figure it out.


Revision tags: netbsd-8-1-RC1 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.6 03-Mar-2014 martin

branches: 1.6.24;
Remove all cargo-cult #ifndef __vax__ from the tests, that just paper
over bugs in the vax libm.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.5 09-Apr-2013 isaki

Use a pre-calculated value as expected result, instead of
comparing it in a mathematical formula.
PR lib/46434 (and see also 46433).


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE yamt-pagecache-tag8 netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 agc-symver-base netbsd-6-1-RC2 netbsd-6-1-RC1 yamt-pagecache-base8 netbsd-6-0-1-RELEASE yamt-pagecache-base7 matt-nb6-plus-nbase yamt-pagecache-base6 netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base5 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base
# 1.4 18-Oct-2011 jruoho

branches: 1.4.2; 1.4.8;
Reduce tolerance even more.


# 1.3 18-Oct-2011 jruoho

Adjust and add some printfs.


# 1.2 16-Oct-2011 jruoho

As couple of checks fails on i386/qemu, reduce tolerance.


# 1.1 16-Oct-2011 jruoho

Basic IEEE tests for the hyperbolic sine and cosine.