What is the correct way to call polynomial_evaluate?
I am trying to follow this code from Mojo 24.2 in Mojo 24.5: Newton-Raphson but I get the error:
Here's is a relevant snippet of the code:
invalid call to 'polynomial_evaluate': failed to infer parameter #0. Here's is a relevant snippet of the code:
from math.polynomial import polynomial_evaluate
from math import ulp
alias dtype = DType.float64
alias width = simdwidthofdtype
alias coeff = List[Scalar[dtype]](-6, 3, -2, 1)
alias deriv_coeff = List[Scalar[dtype]](3, -4, 3)
def f(x: Float64) -> Float64:
return polynomial_evaluatedtype, 1, coeff
This will be your example-driven guide to Mojo SDK 24.2, as part of the latest MAX release. If I had to pick a name for this release, I’d call it MAXimum
Mojo
Momentum
because there is so much much good stuff in this release, particularly for Python developers, adopting Mojo.

