Mark Dickinson added the comment:

> The performance argument unlikely is applicable in this case.

Agreed. This is mainly about accuracy, not speed: the FMA operation is a 
fundamental building block for floating-point arithmetic, is useful in some 
numerical algorithms, and essential in others (especially when doing things 
like double-double arithmetic). It would be valuable to have when prototyping 
numerical algorithms in pure Python.

Given that it's supported in C99 and on current Windows, I'm +1 on including it 
in the math module.

Note that implementing this it not quite as straightforward as simply wrapping 
the libm version, since we'll also want the correct exceptional behaviour, for 
consistency with the rest of the math module: i.e., we should be raising 
ValueError where the fma operation would signal the invalid FPE, and 
OverflowError where the fma operation would signal the overflow FPE.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29282>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to