Closed caseykneale closed 4 years ago
There is something strange happening here. Adding a small tolerance gives a result:
julia> @time rts = roots(fun, Interval( -10..10 ), 1e-8)
0.001795 seconds (24.34 k allocations: 997.430 KiB)
7-element Array{Root{Interval{Float64}},1}:
Root([1, 1.00001], :unknown)
Root([1, 1.00001], :unknown)
Root([1, 1.00001], :unknown)
Root([0.999999, 1.00001], :unknown)
Root([0.999999, 1], :unknown)
Root([0.999999, 1], :unknown)
Root([0.999999, 1], :unknown)
but without the tolerance it does seem to hang.
BTW, note that -10..10
already makes an interval -- you don't need Interval
as well.
The default tolerance is far too low.
The fact that it is reporting several boxes with apparently the same interval (although this is just due to the default output precision, which can be changed with @format
) is exactly due to the face that the function has a double root, which interval methods are not able to prove.
I think this works as expected, the number of intervals around 1 with undecidable status that you can build with 1e-15 tolerance is simply too high, thus decreasing the tolerance seems to be the correct fix.
We should maybe use relative tolerance by default to get a more consistent behavior.
Thanks!
Sorry this is a repost from a different repository. Was trying this package out and found a weird simple case that appears to run forever?
Am I missing something? Why does this happen?