JuliaAlgebra / MultivariatePolynomials.jl

Multivariate polynomials interface
https://juliaalgebra.github.io/MultivariatePolynomials.jl/stable/
Other
135 stars 27 forks source link

Repeated differentiation is not type stable #229

Open harris-mit opened 1 year ago

harris-mit commented 1 year ago

The function

function differentiate(p, x, deg::Val{N}) where N
...
end

is not type stable because sometimes it throws an error. Should this be changed to the following?

function differentiate(p, x, deg::Val{N}) where N
    for i = 1:deg
        p = differentiate(p, x)
    end
    return p
end