Question: For certain values of x, (0.1 + x) * 10.0 and 1.0 + (x * 10.0) can differ by as much as 25%, even when
“For certain values of x, (0.1 + x) * 10.0 and 1.0 + (x * 10.0) can differ by as much as 25%, even when 0.1 and x are of the same magnitude.” Verify this claim. (Warning: If you’re using an x86 processor, be aware that floating-point calculations [even on single-precision variables] are performed internally with 80 bits of precision. Roundoff errors will appear only when intermediate results are stored out to memory [with limited precision] and read back in again.)
Step by Step Solution
3.48 Rating (174 Votes )
There are 3 Steps involved in it
The singleprecision representation of 01 is 0x3dcccccd For x chose the value obtained by negating th... View full answer
Get step-by-step solutions from verified subject matter experts
