diff options
author | Joseph Myers <joseph@codesourcery.com> | 2015-06-24 16:20:48 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2015-06-24 16:20:48 +0000 |
commit | ac831b362ad6ecd49643625481ec700a9812e52f (patch) | |
tree | 1c4c0e14f675e50d079ccf0d1641e8637aee2449 /math | |
parent | 8475ab16848cf2adb6ce3446749c2f1d10233286 (diff) | |
download | glibc-ac831b362ad6ecd49643625481ec700a9812e52f.zip glibc-ac831b362ad6ecd49643625481ec700a9812e52f.tar.gz glibc-ac831b362ad6ecd49643625481ec700a9812e52f.tar.bz2 |
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.
Diffstat (limited to 'math')
-rw-r--r-- | math/auto-libm-test-in | 10 | ||||
-rw-r--r-- | math/auto-libm-test-out | 200 | ||||
-rw-r--r-- | math/libm-test.inc | 4 | ||||
-rw-r--r-- | math/s_csin.c | 6 | ||||
-rw-r--r-- | math/s_csinf.c | 6 | ||||
-rw-r--r-- | math/s_csinh.c | 6 | ||||
-rw-r--r-- | math/s_csinhf.c | 6 | ||||
-rw-r--r-- | math/s_csinhl.c | 6 | ||||
-rw-r--r-- | math/s_csinl.c | 6 |
9 files changed, 232 insertions, 18 deletions
diff --git a/math/auto-libm-test-in b/math/auto-libm-test-in index 6545583..2389c05 100644 --- a/math/auto-libm-test-in +++ b/math/auto-libm-test-in @@ -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 diff --git a/math/auto-libm-test-out b/math/auto-libm-test-out index f3672db..b386f00 100644 --- a/math/auto-libm-test-out +++ b/math/auto-libm-test-out @@ -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 diff --git a/math/libm-test.inc b/math/libm-test.inc index 03c3831..ba8e8ff 100644 --- a/math/libm-test.inc +++ b/math/libm-test.inc @@ -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), }; diff --git a/math/s_csin.c b/math/s_csin.c index f1ddb4e..ceee25f 100644 --- a/math/s_csin.c +++ b/math/s_csin.c @@ -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 diff --git a/math/s_csinf.c b/math/s_csinf.c index 6c68189..daca689 100644 --- a/math/s_csinf.c +++ b/math/s_csinf.c @@ -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 diff --git a/math/s_csinh.c b/math/s_csinh.c index c607c2a..d940c97 100644 --- a/math/s_csinh.c +++ b/math/s_csinh.c @@ -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 diff --git a/math/s_csinhf.c b/math/s_csinhf.c index 848f5d1..4e0bc03 100644 --- a/math/s_csinhf.c +++ b/math/s_csinhf.c @@ -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 diff --git a/math/s_csinhl.c b/math/s_csinhl.c index a437d16..eeb2212 100644 --- a/math/s_csinhl.c +++ b/math/s_csinhl.c @@ -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 diff --git a/math/s_csinl.c b/math/s_csinl.c index accaeb5..a4b1eb5 100644 --- a/math/s_csinl.c +++ b/math/s_csinl.c @@ -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 |