|author||Szabolcs Nagy <email@example.com>||2020-01-18 17:55:25 +0000|
|committer||Rich Felker <firstname.lastname@example.org>||2020-02-21 23:42:05 -0500|
math: fix __rem_pio2 in non-nearest rounding modes
Handle when after reduction |y| > pi/4+tiny. This happens in directed rounding modes because the fast round to int code does not give the nearest integer. In such cases the reduction may not be symmetric between x and -x so e.g. cos(x)==cos(-x) may not hold (but polynomial evaluation is not symmetric either with directed rounding so fixing that would require more changes with bigger performance impact). The fix only adds two predictable branches in nearest rounding mode, simple ubenchmark does not show relevant performance regression in nearest rounding mode. The code could be improved: e.g reducing the medium size threshold such that two step reduction is enough instead of three, and the single precision case can avoid the issue by doing the round to int differently, but this fix was kept minimal.
Diffstat (limited to 'src/math/coshf.c')
0 files changed, 0 insertions, 0 deletions