in my recent work I got a Problem: Sqrt for values bigger than 32 Bit.
Just shifting right with a hard coded number of Bits is not a good idea, since there may be small Values observed, too.
I want to share my solution I came up with.
What the design does:
- Check which set bit's number is the most significant
- Shift dynamically to the right -> "Anti fractional Bits", they have to be an even number, as the sqrt operation divides them by two
- Perform the sqrt operation on the shifted value
- Shift left by the "Anti fractional Bits" divided by two
- High precision
- Extremely Expensive
It's just like the poor man's floating point
Please feel free to comment - maybe there is some ability to improve this.