hi all,
I need to divide two numbers by the same value (all fixed-point). It is obvious that doing the inversion first and then applying it twice is faster than two division. So this is my current code (BITS=8)
Yet, i'd need to speed this up more since this routine is called quite often in my code.
Does anybody know a fast (accuracy is important) inversion routine (1/value)?
thx,
Daniel
I need to divide two numbers by the same value (all fixed-point). It is obvious that doing the inversion first and then applying it twice is faster than two division. So this is my current code (BITS=8)
- Code:
I64 rev = ((I64)1<<(BITS+32))/h;
x = (I32)((hx*rev)>>32);
y = (I32)((hy*rev)>>32);
Yet, i'd need to speed this up more since this routine is called quite often in my code.
Does anybody know a fast (accuracy is important) inversion routine (1/value)?
thx,
Daniel