Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2) The Intel® Math Kernel Library Developer Reference Rev 15 Release 2018 contai

ID: 3589703 • Letter: 2

Question

2) The Intel® Math Kernel Library Developer Reference Rev 15 Release 2018 contains the following cautionary statement: “Because the precision of floating point arithmetic is limited, it is not truly associative: (a + b) + c might not be the same as a + (b + c).” Describe why this happens and give an example of values for a, b, c where the output would differ.

4) If a processor has implemented all forwarding paths but no hazard detection, under what cases could the processor produce erroneous results? Give a short sequence of instructions that would not give correct output if this were the case.

Explanation / Answer

2. The issue is rooted in the way floating-point numbers are represented, the order in which they are operated on by the computer, and the rounding errors that may be introduced. It is a well-known fact that for general floatingpoint numbers represented in an IEEE single or double precision format, the mathematical associative property does not in general hold. In simpler terms, ( a + b ) + c may not equal a + ( b + c ).

ex:  With pencil and paper, 2^-63 + 1 + -1 = 2^-63. If, instead we do this same computation on a computer using double precision floating-point numbers, we get (2^-63 + 1) + (-1) 1 + (-1) = 0 since (2^-63 + 1) rounds to 1, or possibly 2^-63 + (1 + (-1)) 2^-63 + 0 = 2-63 through a slight modification in the order of operations. Clearly 0 does not equal 2^-63, so the order of operations not only influences how and when rounding occurs but also the final computed result.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote