summaryrefslogtreecommitdiff
path: root/numpy/array_api/_set_functions.py
diff options
context:
space:
mode:
authorSayed Adel <seiko@imavr.com>2022-12-06 21:19:04 +0200
committerSayed Adel <seiko@imavr.com>2022-12-07 01:50:38 +0200
commit39fe90da02831699c09fda62865ad8b92021d487 (patch)
treebda53478fbf9e9657aaa2bd9c9930c70a4848d35 /numpy/array_api/_set_functions.py
parentcfad62fd73c2a0f3d0dc4d73989071e331898a09 (diff)
downloadnumpy-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