Should I use BigDecimal or double?
<p>I have to calculate a fairly complex formula in my code, and I'm wondering how to decide whether I should use <code>BigDecimal</code> or just <code>double</code> to do it.</p>

<p>The function is is:</p>

<pre><code>f(x) = 1.03^(4 - ((1/3) * (x-9)^2))
</code></pre>

<p>where <code>x</code> is a double rounded to 4 decimal points, e.g. 1.2345</p>

<p>what are the pros and cons of using <code>BigDecimal</code> versus <code>double</code> and how much precision might I lose if I use <code>double</code> to represent everything?</p>