Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
NCTM or The Math Forum.


Math Forum
»
Discussions
»
sci.math.*
»
sci.math
Notice: We are no longer accepting new posts, but the forums will continue to be readable.
Topic:
Fast exponent and logarithm, given initial estimate
Replies:
29
Last Post:
Nov 8, 2004 2:31 AM




Re: Fast exponent and logarithm, given initial estimate
Posted:
Oct 19, 2004 9:48 AM


In article <9215d7ac.0410180730.16880959@posting.google.com>, glenlow@pixelglow.com (Glen Low) writes: >Hi all > >I'm new to the group, so excuse this post if it's too elementary. I also excuse the post if it is not elementary :) > >I need a fast exponent and logarithm routine for floats. It should >preferably use only adds, subtracts and multiplies; divides and square >roots are permissible if necessary. It should not use large lookup >tables. An additional wrinkle (or help) is that there's a exponent and >a logarithm estimate available. (In case you're wondering, this is the >situation with the Altivec SIMD instruction set.) > <snap> .. 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) .. as deep as the final accuracy requires. Note that the density of these lookup tables does not the be of that kind; the only request to it is that any exponential can be decomposed into a sum of entries in the table. So a lookup table with exp(8),exp(4),exp(2),exp(1), exp(1/2), exp(1/4), exp(1/8),...exp(1/2^n) would serve an equivalent purpose, for instance.



