title: How to determine error in floating-point calculations?
body: <p>I have the following equation I want to implement in floating-point arithmetic:</p>
  
  <p><strong>Equation: sqrt((a-b)^2 + (c-d)^2 + (e-f)^2)</strong></p>
  
  <p>I am wondering how to determine how the width of the mantissa affects the accuracy of the results? How does this affect the accuracy of the result? I was wondering what the correct mathematical approach to determining this is?</p>
  
  <p>For instance, if I perform the following operations, how will the accuracy be affected as after each step?</p>
  
  <p><em>Here are the steps:</em></p>
  
  <p><strong>Step 1</strong>, Perform the following calculations in 32-bit single precision floating point: x=(a-b), y=(c-d), z=(e-f)</p>
  
  <p><strong>Step 2</strong>, Round the three results to  have a mantissa of 16 bits (not including the hidden bit),</p>
  
  <p><strong>Step 3</strong>, Perform the following squaring operations: x2 = x^2, y2 = y^2, z2 = z^2</p>
  
  <p><strong>Step 4</strong>, Round x2, y2, and z2 to a mantissa of 10 bits (after the decimal point).</p>
  
  <p><strong>Step 5</strong>, Add the values: w = x2 + y2 = z2</p>
  
  <p><strong>Step 6</strong>, Round the results to 16 bits</p>
  
  <p><strong>Step 7,</strong> Take the square root: sqrt(w)</p>
  
  <p><strong>Step 8</strong>, Round to 20 mantissa bits (not including the mantissa).</p>