Commit Graph

527 Commits

Author SHA1 Message Date
Chris Metcalf
0af797def3 math: support platforms with limited FP rounding or exception support
For some tests, just claim that fetestexcept() always returns true,
so the rest of the test can be compiled.

For libm-test, provide known bogus values for unsupported rounding
modes, so fesetround() will return failure.

Elsewhere, just add some #ifdefs to avoid code that uses particular
FP exceptions if the exceptions aren't supported.
2012-05-17 08:50:41 -04:00
Roland McGrath
38de94a5ef Add a missing #include. 2012-05-10 15:57:24 -07:00
Adhemerval Zanella
89c9aa491a Fix for logb/logbf/logbl (bugs 13954/13955/13956)
POSIX 2008 states that if the input for 'logb[f|l]' is a subnormal number
it should be treated as if it were normalized.  This means the
implementation should calculate the log2 of the mantissa and add it to the
subnormal exponent (-126 for float and -1022 for double and IBM long
double).  This patch takes care of that.
2012-05-10 15:11:55 -05:00
Joseph Myers
495fd99f3a Fix x86/x86_64 expm1l inaccuracy and exceptions (bugs 13885, 13923). 2012-05-07 19:13:08 +00:00
Joseph Myers
d8b82cad1b Fix exp10 inaccuracy and exceptions (bugs 13884, 13914). 2012-05-06 18:23:44 +00:00
Joseph Myers
6c23e11c4d Fix libm-test.inc ulps calculation for subnormals (bug 14064). 2012-05-06 18:20:21 +00:00
Joseph Myers
5779f134a0 Disable one hypot test for inline double testing. 2012-05-05 19:38:31 +00:00
Joseph Myers
41498f4db1 Fix missing exceptions from exp (bugs 13787, 13922, 14036). 2012-05-05 19:37:39 +00:00
Andreas Jaeger
0be196adda Use -frounding-math for math testsuite
We should tell GCC that we manipulate the rounding mode and
therefore add -frounding-math to these files that call fesetround.
2012-05-02 16:33:18 +02:00
Joseph Myers
7cb029ee6e Fix nexttoward bugs (bugs 2550, 2570). 2012-05-01 15:37:43 +00:00
Joseph Myers
adfbc8ac9e Fix x86 acos near 1 (bug 13942). 2012-04-30 18:56:39 +00:00
Joseph Myers
5ba3cc691c Fix acos (-1) in round-downwards mode on x86 (bug 14034). 2012-04-30 09:38:06 +00:00
Joseph Myers
9568c0c225 Fix exp10 spurious overflows (bug 13924). 2012-04-30 09:37:01 +00:00
Andreas Schwab
ded5180a3b Don't use long double *_finite functions if no long double math 2012-04-28 22:21:53 +02:00
Ryan S. Arnold
60c8fca7ab Remove spurious '.' in math/libm-test.inc comment. 2012-04-27 12:36:46 -05:00
Ryan S. Arnold
a462cb6332 New test to expose erroneous negative sign on logb(1) (bug 887). 2012-04-27 10:47:39 -05:00
Joseph Myers
6ad3493e22 Fix fenv.h fallback returns (bug 14027). 2012-04-27 13:54:09 +00:00
Adhemerval Zanella
94e02fc410 Correct powerpc64 s_floorl edge cases (bug 13886).
[BZ #13886]
Remove powerpc64/fpu/s_floorl.  Use fully correct ldbl-128bim/s_floorl.c.
2012-04-24 14:21:45 -05:00
Adhemerval Zanella
76da726532 Fix ilogb exception and errno (bug 6794)
[BZ #6794]
Following Joseph comments about bug 6794, here is a proposed fix. It turned out
to be a large fix mainly because I had to move some file along to follow libm
files/names conventions.

Basically I have added wrappers (w_ilogb.c, w_ilogbf.c, w_ilogbl.c) that now calls
the symbol '__ieee754_ilogb'. The wrappers checks for '__ieee754_ilogb' output and
set the errno and raise exceptions as expected.

The '__ieee754_ilogb' is implemented in sysdeps. I have moved the 's_ilogb[f|l]' files
to e_ilogb[f|l] and renamed the '__ilogb[f|l]' to '__ieee754_ilogb[f|l]'.

I also found out a bug in i386 and x86-64 assembly coded ilogb implementation where
it raises a FE_DIVBYZERO when argument is '0.0'. I corrected this issue as well.

Finally I added the errno and FE_INVALID tests for 0.0, NaN and +-InF argument. Tested
on i386, x86-64, ppc32 and ppc64.
2012-04-17 22:12:53 +02:00
Joseph Myers
8f9a2faee0 Fix spurious overflow exceptions from x86/x86_64 powl (bug 13872). 2012-04-09 22:32:45 +00:00
Joseph Myers
bcc8d6617b Fix ctan, ctanh overflow (bug 11521). 2012-04-09 22:31:35 +00:00
Joseph Myers
d7dd945398 Fix missing overflow exceptions from pow (bug 13873). 2012-04-09 09:43:18 +00:00
Joseph Myers
c483f6b4a4 Fix x86 pow inaccuracy for large integer exponents (bug 706). 2012-04-09 09:42:05 +00:00
Joseph Myers
d2de7579f2 Do not allow overflow exception on exp underflow test (bug 13705). 2012-04-08 22:46:49 +00:00
Joseph Myers
d6270972f7 Fix pow of negative numbers to integer exponents (bugs 369, 2678, 3866). 2012-03-28 14:57:58 +00:00
Joseph Myers
41bf21a1e7 Avoid overflows from long double functions using __kernel_standard. 2012-03-28 09:32:12 +00:00
Joseph Myers
7c69cd143b Fix cexp overflow (bug 13892). 2012-03-22 19:38:09 +00:00
Joseph Myers
48e44791e4 Fix exp2l inaccuracy (bug 13824). 2012-03-22 12:55:19 +00:00
Joseph Myers
1a4ac776eb Remove inaccurate x86 cexp implementations (bug 13883). 2012-03-21 15:28:05 +00:00
Joseph Myers
0cb7efc517 Fix missing exp2 overflow exception (bug 13871). 2012-03-21 12:17:26 +00:00
Joseph Myers
2460d3aa21 Fix pow of zero and infinity to large powers. 2012-03-21 12:16:00 +00:00
Joseph Myers
c135cc1b5f Test for overflow exceptions in libm-test.inc. 2012-03-20 10:58:04 +00:00
Joseph Myers
1897ad4432 Fix clog overflow/underflow (bug 13629). 2012-03-19 20:14:26 +00:00
Joseph Myers
7726d6a95d Fix atan2 spurious exceptions (bug 11451). 2012-03-19 20:11:09 +00:00
Joseph Myers
c36e1d2369 Disable Bessel function TLOSS errors in POSIX mode. 2012-03-16 20:08:02 +00:00
Joseph Myers
11b90b9f50 Fix tan, tanl for large inputs. 2012-03-16 20:05:37 +00:00
Joseph Myers
8848d99dce Implement ldbl-96 sinl / cosl / sincosl (bug 13851). 2012-03-16 12:30:05 +00:00
Andreas Jaeger
ea40808acd Use 40 digits in tests 2012-03-15 18:02:02 +01:00
Andreas Jaeger
ee010c9e95 * sysdeps/i386/fpu/s_tanf.S: Delete so that i386 uses the
ieee754/flt-32 implementation for tan.
* math/libm-test.inc (tan_test): Add tests for large input.
* sysdeps/i386/fpu/libm-test-ulps: Update.
2012-03-15 17:34:24 +01:00
Andreas Jaeger
8c0247db32 [BZ #13852]
* sysdeps/i386/fpu/e_rem_pio2f.c: Delete so that i386 uses the
	ieee754/flt-32 implementation.
	* sysdeps/i386/fpu/k_rem_pio2f.c: Likewise.
	* sysdeps/i386/fpu/s_cosf.S: Likewise.
	* sysdeps/i386/fpu/s_sincosf.S: Likewise.
	* sysdeps/i386/fpu/s_sinf.S: Likewise.

	* math/libm-test.inc (cos_test): Enable some large input tests for
	float as well
	(sin_test): Likewise.
	(sincos_test): Likewise.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
2012-03-15 17:23:43 +01:00
Andreas Jaeger
81c6415384 [BZ #13658]
* math/libm-test.inc (cos_test): Add more test cases.
(sin_test): Likewise.
(sincos_test): Likewise.
2012-03-15 16:25:57 +01:00
Andreas Jaeger
7bbfa5c6ec [BZ #13837]
* math/libm-test.inc (cos_test): Add a test case for large input
value.
(sin_test): Likewise.
(sincos_test): Likewise.
2012-03-15 14:34:34 +01:00
Andreas Jaeger
ad6e0564b8 Cleanup formatting. 2012-03-15 14:14:39 +01:00
Andreas Jaeger
356a10ee3e Merge branch 'master' into bug13658-branch 2012-03-14 16:36:17 +01:00
Joseph Myers
e456826d7a Fix csqrt overflow/underflow (bug 13841). 2012-03-14 11:53:32 +00:00
Joseph Myers
aa4a2ae1db Add tests for hypot overflow/underflow. 2012-03-14 01:12:05 +00:00
Richard Henderson
5f0a5daeee Move math/math_private.h to sysdeps/generic/math_private.h.
This reverts commit 60d6f5a6f5.
2012-03-09 16:12:17 -08:00
Andreas Jaeger
a20026128c Add further tests 2012-03-08 10:44:32 +01:00
Joseph Myers
d1d3431a3a Fix signs of zeros from casinh, cacosh etc. (bug 10716). 2012-03-07 15:15:19 +00:00
Andreas Jaeger
b35fe25ed9 [BZ #13658]
* sysdeps/x86_64/fpu/s_sincos.S: Delete.

	* math/libm-test.inc (sincos_test): Add test for large input.
2012-03-07 14:51:39 +01:00