JuliaAlgebra / MultivariatePolynomials.jl

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

Substitution with BigFloats #302

Closed chkat closed 1 month ago

chkat commented 1 month ago

Hi, I am experiencing an issue with the latest version when I evaluate a polynomial with BigFloat coefficients at another BigFloat. I isolated a simple example that shows that I get different results if I set the variable c to Float64(0) or BigFloat(0).

julia> using DynamicPolynomials

julia> @polyvar a b c
(a, b, c)

julia> F = BigFloat(5)*a*b*c + BigFloat(1)*a*b^2
5.0abc + ab²

julia> DynamicPolynomials.subs(F, c=>BigFloat(0))
0.0

julia> DynamicPolynomials.subs(F, c=>0.0)
ab²

On the contrary, for the version 0.4.6 of the package I get in both cases ab² as a result. Are operations with BigFloats not supported ?

Thanks !

blegat commented 1 month ago

Thanks for reporting this, should be fixed by https://github.com/JuliaAlgebra/MultivariatePolynomials.jl/pull/303