Commit Graph

14 Commits

Author SHA1 Message Date
Joseph Myers ac831b362a Fix csin, csinh overflow in directed rounding modes (bug 18593).
csin and csinh can produce bad results when overflowing in directed
rounding modes, because a multiplication that can overflow is followed
by a possible negation.  This patch fixes this by negating one of the
arguments of the multiplication before the multiplication instead of
negating the result.

The new tests for this issue are added to auto-libm-test-in, starting
use of that file for csin and csinh.  The issue was found in the
course of moving existing tests for csin and csinh (existing tests, by
being enabled in more cases than previously, showed the issue for
float and double but not for long double); that move will now be done
separately.

Tested for x86_64 and x86 and ulps updated accordingly.

	[BZ #18593]
	* math/s_csin.c (__csin): Negate before rather than after possibly
	overflowing multiplication.
	* math/s_csinf.c (__csinf): Likewise.
	* math/s_csinh.c (__csinh): Likewise.
	* math/s_csinhf.c (__csinhf): Likewise.
	* math/s_csinhl.c (__csinhl): Likewise.
	* math/s_csinl.c (__csinl): Likewise.
	* math/auto-libm-test-in: Add some tests of csin and csinh.
	* math/auto-libm-test-out: Regenerated.
	* math/libm-test.inc (csin_test_data): Use AUTO_TESTS_c_c.
	(csinh_test_data): Likewise.
	* sysdeps/x86_64/fpu/libm-test-ulps: Update.
2015-06-24 16:20:48 +00:00
Joseph Myers b168057aaa Update copyright dates with scripts/update-copyrights. 2015-01-02 16:29:47 +00:00
Ondřej Bílka a1ffb40e32 Use glibc_likely instead __builtin_expect. 2014-02-10 15:07:12 +01:00
Allan McRae d4697bc93d Update copyright notices with scripts/update-copyrights 2014-01-01 22:00:23 +10:00
Joseph Myers f0302940e7 Fix csin, csinh, ccos, ccosh missing underflows (bug 15405). 2013-04-26 19:25:19 +00:00
Joseph Myers 568035b787 Update copyright notices with scripts/update-copyrights. 2013-01-02 19:05:09 +00:00
Liubov Dmitrieva 6d3bf19931 Fix wrong ussage of sincos for subnormal arguments 2012-09-25 20:41:17 +02:00
Joseph Myers e0b16cc25c Fix ccos, csin, ccosh, csinh overflows (bug 14123). 2012-05-19 15:35:29 +00:00
Paul Eggert 59ba27a63a Replace FSF snail mail address with URLs. 2012-02-09 23:18:22 +00:00
Ulrich Drepper bc62c2fb15 Optimization to some complex math functions
Also, change last reference to __sqrt into __sqrt to easily.
2011-10-22 00:32:39 -04:00
Ulrich Drepper 9277c06437 Use private math_private.h in files in math/ 2011-10-08 05:16:04 -04:00
Ulrich Drepper 9d13fb2413 Moved to csu/errno-loc.c. 2005-12-14 15:06:39 +00:00
Ulrich Drepper a334319f65 (CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4. 2004-12-22 20:10:10 +00:00
Jakub Jelinek 0ecb606cb6 2.5-18.1 2007-07-12 18:26:36 +00:00