Background
It is well known that the exact product of two floating point numbers is not always a floating point number, but the error exact(a*b) - float(a*b)
is. Some codes for exact multiplication exploit this by returning the two numbers
res = a * b
err = fma(a, b, -res)
This makes use of the fused-multiply-add instruction which returns the expression (a*b)+c
with one single rounding.
Question
Now, I would like to do the same for sums, i.e.
res = a + b
err = add3(a, b, -res)
add3
is supposed to return the expression (a+b)+c
with one single rounding.
I wasn't able to find hints that add3
actually exists in the real world except in this article.
Is there a CPU instruction set that contains add3
? Are there languages implementing it?