flopscope.accounting.polyder_cost
flopscope.accounting.polyder_cost(n, m=1)[flopscope source]
Cost for polyder: one multiply per surviving coefficient per derivative step.
sum_{j=1..m} max(n-j, 0) = t*n - t*(t+1)//2 with t = min(m, n-1).
Parameters
- n:int
Number of columns in the input matrix.
- m:int, optional
Number of rows in the input matrix. Defaults to
1.
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.