Subject: Performance of the logarithm algorithm on bfloats
From: Raymond Toy
Date: Sun, 25 Apr 2010 23:18:52 -0400
On 4/25/10 10:49 PM, Raymond Toy wrote:
> On 4/25/10 9:15 PM, Sean Lake wrote:
>> Hello all,
>>
>> On a whim I used big floats to calculate exp( 1 / bfloat(1.3806505e-23) ). The answer I got was 2.198035052553252b31455787102040073147561. When I tried to invert the operation, however, the result was incredibly slow. Naturally, when I performed the operation as: log(2.198035052553252) + 31455787102040073147561 * log(10), numer; the result computed basically instantaneously. Is there a reason that Maxima doesn't utilize this algorithm in performing such computations?
>>
> What version of maxima? The current CVS version (and 5.20.1, I think)
> is much faster and essentially returns the correct answer instantly.
Oh, I also wanted to say that the current algorithm is essentially what
you suggest, but since bfloats use a base 2 exponent, the number is
represented as f*2^e, so the log is log(f) + e*log(2).
Ray