]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix csin, csinh overflow in directed rounding modes (bug 18593).
authorJoseph Myers <joseph@codesourcery.com>
Wed, 24 Jun 2015 16:20:48 +0000 (16:20 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 24 Jun 2015 16:20:48 +0000 (16:20 +0000)
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.

12 files changed:
ChangeLog
NEWS
math/auto-libm-test-in
math/auto-libm-test-out
math/libm-test.inc
math/s_csin.c
math/s_csinf.c
math/s_csinh.c
math/s_csinhf.c
math/s_csinhl.c
math/s_csinl.c
sysdeps/x86_64/fpu/libm-test-ulps

index b103dcdc2696c37740eb8d4f1ddb817b4a987c2b..6c1eb8e4141f0b307ff7fd48f0e9699317ffd7a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,19 @@
 2015-06-24  Joseph Myers  <joseph@codesourcery.com>
 
+       [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.
+
        [BZ #18586]
        * sysdeps/ieee754/ldbl-128/e_expl.c (__ieee754_expl): Force
        underflow exception for small results.
diff --git a/NEWS b/NEWS
index e8c84b88e03a88514a17ae0ff27798e02cfa9bad..4646dcd3fcf88ab71c05af3310ceb5e6f1633bae 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -24,7 +24,7 @@ Version 2.22
   18444, 18468, 18469, 18470, 18479, 18483, 18495, 18496, 18497, 18498,
   18507, 18512, 18513, 18519, 18520, 18522, 18527, 18528, 18529, 18530,
   18532, 18533, 18534, 18536, 18539, 18540, 18542, 18544, 18545, 18546,
-  18547, 18553, 18558, 18569, 18583, 18586.
+  18547, 18553, 18558, 18569, 18583, 18586, 18593.
 
 * Cache information can be queried via sysconf() function on s390 e.g. with
   _SC_LEVEL1_ICACHE_SIZE as argument.
index 654558348049cf25b398c4c8d5da92ddfdcda518..2389c051c4fa0a50ff39903eec74e822a08f322a 100644 (file)
@@ -955,6 +955,16 @@ cpow 0.75 1.25 1.0 1.0 xfail-rounding
 cpow 0.75 1.25 1.0 0.0
 cpow 0.75 1.25 0.0 1.0
 
+csin 0.75 1e6
+csin 0.75 -1e6
+csin -0.75 1e6
+csin -0.75 -1e6
+
+csinh 1e6 0.75
+csinh -1e6 0.75
+csinh 1e6 -0.75
+csinh -1e6 -0.75
+
 csqrt 0 0
 csqrt 0 -0
 csqrt -0 0
index f3672dbc4658f10ced97d712635ca9d6e0179840..b386f004b19d455d92d4192fcb788d0da144fdaa 100644 (file)
@@ -91676,6 +91676,206 @@ cpow 0.75 1.25 0.0 1.0
 = cpow tonearest ldbl-128ibm 0xcp-4L 0x1.4p+0L 0x0p+0L 0x1p+0L : 0x5.4f283113fa8a525b30b312aa4ep-4L 0x2.19f6810e8fdb408ac45c5250adp-4L : inexact-ok
 = cpow towardzero ldbl-128ibm 0xcp-4L 0x1.4p+0L 0x0p+0L 0x1p+0L : 0x5.4f283113fa8a525b30b312aa4ep-4L 0x2.19f6810e8fdb408ac45c5250acp-4L : inexact-ok
 = cpow upward ldbl-128ibm 0xcp-4L 0x1.4p+0L 0x0p+0L 0x1p+0L : 0x5.4f283113fa8a525b30b312aa5p-4L 0x2.19f6810e8fdb408ac45c5250adp-4L : inexact-ok
+csin 0.75 1e6
+= csin downward flt-32 0xcp-4f 0xf.424p+16f : 0xf.fffffp+124f 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csin tonearest flt-32 0xcp-4f 0xf.424p+16f : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero flt-32 0xcp-4f 0xf.424p+16f : 0xf.fffffp+124f 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csin upward flt-32 0xcp-4f 0xf.424p+16f : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward dbl-64 0xcp-4 0xf.424p+16 : 0xf.ffffffffffff8p+1020 0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csin tonearest dbl-64 0xcp-4 0xf.424p+16 : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero dbl-64 0xcp-4 0xf.424p+16 : 0xf.ffffffffffff8p+1020 0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csin upward dbl-64 0xcp-4 0xf.424p+16 : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-96-intel 0xcp-4L 0xf.424p+16L : 0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-96-intel 0xcp-4L 0xf.424p+16L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-96-intel 0xcp-4L 0xf.424p+16L : 0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-96-intel 0xcp-4L 0xf.424p+16L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-96-m68k 0xcp-4L 0xf.424p+16L : 0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-96-m68k 0xcp-4L 0xf.424p+16L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-96-m68k 0xcp-4L 0xf.424p+16L : 0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-96-m68k 0xcp-4L 0xf.424p+16L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-128 0xcp-4L 0xf.424p+16L : 0xf.fffffffffffffffffffffffffff8p+16380L 0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-128 0xcp-4L 0xf.424p+16L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-128 0xcp-4L 0xf.424p+16L : 0xf.fffffffffffffffffffffffffff8p+16380L 0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-128 0xcp-4L 0xf.424p+16L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-128ibm 0xcp-4L 0xf.424p+16L : 0xf.ffffffffffffbffffffffffffcp+1020L 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-128ibm 0xcp-4L 0xf.424p+16L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-128ibm 0xcp-4L 0xf.424p+16L : 0xf.ffffffffffffbffffffffffffcp+1020L 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-128ibm 0xcp-4L 0xf.424p+16L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+csin 0.75 -1e6
+= csin downward flt-32 0xcp-4f -0xf.424p+16f : 0xf.fffffp+124f minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest flt-32 0xcp-4f -0xf.424p+16f : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero flt-32 0xcp-4f -0xf.424p+16f : 0xf.fffffp+124f -0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csin upward flt-32 0xcp-4f -0xf.424p+16f : plus_infty -0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csin downward dbl-64 0xcp-4 -0xf.424p+16 : 0xf.ffffffffffff8p+1020 minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest dbl-64 0xcp-4 -0xf.424p+16 : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero dbl-64 0xcp-4 -0xf.424p+16 : 0xf.ffffffffffff8p+1020 -0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csin upward dbl-64 0xcp-4 -0xf.424p+16 : plus_infty -0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-96-intel 0xcp-4L -0xf.424p+16L : 0xf.fffffffffffffffp+16380L minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-96-intel 0xcp-4L -0xf.424p+16L : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-96-intel 0xcp-4L -0xf.424p+16L : 0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-96-intel 0xcp-4L -0xf.424p+16L : plus_infty -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-96-m68k 0xcp-4L -0xf.424p+16L : 0xf.fffffffffffffffp+16380L minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-96-m68k 0xcp-4L -0xf.424p+16L : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-96-m68k 0xcp-4L -0xf.424p+16L : 0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-96-m68k 0xcp-4L -0xf.424p+16L : plus_infty -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-128 0xcp-4L -0xf.424p+16L : 0xf.fffffffffffffffffffffffffff8p+16380L minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-128 0xcp-4L -0xf.424p+16L : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-128 0xcp-4L -0xf.424p+16L : 0xf.fffffffffffffffffffffffffff8p+16380L -0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-128 0xcp-4L -0xf.424p+16L : plus_infty -0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-128ibm 0xcp-4L -0xf.424p+16L : 0xf.ffffffffffffbffffffffffffcp+1020L minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-128ibm 0xcp-4L -0xf.424p+16L : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-128ibm 0xcp-4L -0xf.424p+16L : 0xf.ffffffffffffbffffffffffffcp+1020L -0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-128ibm 0xcp-4L -0xf.424p+16L : plus_infty -0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+csin -0.75 1e6
+= csin downward flt-32 -0xcp-4f 0xf.424p+16f : minus_infty 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csin tonearest flt-32 -0xcp-4f 0xf.424p+16f : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero flt-32 -0xcp-4f 0xf.424p+16f : -0xf.fffffp+124f 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csin upward flt-32 -0xcp-4f 0xf.424p+16f : -0xf.fffffp+124f plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward dbl-64 -0xcp-4 0xf.424p+16 : minus_infty 0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csin tonearest dbl-64 -0xcp-4 0xf.424p+16 : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero dbl-64 -0xcp-4 0xf.424p+16 : -0xf.ffffffffffff8p+1020 0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csin upward dbl-64 -0xcp-4 0xf.424p+16 : -0xf.ffffffffffff8p+1020 plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-96-intel -0xcp-4L 0xf.424p+16L : minus_infty 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-96-intel -0xcp-4L 0xf.424p+16L : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-96-intel -0xcp-4L 0xf.424p+16L : -0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-96-intel -0xcp-4L 0xf.424p+16L : -0xf.fffffffffffffffp+16380L plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-96-m68k -0xcp-4L 0xf.424p+16L : minus_infty 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-96-m68k -0xcp-4L 0xf.424p+16L : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-96-m68k -0xcp-4L 0xf.424p+16L : -0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-96-m68k -0xcp-4L 0xf.424p+16L : -0xf.fffffffffffffffp+16380L plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-128 -0xcp-4L 0xf.424p+16L : minus_infty 0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-128 -0xcp-4L 0xf.424p+16L : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-128 -0xcp-4L 0xf.424p+16L : -0xf.fffffffffffffffffffffffffff8p+16380L 0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-128 -0xcp-4L 0xf.424p+16L : -0xf.fffffffffffffffffffffffffff8p+16380L plus_infty : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-128ibm -0xcp-4L 0xf.424p+16L : minus_infty 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-128ibm -0xcp-4L 0xf.424p+16L : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-128ibm -0xcp-4L 0xf.424p+16L : -0xf.ffffffffffffbffffffffffffcp+1020L 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-128ibm -0xcp-4L 0xf.424p+16L : -0xf.ffffffffffffbffffffffffffcp+1020L plus_infty : inexact-ok overflow errno-erange-ok
+csin -0.75 -1e6
+= csin downward flt-32 -0xcp-4f -0xf.424p+16f : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest flt-32 -0xcp-4f -0xf.424p+16f : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero flt-32 -0xcp-4f -0xf.424p+16f : -0xf.fffffp+124f -0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csin upward flt-32 -0xcp-4f -0xf.424p+16f : -0xf.fffffp+124f -0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csin downward dbl-64 -0xcp-4 -0xf.424p+16 : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest dbl-64 -0xcp-4 -0xf.424p+16 : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero dbl-64 -0xcp-4 -0xf.424p+16 : -0xf.ffffffffffff8p+1020 -0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csin upward dbl-64 -0xcp-4 -0xf.424p+16 : -0xf.ffffffffffff8p+1020 -0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-96-intel -0xcp-4L -0xf.424p+16L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-96-intel -0xcp-4L -0xf.424p+16L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-96-intel -0xcp-4L -0xf.424p+16L : -0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-96-intel -0xcp-4L -0xf.424p+16L : -0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-96-m68k -0xcp-4L -0xf.424p+16L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-96-m68k -0xcp-4L -0xf.424p+16L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-96-m68k -0xcp-4L -0xf.424p+16L : -0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-96-m68k -0xcp-4L -0xf.424p+16L : -0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-128 -0xcp-4L -0xf.424p+16L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-128 -0xcp-4L -0xf.424p+16L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-128 -0xcp-4L -0xf.424p+16L : -0xf.fffffffffffffffffffffffffff8p+16380L -0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-128 -0xcp-4L -0xf.424p+16L : -0xf.fffffffffffffffffffffffffff8p+16380L -0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csin downward ldbl-128ibm -0xcp-4L -0xf.424p+16L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin tonearest ldbl-128ibm -0xcp-4L -0xf.424p+16L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csin towardzero ldbl-128ibm -0xcp-4L -0xf.424p+16L : -0xf.ffffffffffffbffffffffffffcp+1020L -0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csin upward ldbl-128ibm -0xcp-4L -0xf.424p+16L : -0xf.ffffffffffffbffffffffffffcp+1020L -0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+csinh 1e6 0.75
+= csinh downward flt-32 0xf.424p+16f 0xcp-4f : 0xf.fffffp+124f 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csinh tonearest flt-32 0xf.424p+16f 0xcp-4f : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero flt-32 0xf.424p+16f 0xcp-4f : 0xf.fffffp+124f 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csinh upward flt-32 0xf.424p+16f 0xcp-4f : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward dbl-64 0xf.424p+16 0xcp-4 : 0xf.ffffffffffff8p+1020 0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csinh tonearest dbl-64 0xf.424p+16 0xcp-4 : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero dbl-64 0xf.424p+16 0xcp-4 : 0xf.ffffffffffff8p+1020 0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csinh upward dbl-64 0xf.424p+16 0xcp-4 : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-96-intel 0xf.424p+16L 0xcp-4L : 0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-96-intel 0xf.424p+16L 0xcp-4L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-96-intel 0xf.424p+16L 0xcp-4L : 0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-96-intel 0xf.424p+16L 0xcp-4L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-96-m68k 0xf.424p+16L 0xcp-4L : 0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-96-m68k 0xf.424p+16L 0xcp-4L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-96-m68k 0xf.424p+16L 0xcp-4L : 0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-96-m68k 0xf.424p+16L 0xcp-4L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-128 0xf.424p+16L 0xcp-4L : 0xf.fffffffffffffffffffffffffff8p+16380L 0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-128 0xf.424p+16L 0xcp-4L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-128 0xf.424p+16L 0xcp-4L : 0xf.fffffffffffffffffffffffffff8p+16380L 0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-128 0xf.424p+16L 0xcp-4L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-128ibm 0xf.424p+16L 0xcp-4L : 0xf.ffffffffffffbffffffffffffcp+1020L 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-128ibm 0xf.424p+16L 0xcp-4L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-128ibm 0xf.424p+16L 0xcp-4L : 0xf.ffffffffffffbffffffffffffcp+1020L 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-128ibm 0xf.424p+16L 0xcp-4L : plus_infty plus_infty : inexact-ok overflow errno-erange-ok
+csinh -1e6 0.75
+= csinh downward flt-32 -0xf.424p+16f 0xcp-4f : minus_infty 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csinh tonearest flt-32 -0xf.424p+16f 0xcp-4f : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero flt-32 -0xf.424p+16f 0xcp-4f : -0xf.fffffp+124f 0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csinh upward flt-32 -0xf.424p+16f 0xcp-4f : -0xf.fffffp+124f plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward dbl-64 -0xf.424p+16 0xcp-4 : minus_infty 0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csinh tonearest dbl-64 -0xf.424p+16 0xcp-4 : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero dbl-64 -0xf.424p+16 0xcp-4 : -0xf.ffffffffffff8p+1020 0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csinh upward dbl-64 -0xf.424p+16 0xcp-4 : -0xf.ffffffffffff8p+1020 plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-96-intel -0xf.424p+16L 0xcp-4L : minus_infty 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-96-intel -0xf.424p+16L 0xcp-4L : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-96-intel -0xf.424p+16L 0xcp-4L : -0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-96-intel -0xf.424p+16L 0xcp-4L : -0xf.fffffffffffffffp+16380L plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-96-m68k -0xf.424p+16L 0xcp-4L : minus_infty 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-96-m68k -0xf.424p+16L 0xcp-4L : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-96-m68k -0xf.424p+16L 0xcp-4L : -0xf.fffffffffffffffp+16380L 0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-96-m68k -0xf.424p+16L 0xcp-4L : -0xf.fffffffffffffffp+16380L plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-128 -0xf.424p+16L 0xcp-4L : minus_infty 0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-128 -0xf.424p+16L 0xcp-4L : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-128 -0xf.424p+16L 0xcp-4L : -0xf.fffffffffffffffffffffffffff8p+16380L 0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-128 -0xf.424p+16L 0xcp-4L : -0xf.fffffffffffffffffffffffffff8p+16380L plus_infty : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-128ibm -0xf.424p+16L 0xcp-4L : minus_infty 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-128ibm -0xf.424p+16L 0xcp-4L : minus_infty plus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-128ibm -0xf.424p+16L 0xcp-4L : -0xf.ffffffffffffbffffffffffffcp+1020L 0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-128ibm -0xf.424p+16L 0xcp-4L : -0xf.ffffffffffffbffffffffffffcp+1020L plus_infty : inexact-ok overflow errno-erange-ok
+csinh 1e6 -0.75
+= csinh downward flt-32 0xf.424p+16f -0xcp-4f : 0xf.fffffp+124f minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest flt-32 0xf.424p+16f -0xcp-4f : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero flt-32 0xf.424p+16f -0xcp-4f : 0xf.fffffp+124f -0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csinh upward flt-32 0xf.424p+16f -0xcp-4f : plus_infty -0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csinh downward dbl-64 0xf.424p+16 -0xcp-4 : 0xf.ffffffffffff8p+1020 minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest dbl-64 0xf.424p+16 -0xcp-4 : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero dbl-64 0xf.424p+16 -0xcp-4 : 0xf.ffffffffffff8p+1020 -0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csinh upward dbl-64 0xf.424p+16 -0xcp-4 : plus_infty -0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-96-intel 0xf.424p+16L -0xcp-4L : 0xf.fffffffffffffffp+16380L minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-96-intel 0xf.424p+16L -0xcp-4L : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-96-intel 0xf.424p+16L -0xcp-4L : 0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-96-intel 0xf.424p+16L -0xcp-4L : plus_infty -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-96-m68k 0xf.424p+16L -0xcp-4L : 0xf.fffffffffffffffp+16380L minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-96-m68k 0xf.424p+16L -0xcp-4L : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-96-m68k 0xf.424p+16L -0xcp-4L : 0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-96-m68k 0xf.424p+16L -0xcp-4L : plus_infty -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-128 0xf.424p+16L -0xcp-4L : 0xf.fffffffffffffffffffffffffff8p+16380L minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-128 0xf.424p+16L -0xcp-4L : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-128 0xf.424p+16L -0xcp-4L : 0xf.fffffffffffffffffffffffffff8p+16380L -0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-128 0xf.424p+16L -0xcp-4L : plus_infty -0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-128ibm 0xf.424p+16L -0xcp-4L : 0xf.ffffffffffffbffffffffffffcp+1020L minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-128ibm 0xf.424p+16L -0xcp-4L : plus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-128ibm 0xf.424p+16L -0xcp-4L : 0xf.ffffffffffffbffffffffffffcp+1020L -0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-128ibm 0xf.424p+16L -0xcp-4L : plus_infty -0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+csinh -1e6 -0.75
+= csinh downward flt-32 -0xf.424p+16f -0xcp-4f : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest flt-32 -0xf.424p+16f -0xcp-4f : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero flt-32 -0xf.424p+16f -0xcp-4f : -0xf.fffffp+124f -0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csinh upward flt-32 -0xf.424p+16f -0xcp-4f : -0xf.fffffp+124f -0xf.fffffp+124f : inexact-ok overflow errno-erange-ok
+= csinh downward dbl-64 -0xf.424p+16 -0xcp-4 : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest dbl-64 -0xf.424p+16 -0xcp-4 : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero dbl-64 -0xf.424p+16 -0xcp-4 : -0xf.ffffffffffff8p+1020 -0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csinh upward dbl-64 -0xf.424p+16 -0xcp-4 : -0xf.ffffffffffff8p+1020 -0xf.ffffffffffff8p+1020 : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-96-intel -0xf.424p+16L -0xcp-4L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-96-intel -0xf.424p+16L -0xcp-4L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-96-intel -0xf.424p+16L -0xcp-4L : -0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-96-intel -0xf.424p+16L -0xcp-4L : -0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-96-m68k -0xf.424p+16L -0xcp-4L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-96-m68k -0xf.424p+16L -0xcp-4L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-96-m68k -0xf.424p+16L -0xcp-4L : -0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-96-m68k -0xf.424p+16L -0xcp-4L : -0xf.fffffffffffffffp+16380L -0xf.fffffffffffffffp+16380L : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-128 -0xf.424p+16L -0xcp-4L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-128 -0xf.424p+16L -0xcp-4L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-128 -0xf.424p+16L -0xcp-4L : -0xf.fffffffffffffffffffffffffff8p+16380L -0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-128 -0xf.424p+16L -0xcp-4L : -0xf.fffffffffffffffffffffffffff8p+16380L -0xf.fffffffffffffffffffffffffff8p+16380L : inexact-ok overflow errno-erange-ok
+= csinh downward ldbl-128ibm -0xf.424p+16L -0xcp-4L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh tonearest ldbl-128ibm -0xf.424p+16L -0xcp-4L : minus_infty minus_infty : inexact-ok overflow errno-erange-ok
+= csinh towardzero ldbl-128ibm -0xf.424p+16L -0xcp-4L : -0xf.ffffffffffffbffffffffffffcp+1020L -0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
+= csinh upward ldbl-128ibm -0xf.424p+16L -0xcp-4L : -0xf.ffffffffffffbffffffffffffcp+1020L -0xf.ffffffffffffbffffffffffffcp+1020L : inexact-ok overflow errno-erange-ok
 csqrt 0 0
 = csqrt downward flt-32 0x0p+0f 0x0p+0f : 0x0p+0f 0x0p+0f : inexact-ok
 = csqrt tonearest flt-32 0x0p+0f 0x0p+0f : 0x0p+0f 0x0p+0f : inexact-ok
index 03c3831389a72e883b1526095e3d4338ee737004..ba8e8ffb6b736148c435040a0f782735aff3b518 100644 (file)
@@ -6466,6 +6466,8 @@ static const struct test_c_c_data csin_test_data[] =
     TEST_c_c (csin, 0x1p-16434L, 22730, 1.217853148905605987081057582351152052687e4924L, plus_oflow, OVERFLOW_EXCEPTION),
 #endif
 
+    AUTO_TESTS_c_c (csin),
+
     TEST_c_c (csin, min_subnorm_value, min_value, min_subnorm_value, min_value, UNDERFLOW_EXCEPTION),
     TEST_c_c (csin, min_value, min_subnorm_value, min_value, min_subnorm_value, UNDERFLOW_EXCEPTION),
   };
@@ -6563,6 +6565,8 @@ static const struct test_c_c_data csinh_test_data[] =
     TEST_c_c (csinh, 22730, 0x1p-16434L, plus_oflow, 1.217853148905605987081057582351152052687e4924L, OVERFLOW_EXCEPTION),
 #endif
 
+    AUTO_TESTS_c_c (csinh),
+
     TEST_c_c (csinh, min_subnorm_value, min_value, min_subnorm_value, min_value, UNDERFLOW_EXCEPTION),
     TEST_c_c (csinh, min_value, min_subnorm_value, min_value, min_subnorm_value, UNDERFLOW_EXCEPTION),
   };
index f1ddb4e7807536590bcb2c352fc85a80430b32b5..ceee25fdda0778b28de7bea610bbb0a9a707716c 100644 (file)
@@ -52,6 +52,9 @@ __csin (__complex__ double x)
              cosix = 1.0;
            }
 
