title: Floating point inaccuracy in R?
body: <p>Does R have a known problem with uniroot and handling floating points?</p>
  
  <pre><code>&gt;str(uniroot(function(x) x*(x^2-1) + .5, lower = -2, upper = 2,
  +                  tol = 0.0001))
  
  List of 4
  $ root      : num -1.19
  $ f.root    : num -2.55e-07
  $ iter      : int 7
  $ estim.prec: num 5e-05
  &gt; -1.19 * ( 1.19 ^ 2 - 1 ) + 0.5 
  [1] 0.004841
  </code></pre>
  
  <p>Clearly the value of <code>f.root</code> is not equal to the value of the function calculated by hand.</p>