Commit Graph

241 Commits

Author SHA1 Message Date
Joseph Myers d8cd06db62 Improve tgamma accuracy (bugs 2546, 2560, 5159, 15426). 2013-05-08 11:58:18 +00:00
Joseph Myers 5bf96de5ef Consistently use TEST_f_f1 in gamma tests. 2013-05-06 20:23:01 +00:00
Adhemerval Zanella 16e616a72f PowerPC: fix hypot/hypof FP exceptions
This patch fixes hypot/hypotf spurious floating-point exceptions
generate by internal operations.
2013-05-06 14:40:17 -05:00
Joseph Myers b7dab1e4d7 Remove unused libm-test expected-failure mechanism. 2013-05-04 16:45:15 +00:00
Joseph Myers a7548d41a7 Use static initializers for constant variables in libm-test.inc. 2013-05-04 13:08:34 +00:00
Joseph Myers c31a5b1e8f Consistently use TEST_f_f1 in lgamma tests. 2013-05-03 19:05:37 +00:00
Joseph Myers d5dc2af390 Don't use IGNORE_ZERO_INF_SIGN in hypot tests. 2013-05-03 19:04:52 +00:00
Joseph Myers 10de07f5fd Fix catan, catanh spurious underflows (bug 15423). 2013-05-01 10:07:00 +00:00
Joseph Myers caf84319c1 Fix catan, catanh inaccuracy from atan2 denominators near 0 (bug 15416). 2013-04-30 11:27:35 +00:00
Joseph Myers f2da779309 Integrate errno testing better in libm-test.inc. 2013-04-29 20:36:48 +00:00
Joseph Myers 4d14f4499d Add missing semicolons to libm-test.inc tests. 2013-04-29 13:48:19 +00:00
Joseph Myers 5b4217d71f Fix catan, catanh spurious overflows (bug 15409). 2013-04-27 14:57:41 +00:00
Joseph Myers 9457fd952c Fix catan, catanh missing underflows (bug 15406). 2013-04-26 19:26:22 +00:00
Joseph Myers f0302940e7 Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
Carlos O'Donell 418601aa84 math: Use accurate answers for cos and sincos.
Use the most accurate hex literals possible for the answers to the
cos and sincos tests that vary according to the error in the rounding
of PI/2.

---

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

	* math/libm-test.inc (cos_test): Use accurate hex constants.
	(sincost_test): Likewise.
2013-04-24 16:29:33 -04:00
Joseph Myers 5e22180060 Add catan, catanh tests at +/- 1 and +/- i. 2013-04-24 20:14:15 +00:00
Joseph Myers 2f38fbfe09 Fix catan, catanh inaccuracy through use of log (bug 15394). 2013-04-24 18:49:13 +00:00
Carlos O'Donell aba5e333d4 libm-test.inc: Fix tests where cos(PI/2) != 0.
The value of PI is never exactly PI in any floating point representation,
and the value of PI/2 is never PI/2. It is wrong to expect cos(M_PI_2l)
to return 0, instead it will return an answer that is  non-zero because
M_PI_2l doesn't round to exactly PI/2 in the type used.

That is to say that the correct answer is to do the following:
* Take PI or PI/2.
* Round to the floating point representation.
* Take the rounded value and compute an infinite precision cos or sin.
* Use the rounded result of the infinite precision cos or sin as the
  answer to the test.

I used printf to do the type rounding, and Wolfram's Alpha to do the
infinite precision cos calculations.

The following changes bring x86-64 and x86 to 1/2 ulp for two tests.
It shows that the x86 cos implementation is quite good, and that
our test are flawed.

Unfortunately given that the rounding errors are type dependent we
need to fix this for each type. No regressions on x86-64 or x86.

---

2013-04-11  Carlos O'Donell  <carlos@redhat.com>

	* math/libm-test.inc (cos_test): Fix PI/2 test.
	(sincos_test): Likewise.
	* sysdeps/x86_64/fpu/libm-test-ulps: Regenerate.
	* sysdeps/i386/fpu/libm-test-ulps: Regenerate.
