title: Understanding ulps in catastrophic cancellation
body: <p>I'm reading <a href="https://docs.oracle.com/cd/E19957-01/806-3568/ncg_goldberg.html" rel="nofollow noreferrer">what every computer scientist should know about floating point</a> and I don't understand the following statement:</p>
  
  <blockquote>
    <p>Catastrophic cancellation occurs when the operands are subject to rounding errors. For example in the quadratic formula, the expression b2 - 4ac occurs. The quantities b2 and 4ac are subject to rounding errors since they are the results of floating-point multiplications. Suppose that they are rounded to the nearest floating-point number, and so <strong>are accurate to within .5 ulp</strong>. When they are subtracted, cancellation can cause many of the accurate digits to disappear, leaving behind mainly digits contaminated by rounding error. Hence the difference might have an error of many ulps. For example, consider b = 3.34, a = 1.22, and c = 2.28. The exact value of b2 - 4ac is .0292. But b2 rounds to 11.2 and 4ac rounds to 11.1, hence the final answer is .1 <strong>which is an error by 70 ulps</strong>, even though 11.2 - 11.1 is exactly equal to .1. The subtraction did not introduce any error, but rather exposed the error introduced in the earlier multiplications.</p>
  </blockquote>
  
  <p>From what I've read, ulps are units in the last place so if I round 11.1556 with 11.2 I can have a maximum of 0.5 units in the last place, i.e. a maximum of 0.05 of error.</p>
  
  <p>But why if I get 11.2 - 11.1 = 0.1, this is a 70 ulps error?? I would have thought this last value is an error of 0.7 ulps</p>