flopscope.

flopscope.accounting.polydiv_cost

flopscope.accounting.polydiv_cost(n1, n2)[flopscope source]

Cost for polydiv: 1 + Q*(2*n2 + 1), Q = max(n1-n2+1, 0) (work scales with

quotient length: per step 1 scale-divide + n2 mul + n2 sub).

Parameters

n1:int

Argument forwarded to the analytical polydiv cost formula.

n2:int

Argument forwarded to the analytical polydiv cost formula.

Returns

:int

Weighted public cost estimate, floored to match runtime accounting.

Notes

This helper multiplies the analytical FLOP count by the active weight from flopscope._weights and then applies int(...) so public estimates match budget deductions.