+         if (negate)
+           sinix = -sinix;
+
          if (fabs (__imag__ x) > t)
            {
              double exp_t = __ieee754_exp (t);
@@ -86,9 +89,6 @@ __csin (__complex__ double x)
              __imag__ retval = __ieee754_sinh (__imag__ x) * cosix;
            }
 
-         if (negate)
-           __real__ retval = -__real__ retval;
-
          if (fabs (__real__ retval) < DBL_MIN)
            {
              volatile double force_underflow
index 6c681898c1ae2de64fa6fe03e1b31b03b504adbb..daca6896b43020d4d3adf33611df5d0337ffc11f 100644 (file)
@@ -52,6 +52,9 @@ __csinf (__complex__ float x)
              cosix = 1.0f;
            }
 
+         if (negate)
+           sinix = -sinix;
+
          if (fabsf (__imag__ x) > t)
            {
              float exp_t = __ieee754_expf (t);
@@ -86,9 +89,6 @@ __csinf (__complex__ float x)
              __imag__ retval = __ieee754_sinhf (__imag__ x) * cosix;
            }
 
-         if (negate)
-           __real__ retval = -__real__ retval;
-
          if (fabsf (__real__ retval) < FLT_MIN)
            {
              volatile float force_underflow
index c607c2ad3ee187126d2d64e0e2cf5d7ab7a2fb6d..d940c97493e553945ba779dc2470109ae6f89f6c 100644 (file)
@@ -52,6 +52,9 @@ __csinh (__complex__ double x)
              cosix = 1.0;
            }
 
