diff options
author | Sayed Adel <seiko@imavr.com> | 2022-12-06 21:19:04 +0200 |
---|---|---|
committer | Sayed Adel <seiko@imavr.com> | 2022-12-07 01:50:38 +0200 |
commit | 39fe90da02831699c09fda62865ad8b92021d487 (patch) | |
tree | bda53478fbf9e9657aaa2bd9c9930c70a4848d35 /numpy/array_api/_set_functions.py | |
parent | cfad62fd73c2a0f3d0dc4d73989071e331898a09 (diff) | |
download | numpy-39fe90da02831699c09fda62865ad8b92021d487.tar.gz |
BUG, SIMD: Fix rounding large numbers >= 2^52 on SSE2
Before SSE41, there were no native instructions for rounding
operations on double precision. We usually emulate it by assuming
that the `MXCR` register is set to rounding, adding a
large number `2^52` to `X` and then subtracting it back to
eliminate any excess precision as long as `|X|` is less than `2^52`
otherwise returns `X.`
The current emulated intrinics `npyv_[rint,floor, ceil, trunc]_f64`
was not checking whether `|x|` equal or large `2^52` which leads
to losing accuracy on large numbers.
Diffstat (limited to 'numpy/array_api/_set_functions.py')
0 files changed, 0 insertions, 0 deletions