acvm::pwg::arithmetic

Function quick_invert

Source
fn quick_invert<F: AcirField>(numerator: F, denominator: F) -> F
Expand description

A wrapper around field division which skips the inversion if the denominator is ±1.

Field inversion is the most significant cost of solving Opcode::AssertZero opcodes, which we can avoid when the denominator is ±1.