reth::primitives::revm_primitives::alloy_primitives::ruint::algorithms::div

Function reciprocal_2

pub fn reciprocal_2(d: u128) -> u64
Expand description

⚠️ Computes $\floor{\frac{2^{192} - 1}{\mathsf{d}}} - 2^{64}$.

Requires $\mathsf{d} ∈ [2^{127}, 2^{128})$, i.e. the most significant bit of $\mathsf{d}$ must be set.

Implements MG10 algorithm 6.