Closed Calvin-L closed 6 years ago
There are roughly three "prongs" here:
max
were replaced with +
. This makes the code easier to read and probably more correct.if res.exponent == 0
check at the end of asymptotic_cost
). This essentially says "I see all constant-time expressions as identical; let other parts of the cost model differentiate these."
This changeset makes
asymptotic_runtime
a lot more precise without sacrificing much speed. Instead of returning an int, it now returns aDominantTerm
that captures the constant factor and exponent of the worst-case runtime.