Re: Fast Cube Root Using C33



pnachtwey wrote:

On Feb 26, 10:04 pm, pnachtwey <pnacht...@xxxxxxxxx> wrote:

I need a fast cube root routine.
(big snip)

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

.



Relevant Pages

  • Re: A Formula for Pi
    ... alternating series. ... rule out R because of its sqrtmultiplier. ... computing one term of R is as expensive as computing several ... No divides. ...
    (sci.math)
  • Re: Dealing with ad hominem attacks in comp.programming
    ... values in the machine and relying on the compiler to do units analysis. ... (these are again compile time entities in quan) ... divide it by 10 and bump the exponent up 1 and vice versa. ... For si quantities eg millimeters, kilometers etc, the multiplier is ...
    (comp.programming)
  • Re: Different Implementations of VLIW .
    ... reflection of the fact that memory access is simply too dicey and ... Since they were implementing conventional instructions, ... output from the multiplier to an input of the adder, ... So instead of simply executing a single- ...
    (comp.arch)
  • Re: truncate 20 bits to 10 bits
    ... I have a multiplier that multiplies 2 floating point numbers with 7 ... bits exponent and 10 bits mantissa.so its output has 7 bits exponent ... to MS SQL Server group or AutoCAD group, ...
    (comp.databases.oracle.server)
  • Re: Implementation of pop count instruction
    ... | Assume you have a 64 x 64 bit integer multiplier, ... [Root and Mann]): ... These ten instructions, with constants extended, would work on ... word lengths up to 62.; ...
    (comp.arch)