News for hackers. Stuff that matters.
Re:Revisiting the Fast Inverse Square Root – Is It Still Use... by bee_rider on Thursday April 20, 2023 @08:27PM (#35648368)
This is totally off the cuff, but if you were using a pair of doubles like that, you’d essentially need to represent these new operations with numerical algorithms on the pair of doubles, right? So the algorithms would presumably need to deal with the last bit being a bit dodgy at times, right?
Re:Revisiting the Fast Inverse Square Root – Is It Still Use... by pclmulqdq on Thursday April 20, 2023 @10:45PM (#35649224)
With appropriate rounding modes, the basic operations (+, -, *) are fairly short code sequences. Things like exp and 1/x can become adventures, but they're not too bad.
Re:Revisiting the Fast Inverse Square Root – Is It Still Use... by stephencanon on Friday April 21, 2023 @07:43PM (#35661725)
Division is actually pretty straightforward: compute a residual using the multiply-add that you already have, divide _that_, and then add it to the quotient.

Or (roughly equivalently, but maybe easier to understand) do a native double division, then do a Newton-Raphson step, which requires only multiplication and addition (just like you would refine a reciprocal estimate).