Re: Simple/Fast Algorithm for binary logarithm in C (on ARM7)
- From: "Peter Dickerson" <firstname.lastname@xxxxxxxxxxxxxxxx>
- Date: Sun, 13 May 2007 09:27:01 GMT
"Tilmann Reh" <tilmannreh@xxxxxxxxxxxxx> wrote in message
news:4644d8cd$0$10194$9b4e6d93@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Peter Dickerson schrieb:
It all depends on how accurate the log function should be. If you are
fine
with 10% accuracy, just count the insignificant bits and then do a
simplest linear approximation.
The OP didn't give an input range or accuracy requirement so its hard to
guess what is best. The thing we do know is that its for an ARM7, which
has
a reasonable multiplier, so better than linear shouldn't be a issue.
10% will definitely not be enough...
The input data is in fixed point format, so the range can be choosen
rather freely - however the differences in the input data already are
small (say about 1/1000), and the flatness of the log curve makes them
even smaller in the log result. So the mantissa surely has to be taken
into account...
one part in a thousand of input isn't a big problem for log. Thats the same
in natural logs i.e ln(1.001) ~= 0.001. Wide dynamic range isn't a problem
for logs because thats take out at the shift-renormalization step. So if you
want ln() to better than 0.001 (or log10() to better than .0004) then you're
in the realm of table lookup or small polynomial fit. ARM7tdmi has 32x32->64
fast multiply thats good for polys.
Peter
.
- References:
- Simple/Fast Algorithm for binary logarithm in C (on ARM7)
- From: Tilmann Reh
- Re: Simple/Fast Algorithm for binary logarithm in C (on ARM7)
- From: Vladimir Vassilevsky
- Re: Simple/Fast Algorithm for binary logarithm in C (on ARM7)
- From: Peter Dickerson
- Re: Simple/Fast Algorithm for binary logarithm in C (on ARM7)
- From: Tilmann Reh
- Simple/Fast Algorithm for binary logarithm in C (on ARM7)
- Prev by Date: Re: Free/Cheap PCB Design Tools?
- Next by Date: Re: Free/Cheap PCB Design Tools?
- Previous by thread: Re: Simple/Fast Algorithm for binary logarithm in C (on ARM7)
- Next by thread: Re: Simple/Fast Algorithm for binary logarithm in C (on ARM7)
- Index(es):