Fix sinh missing underflows (bug 16519).

Similar to various other bugs in this area, some sinh implementations
do not raise the underflow exception for subnormal arguments, when the
result is tiny and inexact.  This patch forces the exception in a
similar way to previous fixes.

Tested for x86_64, x86, mips64 and powerpc.

	[BZ #16519]
	* sysdeps/ieee754/dbl-64/e_sinh.c: Include <float.h>.
	(__ieee754_sinh): Force underflow exception for arguments with
	small absolute value.
	* sysdeps/ieee754/flt-32/e_sinhf.c: Include <float.h>.
	(__ieee754_sinhf): Force underflow exception for arguments with
	small absolute value.
	* sysdeps/ieee754/ldbl-128/e_sinhl.c: Include <float.h>.
	(__ieee754_sinhl): Force underflow exception for arguments with
	small absolute value.
	* sysdeps/ieee754/ldbl-128ibm/e_sinhl.c: Include <float.h>.
	(__ieee754_sinhl): Force underflow exception for arguments with
	small absolute value.
	* sysdeps/ieee754/ldbl-96/e_sinhl.c: Include <float.h>.
	(__ieee754_sinhl): Force underflow exception for arguments with
	small absolute value.
	* math/auto-libm-test-in: Add more tests of sinh.
	* math/auto-libm-test-out: Regenerated.
	* sysdeps/i386/fpu/libm-test-ulps: Update.
This commit is contained in:
Joseph Myers 2015-08-06 23:01:09 +00:00
parent 2ba30a182c
commit 5e29dd5737
10 changed files with 392 additions and 8 deletions

View File

@ -1,3 +1,25 @@
2015-08-06 Joseph Myers <joseph@codesourcery.com>
[BZ #16519]
* sysdeps/ieee754/dbl-64/e_sinh.c: Include <float.h>.
(__ieee754_sinh): Force underflow exception for arguments with
small absolute value.
* sysdeps/ieee754/flt-32/e_sinhf.c: Include <float.h>.
(__ieee754_sinhf): Force underflow exception for arguments with
small absolute value.
* sysdeps/ieee754/ldbl-128/e_sinhl.c: Include <float.h>.
(__ieee754_sinhl): Force underflow exception for arguments with
small absolute value.
* sysdeps/ieee754/ldbl-128ibm/e_sinhl.c: Include <float.h>.
(__ieee754_sinhl): Force underflow exception for arguments with
small absolute value.
* sysdeps/ieee754/ldbl-96/e_sinhl.c: Include <float.h>.
(__ieee754_sinhl): Force underflow exception for arguments with
small absolute value.
* math/auto-libm-test-in: Add more tests of sinh.
* math/auto-libm-test-out: Regenerated.
* sysdeps/i386/fpu/libm-test-ulps: Update.
2015-08-06 Paul Pluzhnikov <ppluzhnikov@google.com> 2015-08-06 Paul Pluzhnikov <ppluzhnikov@google.com>
* libio/oldfileops.c: Include unistd.h. * libio/oldfileops.c: Include unistd.h.

2
NEWS
View File

@ -8,7 +8,7 @@ using `glibc' in the "product" field.
Version 2.23 Version 2.23
* The following bugs are resolved with this release: * The following bugs are resolved with this release:
18265, 18525, 18647, 18661. 16519, 18265, 18525, 18647, 18661.
Version 2.22 Version 2.22

View File

@ -2528,6 +2528,10 @@ sinh 0x7.6e259d2436fc4p-4
sinh 0x3.d6e088p-4 sinh 0x3.d6e088p-4
sinh -0x7.688eap-4 sinh -0x7.688eap-4
sinh -0xd.dce79p-4 sinh -0xd.dce79p-4
sinh min
sinh -min
sinh min_subnorm
sinh -min_subnorm
sqrt 0 sqrt 0
sqrt -0 sqrt -0

View File

@ -195274,6 +195274,322 @@ sinh -0xd.dce79p-4
= sinh tonearest ldbl-128ibm -0xd.dce79p-4L : -0xf.a9e6db74e247cef34f74103a48p-4L : inexact-ok = sinh tonearest ldbl-128ibm -0xd.dce79p-4L : -0xf.a9e6db74e247cef34f74103a48p-4L : inexact-ok
= sinh towardzero ldbl-128ibm -0xd.dce79p-4L : -0xf.a9e6db74e247cef34f74103a44p-4L : inexact-ok = sinh towardzero ldbl-128ibm -0xd.dce79p-4L : -0xf.a9e6db74e247cef34f74103a44p-4L : inexact-ok
= sinh upward ldbl-128ibm -0xd.dce79p-4L : -0xf.a9e6db74e247cef34f74103a44p-4L : inexact-ok = sinh upward ldbl-128ibm -0xd.dce79p-4L : -0xf.a9e6db74e247cef34f74103a44p-4L : inexact-ok
sinh min
= sinh downward flt-32 0x4p-128f : 0x4p-128f : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest flt-32 0x4p-128f : 0x4p-128f : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero flt-32 0x4p-128f : 0x4p-128f : inexact-ok underflow-ok errno-erange-ok
= sinh upward flt-32 0x4p-128f : 0x4.000008p-128f : inexact-ok underflow-ok errno-erange-ok
= sinh downward dbl-64 0x4p-128 : 0x4p-128 : inexact-ok
= sinh tonearest dbl-64 0x4p-128 : 0x4p-128 : inexact-ok
= sinh towardzero dbl-64 0x4p-128 : 0x4p-128 : inexact-ok
= sinh upward dbl-64 0x4p-128 : 0x4.0000000000004p-128 : inexact-ok
= sinh downward ldbl-96-intel 0x4p-128L : 0x4p-128L : inexact-ok
= sinh tonearest ldbl-96-intel 0x4p-128L : 0x4p-128L : inexact-ok
= sinh towardzero ldbl-96-intel 0x4p-128L : 0x4p-128L : inexact-ok
= sinh upward ldbl-96-intel 0x4p-128L : 0x4.0000000000000008p-128L : inexact-ok
= sinh downward ldbl-96-m68k 0x4p-128L : 0x4p-128L : inexact-ok
= sinh tonearest ldbl-96-m68k 0x4p-128L : 0x4p-128L : inexact-ok
= sinh towardzero ldbl-96-m68k 0x4p-128L : 0x4p-128L : inexact-ok
= sinh upward ldbl-96-m68k 0x4p-128L : 0x4.0000000000000008p-128L : inexact-ok
= sinh downward ldbl-128 0x4p-128L : 0x4p-128L : inexact-ok
= sinh tonearest ldbl-128 0x4p-128L : 0x4p-128L : inexact-ok
= sinh towardzero ldbl-128 0x4p-128L : 0x4p-128L : inexact-ok
= sinh upward ldbl-128 0x4p-128L : 0x4.0000000000000000000000000004p-128L : inexact-ok
= sinh downward ldbl-128ibm 0x4p-128L : 0x4p-128L : inexact-ok
= sinh tonearest ldbl-128ibm 0x4p-128L : 0x4p-128L : inexact-ok
= sinh towardzero ldbl-128ibm 0x4p-128L : 0x4p-128L : inexact-ok
= sinh upward ldbl-128ibm 0x4p-128L : 0x4.00000000000000000000000002p-128L : inexact-ok
= sinh downward dbl-64 0x4p-1024 : 0x4p-1024 : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest dbl-64 0x4p-1024 : 0x4p-1024 : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero dbl-64 0x4p-1024 : 0x4p-1024 : inexact-ok underflow-ok errno-erange-ok
= sinh upward dbl-64 0x4p-1024 : 0x4.0000000000004p-1024 : inexact-ok underflow-ok errno-erange-ok
= sinh downward ldbl-96-intel 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh tonearest ldbl-96-intel 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh towardzero ldbl-96-intel 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh upward ldbl-96-intel 0x4p-1024L : 0x4.0000000000000008p-1024L : inexact-ok
= sinh downward ldbl-96-m68k 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh tonearest ldbl-96-m68k 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh towardzero ldbl-96-m68k 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh upward ldbl-96-m68k 0x4p-1024L : 0x4.0000000000000008p-1024L : inexact-ok
= sinh downward ldbl-128 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh tonearest ldbl-128 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh towardzero ldbl-128 0x4p-1024L : 0x4p-1024L : inexact-ok
= sinh upward ldbl-128 0x4p-1024L : 0x4.0000000000000000000000000004p-1024L : inexact-ok
= sinh downward ldbl-128ibm 0x4p-1024L : 0x4p-1024L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128ibm 0x4p-1024L : 0x4p-1024L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128ibm 0x4p-1024L : 0x4p-1024L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128ibm 0x4p-1024L : 0x4.0000000000004p-1024L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-intel 0x4p-16384L : 0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest ldbl-96-intel 0x4p-16384L : 0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero ldbl-96-intel 0x4p-16384L : 0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh upward ldbl-96-intel 0x4p-16384L : 0x4.0000000000000008p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh downward ldbl-96-m68k 0x4p-16384L : 0x4p-16384L : inexact-ok
= sinh tonearest ldbl-96-m68k 0x4p-16384L : 0x4p-16384L : inexact-ok
= sinh towardzero ldbl-96-m68k 0x4p-16384L : 0x4p-16384L : inexact-ok
= sinh upward ldbl-96-m68k 0x4p-16384L : 0x4.0000000000000008p-16384L : inexact-ok
= sinh downward ldbl-128 0x4p-16384L : 0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest ldbl-128 0x4p-16384L : 0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero ldbl-128 0x4p-16384L : 0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh upward ldbl-128 0x4p-16384L : 0x4.0000000000000000000000000004p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh downward ldbl-96-intel 0x2p-16384L : 0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-96-intel 0x2p-16384L : 0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-96-intel 0x2p-16384L : 0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-96-intel 0x2p-16384L : 0x2.0000000000000008p-16384L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-m68k 0x2p-16384L : 0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest ldbl-96-m68k 0x2p-16384L : 0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero ldbl-96-m68k 0x2p-16384L : 0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh upward ldbl-96-m68k 0x2p-16384L : 0x2.0000000000000004p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh downward ldbl-128 0x2p-16384L : 0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128 0x2p-16384L : 0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128 0x2p-16384L : 0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128 0x2p-16384L : 0x2.0000000000000000000000000004p-16384L : inexact-ok underflow errno-erange-ok
= sinh downward dbl-64 0x8p-972 : 0x8p-972 : inexact-ok
= sinh tonearest dbl-64 0x8p-972 : 0x8p-972 : inexact-ok
= sinh towardzero dbl-64 0x8p-972 : 0x8p-972 : inexact-ok
= sinh upward dbl-64 0x8p-972 : 0x8.0000000000008p-972 : inexact-ok
= sinh downward ldbl-96-intel 0x8p-972L : 0x8p-972L : inexact-ok
= sinh tonearest ldbl-96-intel 0x8p-972L : 0x8p-972L : inexact-ok
= sinh towardzero ldbl-96-intel 0x8p-972L : 0x8p-972L : inexact-ok
= sinh upward ldbl-96-intel 0x8p-972L : 0x8.000000000000001p-972L : inexact-ok
= sinh downward ldbl-96-m68k 0x8p-972L : 0x8p-972L : inexact-ok
= sinh tonearest ldbl-96-m68k 0x8p-972L : 0x8p-972L : inexact-ok
= sinh towardzero ldbl-96-m68k 0x8p-972L : 0x8p-972L : inexact-ok
= sinh upward ldbl-96-m68k 0x8p-972L : 0x8.000000000000001p-972L : inexact-ok
= sinh downward ldbl-128 0x8p-972L : 0x8p-972L : inexact-ok
= sinh tonearest ldbl-128 0x8p-972L : 0x8p-972L : inexact-ok
= sinh towardzero ldbl-128 0x8p-972L : 0x8p-972L : inexact-ok
= sinh upward ldbl-128 0x8p-972L : 0x8.0000000000000000000000000008p-972L : inexact-ok
= sinh downward ldbl-128ibm 0x8p-972L : 0x8p-972L : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest ldbl-128ibm 0x8p-972L : 0x8p-972L : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero ldbl-128ibm 0x8p-972L : 0x8p-972L : inexact-ok underflow-ok errno-erange-ok
= sinh upward ldbl-128ibm 0x8p-972L : 0x8.00000000000000000000000004p-972L : inexact-ok underflow-ok errno-erange-ok
sinh -min
= sinh downward flt-32 -0x4p-128f : -0x4.000008p-128f : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest flt-32 -0x4p-128f : -0x4p-128f : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero flt-32 -0x4p-128f : -0x4p-128f : inexact-ok underflow-ok errno-erange-ok
= sinh upward flt-32 -0x4p-128f : -0x4p-128f : inexact-ok underflow-ok errno-erange-ok
= sinh downward dbl-64 -0x4p-128 : -0x4.0000000000004p-128 : inexact-ok
= sinh tonearest dbl-64 -0x4p-128 : -0x4p-128 : inexact-ok
= sinh towardzero dbl-64 -0x4p-128 : -0x4p-128 : inexact-ok
= sinh upward dbl-64 -0x4p-128 : -0x4p-128 : inexact-ok
= sinh downward ldbl-96-intel -0x4p-128L : -0x4.0000000000000008p-128L : inexact-ok
= sinh tonearest ldbl-96-intel -0x4p-128L : -0x4p-128L : inexact-ok
= sinh towardzero ldbl-96-intel -0x4p-128L : -0x4p-128L : inexact-ok
= sinh upward ldbl-96-intel -0x4p-128L : -0x4p-128L : inexact-ok
= sinh downward ldbl-96-m68k -0x4p-128L : -0x4.0000000000000008p-128L : inexact-ok
= sinh tonearest ldbl-96-m68k -0x4p-128L : -0x4p-128L : inexact-ok
= sinh towardzero ldbl-96-m68k -0x4p-128L : -0x4p-128L : inexact-ok
= sinh upward ldbl-96-m68k -0x4p-128L : -0x4p-128L : inexact-ok
= sinh downward ldbl-128 -0x4p-128L : -0x4.0000000000000000000000000004p-128L : inexact-ok
= sinh tonearest ldbl-128 -0x4p-128L : -0x4p-128L : inexact-ok
= sinh towardzero ldbl-128 -0x4p-128L : -0x4p-128L : inexact-ok
= sinh upward ldbl-128 -0x4p-128L : -0x4p-128L : inexact-ok
= sinh downward ldbl-128ibm -0x4p-128L : -0x4.00000000000000000000000002p-128L : inexact-ok
= sinh tonearest ldbl-128ibm -0x4p-128L : -0x4p-128L : inexact-ok
= sinh towardzero ldbl-128ibm -0x4p-128L : -0x4p-128L : inexact-ok
= sinh upward ldbl-128ibm -0x4p-128L : -0x4p-128L : inexact-ok
= sinh downward dbl-64 -0x4p-1024 : -0x4.0000000000004p-1024 : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest dbl-64 -0x4p-1024 : -0x4p-1024 : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero dbl-64 -0x4p-1024 : -0x4p-1024 : inexact-ok underflow-ok errno-erange-ok
= sinh upward dbl-64 -0x4p-1024 : -0x4p-1024 : inexact-ok underflow-ok errno-erange-ok
= sinh downward ldbl-96-intel -0x4p-1024L : -0x4.0000000000000008p-1024L : inexact-ok
= sinh tonearest ldbl-96-intel -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh towardzero ldbl-96-intel -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh upward ldbl-96-intel -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh downward ldbl-96-m68k -0x4p-1024L : -0x4.0000000000000008p-1024L : inexact-ok
= sinh tonearest ldbl-96-m68k -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh towardzero ldbl-96-m68k -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh upward ldbl-96-m68k -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh downward ldbl-128 -0x4p-1024L : -0x4.0000000000000000000000000004p-1024L : inexact-ok
= sinh tonearest ldbl-128 -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh towardzero ldbl-128 -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh upward ldbl-128 -0x4p-1024L : -0x4p-1024L : inexact-ok
= sinh downward ldbl-128ibm -0x4p-1024L : -0x4.0000000000004p-1024L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128ibm -0x4p-1024L : -0x4p-1024L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128ibm -0x4p-1024L : -0x4p-1024L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128ibm -0x4p-1024L : -0x4p-1024L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-intel -0x4p-16384L : -0x4.0000000000000008p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest ldbl-96-intel -0x4p-16384L : -0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero ldbl-96-intel -0x4p-16384L : -0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh upward ldbl-96-intel -0x4p-16384L : -0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh downward ldbl-96-m68k -0x4p-16384L : -0x4.0000000000000008p-16384L : inexact-ok
= sinh tonearest ldbl-96-m68k -0x4p-16384L : -0x4p-16384L : inexact-ok
= sinh towardzero ldbl-96-m68k -0x4p-16384L : -0x4p-16384L : inexact-ok
= sinh upward ldbl-96-m68k -0x4p-16384L : -0x4p-16384L : inexact-ok
= sinh downward ldbl-128 -0x4p-16384L : -0x4.0000000000000000000000000004p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest ldbl-128 -0x4p-16384L : -0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero ldbl-128 -0x4p-16384L : -0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh upward ldbl-128 -0x4p-16384L : -0x4p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh downward ldbl-96-intel -0x2p-16384L : -0x2.0000000000000008p-16384L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-96-intel -0x2p-16384L : -0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-96-intel -0x2p-16384L : -0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-96-intel -0x2p-16384L : -0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-m68k -0x2p-16384L : -0x2.0000000000000004p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest ldbl-96-m68k -0x2p-16384L : -0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero ldbl-96-m68k -0x2p-16384L : -0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh upward ldbl-96-m68k -0x2p-16384L : -0x2p-16384L : inexact-ok underflow-ok errno-erange-ok
= sinh downward ldbl-128 -0x2p-16384L : -0x2.0000000000000000000000000004p-16384L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128 -0x2p-16384L : -0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128 -0x2p-16384L : -0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128 -0x2p-16384L : -0x2p-16384L : inexact-ok underflow errno-erange-ok
= sinh downward dbl-64 -0x8p-972 : -0x8.0000000000008p-972 : inexact-ok
= sinh tonearest dbl-64 -0x8p-972 : -0x8p-972 : inexact-ok
= sinh towardzero dbl-64 -0x8p-972 : -0x8p-972 : inexact-ok
= sinh upward dbl-64 -0x8p-972 : -0x8p-972 : inexact-ok
= sinh downward ldbl-96-intel -0x8p-972L : -0x8.000000000000001p-972L : inexact-ok
= sinh tonearest ldbl-96-intel -0x8p-972L : -0x8p-972L : inexact-ok
= sinh towardzero ldbl-96-intel -0x8p-972L : -0x8p-972L : inexact-ok
= sinh upward ldbl-96-intel -0x8p-972L : -0x8p-972L : inexact-ok
= sinh downward ldbl-96-m68k -0x8p-972L : -0x8.000000000000001p-972L : inexact-ok
= sinh tonearest ldbl-96-m68k -0x8p-972L : -0x8p-972L : inexact-ok
= sinh towardzero ldbl-96-m68k -0x8p-972L : -0x8p-972L : inexact-ok
= sinh upward ldbl-96-m68k -0x8p-972L : -0x8p-972L : inexact-ok
= sinh downward ldbl-128 -0x8p-972L : -0x8.0000000000000000000000000008p-972L : inexact-ok
= sinh tonearest ldbl-128 -0x8p-972L : -0x8p-972L : inexact-ok
= sinh towardzero ldbl-128 -0x8p-972L : -0x8p-972L : inexact-ok
= sinh upward ldbl-128 -0x8p-972L : -0x8p-972L : inexact-ok
= sinh downward ldbl-128ibm -0x8p-972L : -0x8.00000000000000000000000004p-972L : inexact-ok underflow-ok errno-erange-ok
= sinh tonearest ldbl-128ibm -0x8p-972L : -0x8p-972L : inexact-ok underflow-ok errno-erange-ok
= sinh towardzero ldbl-128ibm -0x8p-972L : -0x8p-972L : inexact-ok underflow-ok errno-erange-ok
= sinh upward ldbl-128ibm -0x8p-972L : -0x8p-972L : inexact-ok underflow-ok errno-erange-ok
sinh min_subnorm
= sinh downward flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
= sinh tonearest flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
= sinh towardzero flt-32 0x8p-152f : 0x8p-152f : inexact-ok underflow errno-erange-ok
= sinh upward flt-32 0x8p-152f : 0x1p-148f : inexact-ok underflow errno-erange-ok
= sinh downward dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
= sinh tonearest dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
= sinh towardzero dbl-64 0x8p-152 : 0x8p-152 : inexact-ok
= sinh upward dbl-64 0x8p-152 : 0x8.0000000000008p-152 : inexact-ok
= sinh downward ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
= sinh tonearest ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
= sinh towardzero ldbl-96-intel 0x8p-152L : 0x8p-152L : inexact-ok
= sinh upward ldbl-96-intel 0x8p-152L : 0x8.000000000000001p-152L : inexact-ok
= sinh downward ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
= sinh tonearest ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
= sinh towardzero ldbl-96-m68k 0x8p-152L : 0x8p-152L : inexact-ok
= sinh upward ldbl-96-m68k 0x8p-152L : 0x8.000000000000001p-152L : inexact-ok
= sinh downward ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
= sinh tonearest ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
= sinh towardzero ldbl-128 0x8p-152L : 0x8p-152L : inexact-ok
= sinh upward ldbl-128 0x8p-152L : 0x8.0000000000000000000000000008p-152L : inexact-ok
= sinh downward ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
= sinh tonearest ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
= sinh towardzero ldbl-128ibm 0x8p-152L : 0x8p-152L : inexact-ok
= sinh upward ldbl-128ibm 0x8p-152L : 0x8.00000000000000000000000004p-152L : inexact-ok
= sinh downward dbl-64 0x4p-1076 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
= sinh tonearest dbl-64 0x4p-1076 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
= sinh towardzero dbl-64 0x4p-1076 : 0x4p-1076 : inexact-ok underflow errno-erange-ok
= sinh upward dbl-64 0x4p-1076 : 0x8p-1076 : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-intel 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh tonearest ldbl-96-intel 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh towardzero ldbl-96-intel 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh upward ldbl-96-intel 0x4p-1076L : 0x4.0000000000000008p-1076L : inexact-ok
= sinh downward ldbl-96-m68k 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh tonearest ldbl-96-m68k 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh towardzero ldbl-96-m68k 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh upward ldbl-96-m68k 0x4p-1076L : 0x4.0000000000000008p-1076L : inexact-ok
= sinh downward ldbl-128 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh tonearest ldbl-128 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh towardzero ldbl-128 0x4p-1076L : 0x4p-1076L : inexact-ok
= sinh upward ldbl-128 0x4p-1076L : 0x4.0000000000000000000000000004p-1076L : inexact-ok
= sinh downward ldbl-128ibm 0x4p-1076L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128ibm 0x4p-1076L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128ibm 0x4p-1076L : 0x4p-1076L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128ibm 0x4p-1076L : 0x8p-1076L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-intel 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-96-intel 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-96-intel 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-96-intel 0x8p-16448L : 0x1p-16444L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-m68k 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-96-m68k 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-96-m68k 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-96-m68k 0x8p-16448L : 0xcp-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-128 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128 0x8p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128 0x8p-16448L : 0x8.000000000004p-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-m68k 0x4p-16448L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-96-m68k 0x4p-16448L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-96-m68k 0x4p-16448L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-96-m68k 0x4p-16448L : 0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-128 0x4p-16448L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128 0x4p-16448L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128 0x4p-16448L : 0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128 0x4p-16448L : 0x4.000000000004p-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-128 0x4p-16496L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128 0x4p-16496L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128 0x4p-16496L : 0x4p-16496L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128 0x4p-16496L : 0x8p-16496L : inexact-ok underflow errno-erange-ok
sinh -min_subnorm
= sinh downward flt-32 -0x8p-152f : -0x1p-148f : inexact-ok underflow errno-erange-ok
= sinh tonearest flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
= sinh towardzero flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
= sinh upward flt-32 -0x8p-152f : -0x8p-152f : inexact-ok underflow errno-erange-ok
= sinh downward dbl-64 -0x8p-152 : -0x8.0000000000008p-152 : inexact-ok
= sinh tonearest dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
= sinh towardzero dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
= sinh upward dbl-64 -0x8p-152 : -0x8p-152 : inexact-ok
= sinh downward ldbl-96-intel -0x8p-152L : -0x8.000000000000001p-152L : inexact-ok
= sinh tonearest ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
= sinh towardzero ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
= sinh upward ldbl-96-intel -0x8p-152L : -0x8p-152L : inexact-ok
= sinh downward ldbl-96-m68k -0x8p-152L : -0x8.000000000000001p-152L : inexact-ok
= sinh tonearest ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
= sinh towardzero ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
= sinh upward ldbl-96-m68k -0x8p-152L : -0x8p-152L : inexact-ok
= sinh downward ldbl-128 -0x8p-152L : -0x8.0000000000000000000000000008p-152L : inexact-ok
= sinh tonearest ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
= sinh towardzero ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
= sinh upward ldbl-128 -0x8p-152L : -0x8p-152L : inexact-ok
= sinh downward ldbl-128ibm -0x8p-152L : -0x8.00000000000000000000000004p-152L : inexact-ok
= sinh tonearest ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
= sinh towardzero ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
= sinh upward ldbl-128ibm -0x8p-152L : -0x8p-152L : inexact-ok
= sinh downward dbl-64 -0x4p-1076 : -0x8p-1076 : inexact-ok underflow errno-erange-ok
= sinh tonearest dbl-64 -0x4p-1076 : -0x4p-1076 : inexact-ok underflow errno-erange-ok
= sinh towardzero dbl-64 -0x4p-1076 : -0x4p-1076 : inexact-ok underflow errno-erange-ok
= sinh upward dbl-64 -0x4p-1076 : -0x4p-1076 : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-intel -0x4p-1076L : -0x4.0000000000000008p-1076L : inexact-ok
= sinh tonearest ldbl-96-intel -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh towardzero ldbl-96-intel -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh upward ldbl-96-intel -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh downward ldbl-96-m68k -0x4p-1076L : -0x4.0000000000000008p-1076L : inexact-ok
= sinh tonearest ldbl-96-m68k -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh towardzero ldbl-96-m68k -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh upward ldbl-96-m68k -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh downward ldbl-128 -0x4p-1076L : -0x4.0000000000000000000000000004p-1076L : inexact-ok
= sinh tonearest ldbl-128 -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh towardzero ldbl-128 -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh upward ldbl-128 -0x4p-1076L : -0x4p-1076L : inexact-ok
= sinh downward ldbl-128ibm -0x4p-1076L : -0x8p-1076L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128ibm -0x4p-1076L : -0x4p-1076L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128ibm -0x4p-1076L : -0x4p-1076L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128ibm -0x4p-1076L : -0x4p-1076L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-intel -0x8p-16448L : -0x1p-16444L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-96-intel -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-96-intel -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-96-intel -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-m68k -0x8p-16448L : -0xcp-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-96-m68k -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-96-m68k -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-96-m68k -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-128 -0x8p-16448L : -0x8.000000000004p-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128 -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128 -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128 -0x8p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-96-m68k -0x4p-16448L : -0x8p-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-96-m68k -0x4p-16448L : -0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-96-m68k -0x4p-16448L : -0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-96-m68k -0x4p-16448L : -0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-128 -0x4p-16448L : -0x4.000000000004p-16448L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128 -0x4p-16448L : -0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128 -0x4p-16448L : -0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128 -0x4p-16448L : -0x4p-16448L : inexact-ok underflow errno-erange-ok
= sinh downward ldbl-128 -0x4p-16496L : -0x8p-16496L : inexact-ok underflow errno-erange-ok
= sinh tonearest ldbl-128 -0x4p-16496L : -0x4p-16496L : inexact-ok underflow errno-erange-ok
= sinh towardzero ldbl-128 -0x4p-16496L : -0x4p-16496L : inexact-ok underflow errno-erange-ok
= sinh upward ldbl-128 -0x4p-16496L : -0x4p-16496L : inexact-ok underflow errno-erange-ok
sqrt 0 sqrt 0
= sqrt downward flt-32 0x0p+0f : 0x0p+0f : = sqrt downward flt-32 0x0p+0f : 0x0p+0f :
= sqrt tonearest flt-32 0x0p+0f : 0x0p+0f : = sqrt tonearest flt-32 0x0p+0f : 0x0p+0f :

View File

@ -1864,6 +1864,10 @@ ildouble: 2
ldouble: 2 ldouble: 2
Function: "sinh_downward": Function: "sinh_downward":
double: 1
float: 1
idouble: 1
ifloat: 1
ildouble: 4 ildouble: 4
ldouble: 5 ldouble: 5
@ -1874,6 +1878,8 @@ ldouble: 4
Function: "sinh_upward": Function: "sinh_upward":
double: 1 double: 1
float: 1 float: 1
idouble: 1
ifloat: 1
ildouble: 4 ildouble: 4
ldouble: 5 ldouble: 5

View File

@ -32,6 +32,7 @@ static char rcsid[] = "$NetBSD: e_sinh.c,v 1.7 1995/05/10 20:46:13 jtc Exp $";
* only sinh(0)=0 is exact for finite x. * only sinh(0)=0 is exact for finite x.
*/ */
#include <float.h>
#include <math.h> #include <math.h>
#include <math_private.h> #include <math_private.h>
@ -58,10 +59,16 @@ __ieee754_sinh (double x)
/* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */ /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x40360000) /* |x|<22 */ if (ix < 0x40360000) /* |x|<22 */
{ {
if (__glibc_unlikely (ix < 0x3e300000)) /* |x|<2**-28 */ if (__glibc_unlikely (ix < 0x3e300000)) { /* |x|<2**-28 */
if (fabs (x) < DBL_MIN)
{
double force_underflow = x * x;
math_force_eval (force_underflow);
}
if (shuge + x > one) if (shuge + x > one)
return x; return x;
/* sinh(tiny) = tiny with inexact */ /* sinh(tiny) = tiny with inexact */
}
t = __expm1 (fabs (x)); t = __expm1 (fabs (x));
if (ix < 0x3ff00000) if (ix < 0x3ff00000)
return h * (2.0 * t - t * t / (t + one)); return h * (2.0 * t - t * t / (t + one));

View File

@ -13,6 +13,7 @@
* ==================================================== * ====================================================
*/ */
#include <float.h>
#include <math.h> #include <math.h>
#include <math_private.h> #include <math_private.h>
@ -34,8 +35,14 @@ __ieee754_sinhf(float x)
if (jx<0) h = -h; if (jx<0) h = -h;
/* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */ /* |x| in [0,22], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x41b00000) { /* |x|<22 */ if (ix < 0x41b00000) { /* |x|<22 */
if (__builtin_expect(ix<0x31800000, 0)) /* |x|<2**-28 */ if (__builtin_expect(ix<0x31800000, 0)) { /* |x|<2**-28 */
if (fabsf (x) < FLT_MIN)
{
float force_underflow = x * x;
math_force_eval (force_underflow);
}
if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */ if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
}
t = __expm1f(fabsf(x)); t = __expm1f(fabsf(x));
if(ix<0x3f800000) return h*((float)2.0*t-t*t/(t+one)); if(ix<0x3f800000) return h*((float)2.0*t-t*t/(t+one));
return h*(t+t/(t+one)); return h*(t+t/(t+one));

View File

@ -53,6 +53,7 @@
* only sinhl(0)=0 is exact for finite x. * only sinhl(0)=0 is exact for finite x.
*/ */
#include <float.h>
#include <math.h> #include <math.h>
#include <math_private.h> #include <math_private.h>
@ -86,8 +87,15 @@ __ieee754_sinhl (long double x)
if (ix <= 0x40044000) if (ix <= 0x40044000)
{ {
if (ix < 0x3fc60000) /* |x| < 2^-57 */ if (ix < 0x3fc60000) /* |x| < 2^-57 */
if (shuge + x > one) {
return x; /* sinh(tiny) = tiny with inexact */ if (fabsl (x) < LDBL_MIN)
{
long double force_underflow = x * x;
math_force_eval (force_underflow);
}
if (shuge + x > one)
return x; /* sinh(tiny) = tiny with inexact */
}
t = __expm1l (u.value); t = __expm1l (u.value);
if (ix < 0x3fff0000) if (ix < 0x3fff0000)
return h * (2.0 * t - t * t / (t + one)); return h * (2.0 * t - t * t / (t + one));

View File

@ -28,6 +28,7 @@
* only sinh(0)=0 is exact for finite x. * only sinh(0)=0 is exact for finite x.
*/ */
#include <float.h>
#include <math.h> #include <math.h>
#include <math_private.h> #include <math_private.h>
@ -52,8 +53,14 @@ __ieee754_sinhl(long double x)
if (jx<0) h = -h; if (jx<0) h = -h;
/* |x| in [0,40], return sign(x)*0.5*(E+E/(E+1))) */ /* |x| in [0,40], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x4044000000000000LL) { /* |x|<40 */ if (ix < 0x4044000000000000LL) { /* |x|<40 */
if (ix<0x3e20000000000000LL) /* |x|<2**-29 */ if (ix<0x3e20000000000000LL) { /* |x|<2**-29 */
if (fabsl (x) < LDBL_MIN)
{
long double force_underflow = x * x;
math_force_eval (force_underflow);
}
if(shuge+x>one) return x;/* sinhl(tiny) = tiny with inexact */ if(shuge+x>one) return x;/* sinhl(tiny) = tiny with inexact */
}
t = __expm1l(fabsl(x)); t = __expm1l(fabsl(x));
if(ix<0x3ff0000000000000LL) return h*(2.0*t-t*t/(t+one)); if(ix<0x3ff0000000000000LL) return h*(2.0*t-t*t/(t+one));
w = t/(t+one); w = t/(t+one);

View File

@ -36,6 +36,7 @@ static char rcsid[] = "$NetBSD: $";
* only sinhl(0)=0 is exact for finite x. * only sinhl(0)=0 is exact for finite x.
*/ */
#include <float.h>
#include <math.h> #include <math.h>
#include <math_private.h> #include <math_private.h>
@ -58,8 +59,14 @@ __ieee754_sinhl(long double x)
if (jx & 0x8000) h = -h; if (jx & 0x8000) h = -h;
/* |x| in [0,25], return sign(x)*0.5*(E+E/(E+1))) */ /* |x| in [0,25], return sign(x)*0.5*(E+E/(E+1))) */
if (ix < 0x4003 || (ix == 0x4003 && i0 <= 0xc8000000)) { /* |x|<25 */ if (ix < 0x4003 || (ix == 0x4003 && i0 <= 0xc8000000)) { /* |x|<25 */
if (ix<0x3fdf) /* |x|<2**-32 */ if (ix<0x3fdf) { /* |x|<2**-32 */
if (fabsl (x) < LDBL_MIN)
{
long double force_underflow = x * x;
math_force_eval (force_underflow);
}
if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */ if(shuge+x>one) return x;/* sinh(tiny) = tiny with inexact */
}
t = __expm1l(fabsl(x)); t = __expm1l(fabsl(x));
if(ix<0x3fff) return h*(2.0*t-t*t/(t+one)); if(ix<0x3fff) return h*(2.0*t-t*t/(t+one));
return h*(t+t/(t+one)); return h*(t+t/(t+one));