mirror of
https://sourceware.org/git/glibc.git
synced 2025-10-20 03:52:29 +03:00
Fix sin, sincos missing underflows (bug 16526, bug 16538).
Similar to various other bugs in this area, some sin and sincos 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 #16526] [BZ #16538] * sysdeps/ieee754/dbl-64/s_sin.c: Include <float.h>. (__sin): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/flt-32/k_sinf.c: Include <float.h>. (__kernel_sinf): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/ldbl-128/k_sincosl.c: Include <float.h>. (__kernel_sincosl): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/ldbl-128/k_sinl.c: Include <float.h>. (__kernel_sinl): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/ldbl-128ibm/k_sincosl.c: Include <float.h>. (__kernel_sincosl): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/ldbl-128ibm/k_sinl.c: Include <float.h>. (__kernel_sinl): Force underflow exception for arguments with small absolute value. * sysdeps/ieee754/ldbl-96/k_sinl.c: Include <float.h>. (__kernel_sinl): Force underflow exception for arguments with small absolute value. * sysdeps/powerpc/fpu/k_sinf.c: Include <float.h>. (__kernel_sinf): Force underflow exception for arguments with small absolute value. * math/auto-libm-test-in: Add more tests of sin and sincos. * math/auto-libm-test-out: Regenerated.
This commit is contained in:
@@ -2317,6 +2317,10 @@ sin 0x1.2001469775ce6p32
|
||||
sin -0x3.3de320f6be87ep+1020
|
||||
sin 0xe.9f1e5bc3bb88p+112
|
||||
sin 0x4.7857dp+68
|
||||
sin min
|
||||
sin -min
|
||||
sin min_subnorm
|
||||
sin -min_subnorm
|
||||
|
||||
sincos 0
|
||||
sincos -0
|
||||
@@ -2339,6 +2343,10 @@ sincos 0x1p+28
|
||||
sincos -0x3.3de320f6be87ep+1020
|
||||
sincos 0xe.9f1e5bc3bb88p+112
|
||||
sincos 0x4.7857dp+68
|
||||
sincos min
|
||||
sincos -min
|
||||
sincos min_subnorm
|
||||
sincos -min_subnorm
|
||||
|
||||
sinh 0
|
||||
sinh -0
|
||||
|
Reference in New Issue
Block a user