Commit Graph

651 Commits

Author SHA1 Message Date
Adhemerval Zanella
f98ece5fe2 Define decimal constant M_1_DIV_El in libm-test.inc
This patch replaces the 1.0 / M_El by the decimal constant M_1_DIV_El.
2013-05-13 12:08:42 -05:00
Joseph Myers
4f184d30cb Convert TEST_fff_f tests from code to data. 2013-05-12 21:07:58 +00:00
Joseph Myers
081988778f Convert TEST_c_c tests from code to data. 2013-05-12 17:38:26 +00:00
Joseph Myers
601a3a5fd5 Convert TEST_ff_f tests from code to data. 2013-05-12 13:17:09 +00:00
Joseph Myers
8329e4da35 Make fma and nextafter tests use max_value instead of fltmax. 2013-05-11 11:10:31 +00:00
Joseph Myers
74c574788d Convert TEST_f_f tests from code to data. 2013-05-11 11:09:30 +00:00
Joseph Myers
51df539d98 Start converting libm tests from code to data. 2013-05-10 16:45:04 +00:00
Joseph Myers
ab2b94613d Fix tgamma errno setting on domain error (bug 6809). 2013-05-10 11:35:11 +00:00
Joseph Myers
0d3e777af2 Use M_SQRT1_2l instead of local M_SQRT_2_2 in libm-test.inc. 2013-05-09 14:33:30 +00:00
Joseph Myers
24f5606614 Use M_PI_34l consistently in libm-test.inc. 2013-05-09 14:13:10 +00:00
Joseph Myers
faa7f8119f Use decimal constants in defining M_* in libm-test.inc. 2013-05-09 12:24:44 +00:00
Joseph Myers
a0d9f9d745 Factor out initializers for libm-test.inc constants. 2013-05-08 16:10:44 +00:00
Joseph Myers
ae08db3ba0 Use correct TEST_* macros for jn, ldexp and yn tests. 2013-05-08 16:09:54 +00:00
Joseph Myers
f44bf14a9c Move some libm-test logic for running tests from gen-libm-test.pl to libm-test.inc. 2013-05-08 12:02:22 +00:00
Joseph Myers
d8cd06db62 Improve tgamma accuracy (bugs 2546, 2560, 5159, 15426). 2013-05-08 11:58:18 +00:00
Joseph Myers
9ea3513c91 Initialize x in frexp, modf, remqou tests. 2013-05-06 20:23:40 +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
77f143fdb4 Use suffixed floating-point constants in float and long double catan/catanh. 2013-04-24 18:59:37 +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
Siddhesh Poyarekar
01dc6df938 Don't use run-via-rtld-prefix for anything other than tests
run-via-rtld-prefix checks whether the program to be run is a static
test and skips if it is.  This is fine, except that it assumes that
the program to be run is the second $^, which is true only for tests.

This change creates an rtld-prefix, which is simply the dynamic linker
prefix with the necessary arguments and uses that in the non-test
targets.
2013-04-11 09:37:50 +05:30
Carlos O'Donell
085b2d41a4 README.libm-test: Use testrun.sh to run libm test.
Document the use of the convenience testrun.sh script for
running the libm test.

---

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

	* math/README.libm-test (How can I generate "libm-test-ulps"?):
	Use testrun.sh to run libm tests.
2013-04-06 17:13:19 -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
Thomas Schwinge
bdef0be784 libm-test: Properly wrap blocks consisting of several statements. 2013-03-21 16:07:48 +01:00
Thomas Schwinge
5aa4a1a1fd On 32-bit x86, disable certain tests involving sNaN values.
Follow-up to commit 495ded2c8c.
2013-03-21 16:05:29 +01: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
6b18bea625 Fix types of constants in k_casinh*.c. 2013-03-19 22:38:25 +00:00
Joseph Myers
d2f9799e7c Fix y1l spurious overflows for ldbl-96 (bug 15283). 2013-03-16 17:51:48 +00:00