Computer Arithmetic
What is the advantage of computing a × b + c with an FMA (fused multiply-add) instruction?
- AOnly one rounding, so it is more accurate and faster
- BThe product is always made an integer before adding, so no error occurs at all
- CThe addition is skipped and only the multiplication is done, halving the work
Show answer and explanation
Answer: A. Only one rounding, so it is more accurate and faster
Separate multiply and add instructions round a × b and then round again after adding c, two roundings in all. FMA keeps the unrounded product internally, adds c and rounds just once, so the error is smaller. Being one instruction, it is also faster, and it is used heavily in matrix products, polynomial evaluation and AI. It neither makes the product an integer nor skips the addition. Because the rounding count differs, results can differ slightly from separate operations.
- A. Correct. A single rounding makes it more accurate and faster.
- B. The product is not converted to an integer.
- C. The addition is performed within the same instruction.