+         if (negate)
+           cosix = -cosix;
+
          if (fabs (__real__ x) > t)
            {
              double exp_t = __ieee754_exp (t);
@@ -86,9 +89,6 @@ __csinh (__complex__ double x)
              __imag__ retval = __ieee754_cosh (__real__ x) * sinix;
            }
 
-         if (negate)
-           __real__ retval = -__real__ retval;
-
          if (fabs (__real__ retval) < DBL_MIN)
            {
              volatile double force_underflow
index 848f5d1e8566a8dd13d26782e37711a88f78ddb0..4e0bc0362c029083c40449007b7617a86bb2089f 100644 (file)
@@ -52,6 +52,9 @@ __csinhf (__complex__ float x)
              cosix = 1.0f;
            }
 
+         if (negate)
+           cosix = -cosix;
+
          if (fabsf (__real__ x) > t)
            {
              float exp_t = __ieee754_expf (t);
@@ -86,9 +89,6 @@ __csinhf (__complex__ float x)
              __imag__ retval = __ieee754_coshf (__real__ x) * sinix;
            }
 
-         if (negate)
-           __real__ retval = -__real__ retval;
-
          if (fabsf (__real__ retval) < FLT_MIN)
            {
              volatile float force_underflow
index a437d16de27e5c3dd246c66ccd132552e98c2d9e..eeb2212cd33e5d7a17eca5ac70579078e1a840a8 100644 (file)
@@ -52,6 +52,9 @@ __csinhl (__complex__ long double x)
              cosix = 1.0;
            }
 
