fn goldschmidt<F, I>(r_u0: I, s_u2: I, count: u32, final_set: bool) -> (I, I)
Expand description
Perform count
goldschmidt iterations, returning (r_u0, s_u?)
.
r_u0
is the reciprocalr ~ 1 / sqrt(m)
, as U0.s_u2
is the square root,s ~ sqrt(m)
, as U2.count
is the number of iterations to perform.final_set
should be true if this is the last round (same-sized integer). If so, the returneds
will be U3, for later shifting. Otherwise, the returneds
is U2.
Note that performance relies on the optimizer being able to unroll these loops (reasonably
trivial, count
is a constant when called).