flopscope.

flopscope.accounting.polyfit_cost

flopscope.accounting.polyfit_cost(m, deg)[flopscope source]

Cost for polyfit: 2 * m * (deg+1)^2 FLOPs.

Parameters

m:int

Number of rows in the input matrix.

deg:int

Argument forwarded to the analytical polyfit 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.