Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-29282: Add math.fma(): fused multiply-add function #17987
Conversation
Co-Authored-By: Mark Dickinson <mdickinson@enthought.com>
This comment has been minimized.
This comment has been minimized.
This PR is a copy the following https://hg.python.org/cpython/rev/b33012ef1417 written by Mark Dickinson. This change has been reverted, see: https://bugs.python.org/issue29282#msg285956 I created this PR to reconsider math.fma() and to use this PR as a starting point to fix the implementation. I'm now waiting the CIs to see how things are going on. If tests continue to fail on some platforms, I plan to manually handle NaN and INF in the C code, before calling libc fma(). |
This comment has been minimized.
This comment has been minimized.
I would prefer to get the same behavior for fma(x, y, z) than
cc @mdickinson |
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 13, 2020
This comment has been minimized.
This comment has been minimized.
Strange. Tests passed on Linux and Windows pre-commit CIs. Let me try on stable buildbots. |
This comment has been minimized.
This comment has been minimized.
fma is a standard IEEE 754 function, so yes, the behaviour in corner cases is fully specified by IEEE 754, and we should expect to follow that behaviour. |
This comment has been minimized.
This comment has been minimized.
This is the usual rule about propagating NaNs, together with Python's rules for wrapping existing functions (as articulated at the top of Think of |
This comment has been minimized.
This comment has been minimized.
You can also look at |
This comment has been minimized.
This comment has been minimized.
test_fma_zero_result() fails on FreeBSD:
Shared pythoninfo:
Non-debug pythoninfo:
Note: PPC64 Fedora PR failure is unrelated (test_distutils: https://bugs.python.org/issue39248). |
vstinner commentedJan 13, 2020
•
edited by bedevere-bot
Co-Authored-By: Mark Dickinson mdickinson@enthought.com
https://bugs.python.org/issue29282