title: Double precision error in R
body: <p>In my code there exists a step during likelihood calculation where I need to evaluate exponent of -ve numbers and take the logarithm after adding such exponents. For e.g.</p>
  
  <pre><code>&gt; log(exp(-2500))
  [1] -Inf
  &gt; log(exp(-2500)+exp(-3000))
  [1] -Inf
  </code></pre>
  
  <p>Due to high absolute value of these -ve numbers, it turns out the exp(-ve number) goes to zero (as expected). But, the logarithm which is evaluated at a later step takes zero as the input. Any way to avoid these erroneous outputs in R?</p>