Exercise 1: Why (1+x)-1 Becomes Exactly 0.0 — Possible Solution ==================================================================== WHY IT'S EXACTLY 0.0, NOT JUST SMALL AND WRONG ------------------------------ Machine epsilon (Chapter 3) is the smallest value eps such that 1.0 + eps produces a floating-point result different from 1.0 itself - verified directly as 2^-52. At x = 10^-16, x is smaller than machine epsilon (2.22 x 10^-16). This means the mathematically exact sum 1 + x cannot be represented by any floating-point value other than 1.0 itself - there is no representable number between 1.0 and 1.0 + machine epsilon, so the true sum gets rounded during the ADDITION step, before the subtraction ever happens. THE KEY INSIGHT: THE DAMAGE HAPPENS AT THE ADDITION, NOT THE SUBTRACTION ------------------------------ Once 1 + x has already rounded to exactly 1.0 (because x is too small to survive being added to 1.0), the value of x itself has been completely discarded at that point - the computer no longer has any record that x was ever added in the first place. The subsequent subtraction, (that rounded 1.0) - 1, is then computed perfectly correctly - the answer really is exactly 0.0, given what's left to work with. The subtraction isn't buggy or imprecise; it's operating on information that was already lost one step earlier. WHY THIS IS DIFFERENT FROM THE x=10^-15 CASE ------------------------------ At x = 10^-15, x is larger than machine epsilon, so 1 + x rounds to a value that IS distinguishable from 1.0 (though not exactly 1 + x, since 10^-15 still needs more precision than the mantissa has spare capacity for at that scale). The subtraction then recovers something close to x, but with a large relative error (verified: about 11%), because most - but not quite all - of x's information was lost during the addition's own rounding. WHY THIS WORKS AS AN ANSWER ------------------------------ The explanation correctly locates the actual point of information loss (the addition step, governed by machine epsilon from Chapter 3) rather than blaming the subtraction operation itself, and explains why the result is exactly zero rather than merely very small and approximately correct - a distinction this chapter's own experiment makes concrete.