+         if (negate)
+           cosix = -cosix;
+
          if (fabsl (__real__ x) > t)
            {
              long double exp_t = __ieee754_expl (t);
@@ -86,9 +89,6 @@ __csinhl (__complex__ long double x)
              __imag__ retval = __ieee754_coshl (__real__ x) * sinix;
            }
 
-         if (negate)
-           __real__ retval = -__real__ retval;
-
          if (fabsl (__real__ retval) < LDBL_MIN)
            {
              volatile long double force_underflow
index accaeb5cf2ac1fdf6b505286fb88d48da75a03cf..a4b1eb56209403a9d8c935335029f33b3ceb28b4 100644 (file)
@@ -52,6 +52,9 @@ __csinl (__complex__ long double x)
              cosix = 1.0;
            }
 
+         if (negate)
+           sinix = -sinix;
+
          if (fabsl (__imag__ x) > t)
            {
              long double exp_t = __ieee754_expl (t);
@@ -86,9 +89,6 @@ __csinl (__complex__ long double x)
              __imag__ retval = __ieee754_sinhl (__imag__ x) * cosix;
            }
 
-         if (negate)
-           __real__ retval = -__real__ retval;
-
          if (fabsl (__real__ retval) < LDBL_MIN)
            {
              volatile long double force_underflow
index 2e2722df4b0d262bd3c5af0e2a35daacae29c153..101831f7db5c0fbf67125418363353d1256284ba 100644 (file)
@@ -1120,9 +1120,9 @@ ildouble: 3
 ldouble: 3
 
 Function: Real part of "csin_upward":
-double: 1
+double: 2
 float: 3
-idouble: 1
+idouble: 2
 ifloat: 3
 ildouble: 3
 ldouble: 3
@@ -1148,9 +1148,9 @@ idouble: 1
 ifloat: 1
 
 Function: Real part of "csinh_downward":
-double: 1
+double: 2
 float: 2
-idouble: 1
+idouble: 2
 ifloat: 2
 ildouble: 3
 ldouble: 3