This content has been marked as final.
Show 2 replies

1. Re: Dealing with very small numbers, and logarithms
EJP Jan 8, 2010 10:25 PM (in response to 843853)Find an implementation of Java that supports extended exponents. That gives you exponents up to 16383 or so. Sable VM may be one of those. 
2. Re: Dealing with very small numbers, and logarithms
843853 Jan 9, 2010 3:42 PM (in response to 843853)First of all, any solution requires some amount of numerical analysis to understand the accuracy of any approximation you decide on. Now your particular complaint about 'd' becoming zero and the log going to INFINITY doesn't make sense because you should be computing the sum of the exponentials first, then taking the log of the sum. If you did this you would not get INFINITY you would get something around 1000.
If you're inner sum is finite and small, I would concentrate on an accurate approximation of that. You might consider purely algebraic manipulations such as computing a common denominator for the inner sum so that the problem is transformed into ln (numer / denom) = ln(numer)  ln(denom). This approach might just make things harder, I don't know. Eventually you might use a tool like the Taylor series approximation for ln (1+x) or ln(1x) or e^x to simplify the expression. In any event, always analyze the error of your approximation. Again, this analysis may have you using the Taylor series so keep that handy.