Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.
|
|
|
|
Re: Fast exponent and logarithm, given initial estimate
Posted:
Oct 19, 2004 10:22 PM
|
|
> In case the exponentials are of some limited range (say -0.5 to 0.5 or > -10 to 10 for example), and if some lookup tables are allowed, one > could use static lookup tables of the exponent function that cover the > individual decimals of the exponentials. Example: to calculate exp(7.345) > one needs exp(7), exp(0.3), exp(0.04) and exp(0.005) (all of these > are obviously to be multiplied to get the result), and these could be > provided in lookup tables that store > [exp(0)],exp(1),exp(2),..exp(10) > exp(0.1),exp(0.2),..exp(0.9) > exp(0.01),exp(0.02),..exp(0.09)
The problem with lookup tables is that SIMD code tends to fare badly with extensive memory loads. Indeed given the current state of CPU development, most CPU's now are much faster than memory, so calculation is often faster than loading from memory. Of course if the lookup tables are small and would fit into L1 or L2 cache, they could be used.
This is meant to be a general purpose exponentiation routine as well.
Cheers Glen low, Pixelglow Software www.pixelglow.com
|
|
|
|