2013-04-11 08:52:18 -04:00
Carlos O'Donell 26510bdda1 New Makefile target `regen-ulps'.
The wiki "Regeneration" page has this to say about update ULPs.

"The libm-test-ulps files are semiautomatically updated. To
update an ulps baseline, run each of the failing tests (test-float,
 test-double, etc.) with -u; this will generate a file called ULPs;
concatenate each of those files with the existing libm-test-ulps
file, after removing any entries for particularly huge numbers of
ulps that you do not want to mark as expected. Then run
gen-libm-test.pl -n -u FILE where FILE is the concatenated file
produced in the previous step. This generates a file called
NewUlps which is the new sorted version of libm-test-ulps."

The same information is listed in math/README.libm-test, and is a
lot of manual work that you often want to run over-and-over again
while working on a particular test.

The `regen-ulps' convenience target does this automatically for
developers.

We strictly assume the source tree is readonly and add a
new --output-dir option to libm-test.inc to allow for writing
out ULPs to $(objpfx).

When run the new target does the following:
* Starts with the baseline ULPs file.
* Runs each of the libm math tests with -u.
* Adds new changes seen with -u to the baseline.
* Sorts and prepares the test output with gen-libm-test.pl.
* Leaves math/NewUlps in your build tree to copy to your source
  tree, cleanup, and checkin.

The math test documentation in math/README.libm-test is updated
document the new Makefile target.

---

2013-04-06  Carlos O'Donell  <carlos@redhat.com>

	* Makefile.in (regen-ulps): New target.
	* math/Makefile [ifneq (no,$(PERL)]: Declare regen-ulps with .PHONY.
	[ifneq (no,$(PERL)] (run-regen-ulps): New variable.
	[ifneq (no,$(PERL)] (regen-ulps): New target.
	[ifeq (no,$(PERL)] (regen-ulps): New target.
	* math/libm-test.inc (ulps_file_name): Define.
	(output_dir): New variable.
	(options): Add "output-dir" option.
	(parse_opt): Handle 'o' case.
	(main): If output_dir is non-NULL use it as a prefix
	otherwise use "".
	* math/README.libm-test: Update `How can I generate "libm-test-ulps"?'
