title: Precision of the quotient of two double precision numbers
body: <p>Let's say I want to calculate numerically the first derivative of f(x) = cos(x) at x = pi/2. df/dx = -sin(x), hence  is df/dx=-1. For this I use the simplest formula:</p>
  
  <p>df/dx = (f(x+h)-f(x))/h + O(h).</p>
  
  <p>Here O(h) is the error, which is proportional to h and therefore, mathematically O(h) goes to zero as h goes to zero. I understand that in a computer things are different. </p>
  
  <p>Should I expect that if I am using double precision, which should give me between 15 and 17 decimal significant digits, I should be able to approach the exact result df/dx = -1.0 by ~10^-15? I.e. should I find (df/dx)_numerical + 1.0 ~ 10^-15?</p>
  
  <p>This is what I find for different values of h:</p>
  
  <p>h values: </p>
  
  <pre><code>[0.0001, 1e-05, 1e-06, 1e-07, 1e-08, 1e-09, 1e-10]
  </code></pre>
  
  <p>(df/dx)_numerical:</p>
  
  <pre><code>[-0.9999999983332231,
  -0.9999999999898844,
  -0.9999999999175667,
  -1.0000000005838656,
  -0.999999993922529,
  -1.000000082740371,
  -1.000000082740371]
  </code></pre>
  
  <p>Is this expected? Why? Why is the best result obtained for h = 10^-5?</p>