Re: Fast Cube Root Using C33
- From: Glen Herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Thu, 26 Feb 2009 22:18:37 -0700
pnachtwey wrote:
On Feb 26, 10:04 pm, pnachtwey <pnacht...@xxxxxxxxx> wrote:
(big snip)I need a fast cube root routine.
I didn't consider that one because of the mod operator and too many
divides. The polynomial isn't a problem because all the instructions
are 1 clock cycle and just a few multiply and adds but there is no
divide or mod instruction on a TI C33 so they are expensive. The ldexp
() and frexp() functions aren't that cheap either.
I didn't look at the specific routine, but the most important
part should be dividing the unbiased exponent by three.
(That can be done with a fixed point multiply by something
close to 1/3.) If the C33 floating point is like some of the
other TI DSPs it is a little unusual, but it shouldn't be so hard
to get the exponent out. Maybe extract the exponent bits then
use a lookup table to find a multiplier. Multiply by the
appropriate table entry and then start Newton-Raphson.
The better the initial guess the faster it converges.
I was hoping someone knows a variation of this that works on a TI C33.
unsigned int* p = (unsigned int *) &f;
*p = *p/3 + 709921077;
This is mean and lean.
I think that even the generic nth root modified to work on the TI C33
and an extra iteration is a better option. I just need to avoid
divides.
-- glen
.
- References:
- Fast Cube Root Using C33
- From: pnachtwey
- Re: Fast Cube Root Using C33
- From: cincydsp
- Re: Fast Cube Root Using C33
- From: pnachtwey
- Fast Cube Root Using C33
- Prev by Date: Re: What waveform[s] do[es] EDT's FSK use?
- Next by Date: Re: What waveform[s] do[es] EDT's FSK use?
- Previous by thread: Re: Fast Cube Root Using C33
- Next by thread: Re: Fast Cube Root Using C33
- Index(es):
Relevant Pages
|