flopscope.

flopscope.accounting.polyval_cost

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

Cost for polyval: Horner's method under FMA=2 textbook convention.

Per coefficient: 1 multiply + 1 add (FMA=2). m output cells, deg coefficients. Returns 2 * m * deg FLOPs.

Parameters

deg:int

Argument forwarded to the analytical polyval cost formula.

m:int

Number of rows in the input matrix.

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.