2013-04-06 16:22:47 -04:00
Thomas Schwinge a1cbf437a5 [BZ #14686, #15336] Fix standard compliance. Don't use hard-coded qNaN values. 2013-04-05 22:34:52 +02:00
Joseph Myers 05e166c887 Fix missing underflow from cexp (bug 14478). 2013-04-03 16:51:46 +00:00
Joseph Myers 52ce486045 Fix cacosh inaccuracy and spurious exceptions (bug 15327). 2013-04-02 22:54:00 +00:00
Thomas Schwinge 572676160d New <math.h> macro named issignaling to check for a signaling NaN (sNaN).
It is based on draft TS 18661 and currently enabled as a GNU extension.
2013-04-02 13:51:02 +02:00
Joseph Myers ccc8cadf75 Fix casinh inaccuracy for imaginary part < 1.0, real part small (bug 10357). 2013-03-30 13:31:53 +00:00
Joseph Myers 3a7182a14b Fix casinh inaccuracy near i, imaginary part > 1 (bug 15307). 2013-03-27 14:38:44 +00:00
Adhemerval Zanella e42a38dd9d BZ#13889: expl (709.75) wrongly overflows for ldbl-128ibm
The patch increase the high value to check if expl overflows. Current
high mark value is not really correct, the algorithm accepts high values.
It also adds a correct wrapper function to check for overflow and underflow.
2013-03-22 12:39:10 -03:00
Joseph Myers 98c48fe5cc Fix Bessel function spurious overflows for ldbl-128 / ldbl-128ibm (bug 15285). 2013-03-21 13:57:21 +00:00
Joseph Myers 0a1b2ae6f6 Fix casinh inaccuracy for argument with imaginary part 1 (bug 15287). 2013-03-21 10:27:10 +00:00
Joseph Myers d2f9799e7c Fix y1l spurious overflows for ldbl-96 (bug 15283). 2013-03-16 17:51:48 +00:00
Joseph Myers 2a185d32e8 Fix spurious underflow exceptions for Bessel functions for ldbl-128 / ldbl-128ibm (bug 14155). 2013-03-16 17:50:28 +00:00
Thomas Schwinge af00a34d08 * math/libm-test.inc (ldexp_test): Add missing START/END markers. 2013-03-15 19:13:53 +01:00
Thomas Schwinge 777b0332c0 Use GCC's builtins for generating NaNs. 2013-03-15 19:10:20 +01:00
Thomas Schwinge 64d063b800 Add one test, removed a duplicated one, add a few comments about missing tests. 2013-03-15 19:08:04 +01:00
Thomas Schwinge 67e971f18f Better distinguish between NaN/qNaN/sNaN. 2013-03-15 19:06:02 +01:00
Thomas Schwinge 64487e1264 Enable tests for x86_64, too, which currently are enabled only for x86. 2013-03-15 19:02:18 +01:00
Joseph Myers 41c7328e85 Fix spurious underflow exceptions for Bessel functions for double (bug 14155). 2013-03-14 17:47:30 +00:00
Joseph Myers 8cf28c5ebe Fix casinh spurious underflows away from [-i,i] (bug 15062). 2013-01-31 22:55:29 +00:00
Joseph Myers 728d7b43fc Fix cacos real-part inaccuracy for result real part near 0 (bug 15023). 2013-01-17 20:25:51 +00:00
Joseph Myers a9708fed77 Fix casinh, casin overflow (bug 14996). 2013-01-07 14:59:53 +00:00
Joseph Myers cdc1c96fba Fix casinh, casin inaccuracy from cancellation (bug 14994). 2013-01-04 13:25:17 +00:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Joseph Myers 1bead169c3 Fix powl inaccuracy for x86_64 and x86 (bug 13881). 2012-11-28 13:40:54 +00:00
Joseph Myers 7184dcdf26 Disable some fma tests for ldbl-128ibm. 2012-11-22 19:57:58 +00:00
Joseph Myers 0a42601f27 Fix ldbl-128ibm atanl spurious underflows (bug 14871). 2012-11-22 19:56:47 +00:00
Joseph Myers 1468ded38e Fix ldbl-128ibm hypotl internal underflows (bug 14869). 2012-11-22 14:58:41 +00:00
Joseph Myers 8e27e3cc45 Fix ldbl-128ibm hypotl inaccuracy for arguments with large ratio (bug 14868). 2012-11-22 14:57:22 +00:00
Joseph Myers c9c0279bcb Mark some clog / clog10 underflows as expected for IBM long double. 2012-11-22 14:56:14 +00:00
David S. Miller 6d33cc9d9b Fix spurious underflows in ldbl-128 atan implementation.
With help from Joseph Myers.
	* sysdeps/ieee754/ldbl-128/s_atanl.c (__atanl): Handle tiny and
	very large arguments properly.
	* math/libm-test.inc (atan_test): New tests.
	(atan2_test): New tests.
	* sysdeps/sparc/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update.
2012-11-19 15:31:24 -08:00
David S. Miller 05b227bdae Correct tinyness handling in long-double and float y0/y1.
With help from Joseph Myers.
	* sysdeps/ieee754/flt-32/e_j0f.c (__ieee754_y0f): Adjust tinyness
	cutoff to 2**-13.
	* sysdeps/ieee754/flt-32/e_j1f.c (__ieee754_y1f): Adjust tinyness
	cutoff to 2**-25.
	* sysdeps/ieee754/ldbl-128/e_j0l.c (U0): New constant.
	( __ieee754_y0l): Avoid arithmetic underflow when 'x' is very
	small.
	* sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Likewise.
	* math/libm-test.inc (y0_test): New tests.
	(y1_test): New tests.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update.
	* sysdeps/sparc/fpu/libm-test-ulps: Update.
2012-11-18 12:33:53 -08:00
Marcus Shawcroft 2fd8978571 Fix buffer overflow in libm-test.inc check_complex() 2012-11-15 18:02:03 +00:00