Function next_guess

Source
fn next_guess<I>(x_uq0: I, b_uq1: I) -> I
where I: Int + HInt, <I as HInt>::D: Shr<u32, Output = <I as HInt>::D>,
Expand description

Perform one iteration at any width to approach 1/b, given previous guess x. Returns the next x as a UQ0 number.

This is the x_{n+1} = 2*x_n - b*x_n^2 algorithm, implemented as x_n * (2 - b*x_n). It uses widening multiplication to calculate the result with necessary precision.