A more sensible way to code this would be

def apply_polynomial( deriv, x ):

sum = deriv[0]

div=1

xpow=1

for i from 1 to length( deriv ):

div*=i

xpow*=x

sum += deriv[i] * xpow / div

return sum

Its about as fast as the second, nearly as readable as the first, and works on any poly. (except the zero poly symbolized by the empty list. )

The bit about the tradeoffs is correct as far as I can tell.

Although if a single solution was by far the best under every metric, there wouldn’t be any tradeoffs.

In most real cases, the solution space is large, and there are many metrics. This means that its unusual for one solution to be the best by all of them. And in those situations, you might not see a choice at all.

Your right. I did some python. My version took 1.26, yours 0.78 microseconds. My code is just another point on the Pareto boundary.