Proposal: Add "fma" to the RealFloat class

Artyom yom at
Mon May 4 17:40:27 UTC 2015

On 05/04/2015 08:36 PM, Levent Erkok wrote:
> In particular, the compiler should be free to substitute "a*b+c" with 
> "mulAccum a b c".
But isn't it unacceptable in some cases? For instance, in this case 
(taken from Wikipedia):
> If /x/^2 − /y/^2 is evaluated as ((/x/×/x/) − /y/×/y/) using fused 
> multiply–add, then the result may be negative even when /x/ = /y/ due 
> to the first multiplication discarding low significance bits. This 
> could then lead to an error if, for instance, the square root of the 
> result is then evaluated.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list