]> git.ipfire.org Git - thirdparty/glibc.git/commit
[PATCH 3/7] sin/cos slow paths: remove slow paths from small range reduction
authorWilco Dijkstra <wdijkstr@arm.com>
Tue, 3 Apr 2018 15:33:13 +0000 (16:33 +0100)
committerFangrui Song <i@maskray.me>
Sat, 28 Aug 2021 00:26:05 +0000 (17:26 -0700)
commit76f9784421e988df5a05876a7f256716dd7e412d
tree4083f843ed576ed0401db03a975d5dc75fb467c2
parente525ff25dfea2fd30566066b0e050c9f6f80e092
[PATCH 3/7] sin/cos slow paths: remove slow paths from small range reduction

This patch improves the accuracy of the range reduction.  When the input is
large (2^27) and very close to a multiple of PI/2, using 110 bits of PI is not
enough.  Improve range reduction accuracy to 136 bits.  As a result the special
checks for results close to zero can be removed.  The ULP of the polynomials is
at worst 0.55ULP, so there is no reason for the slow functions, and they can be
removed.

* sysdeps/ieee754/dbl-64/s_sin.c (reduce_sincos_1): Rename to
reduce_sincos, improve accuracy to 136 bits.
(do_sincos_1): Rename to do_sincos, remove fallbacks to slow functions.
(__sin): Use improved reduction and simplified do_sincos calculation.
(__cos): Likewise.
* sysdeps/ieee754/dbl-64/s_sincos.c (__sincos): Likewise.
sysdeps/ieee754/dbl-64/s_sin.c
sysdeps/ieee754/dbl-64/s_sincos.c