There was an error while loading. Please reload this page.
1 parent 8f4c8f4 commit d1a5b6aCopy full SHA for d1a5b6a
1 file changed
src/roots.jl
@@ -87,6 +87,7 @@ to `5eps` where `eps` is the precision of `c`.
87
"""
88
function roots(c::ChebPoly{1,<:Real}; tol::Real=5*epsvals(c.coefs), maxsize::Integer=50)
89
tol > 0 || throw(ArgumentError("tolerance $tol for truncating coefficients must be > 0"))
90
+ maxsize > 0 || throw(ArgumentError("maxsize $maxsize must be > 0"))
91
abstol = sum(abs, c.coefs) * tol # absolute tolerance = L1 norm * tol
92
n = something(findlast(c -> abs(c) ≥ abstol, c.coefs), 1)
93
if n <= maxsize
0 commit comments