The package provides the unexported function FastPolynomialRoots.rootsFastPolynomialRoots(p::Vector{<:Union{Float64,Complex{Float64}}})
which computes the roots of the polynomial p[1] + p[2]*x + p[3]*x^2 + ... + p[k]*x^(k-1). The package also overwrites the roots(::Polynomial) methods in the Polynomials package for Float64 and Complex{Float64} elements with the fast versions provided by this package. See the examples below.

A computation of this size would not be feasible on a desktop with the traditional method
but can be handled by FastPolynomialRoots.

julia>using Polynomials, BenchmarkTools, FastPolynomialRoots
julia> n =10000;
julia> r =@btimeroots(p) setup=(p =Polynomial(randn(n +1)));
10.290 s (13 allocations:508.38 KiB)
julia>sum(isreal, r)
7
julia>2/π*log(n) +0.6257358072+2/(n*π) # Edelman and Kostlan6.489284260212659

Julia Packages

This website serves as a package browsing tool for the Julia programming language. It works by aggregating various sources on Github to help you find your next package.