Nemo.jl
Nemo.jl copied to clipboard
Implement is_squarefree for QQ/ZZPolyRingElem
Cleaning out old branches; I made this last November, not sure why I never submitted. The new methods replace generic code, so this is purely about making things a bit faster.
Before:
julia> S, y = polynomial_ring(QQ, "y")
(Univariate polynomial ring in y over QQ, y)
julia> @btime is_squarefree(2*y^2)
522.349 ns (14 allocations: 576 bytes)
false
After:
julia> S, y = polynomial_ring(QQ, "y")
(Univariate polynomial ring in y over QQ, y)
julia> @btime is_squarefree(2*y^2)
151.743 ns (4 allocations: 176 bytes)
false