Open PeterARBork opened 4 months ago
Yep that's a bug. It is probably due to an assumption that fails because tan
is not continuous (and diverges).
The branch IA_v0.22
(work in progress to update to the latest IntervalArithmetic which is more careful with those cases), has the correct behavior:
julia> roots(tan, interval(-1, 10))
7-element Vector{Root{Interval{Float64}}}:
Root(Interval{Float64}(-5.9220971777070724e-8, 4.47088230066256e-9, com, NG), :unique)
Root(Interval{Float64}(1.570796246929277, 1.5707963269211673, com), :unknown)
Root(Interval{Float64}(3.141592653589474, 3.141592653589817, com, NG), :unique)
Root(Interval{Float64}(4.712388946492333, 4.712389022821055, com), :unknown)
Root(Interval{Float64}(6.283185307098206, 6.28318530826717, com, NG), :unique)
Root(Interval{Float64}(7.85398162069253, 7.853981705843563, com), :unknown)
Root(Interval{Float64}(9.42477796076779, 9.424777960769498, com, NG), :unique)
There are extra roots because there is no way currently to prove that there is no zero at the singularities.
I expected roots to find all the roots of the tangent function in the simple case below, but it doesn't. The roots should be $n \pi$ with $n$ an integer.
find_zeros finds too many
Am I missing something?