Fast computation of $x^{1/p}$, where $x\in\mathbb{R}^+$ and $p=2^{n}$, where $n\in\mathbb{N}$ with bit shifts?

77 Views Asked by At

There is plenty of literature regarding the legendary Fast inverse square root routine from Quake, but can we do something similar to compute $x^{1/p}$ as given in the title?

Given that $p$ is a power of 2, there should be some clever trick using bit shifts to achieve this.

1

There are 1 best solutions below

0
On

Is known, that $y^{\large 2^{\Large p}}$ can be calculated by $p$ multiplication operations. Besides, is not a problem to calculate the MSB position of the result $y=x^{\large\frac1{\large 2^p}}.$

This allows to get the result y, bit after bit, over $pM$ multiplications, where $M$ is a quantity of bits of the result.