-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Graceful handling of infinity #161
Comments
I don't have anything to contribute with in terms of solutions, but as a user, being able to check from -Inf to Inf is what I actually want to do most of the time, and so this would be a great feature. |
For the record, the current behaviour gives the following julia> roots(x -> x^2 - x, -Inf..Inf)
4-element Vector{Root{Interval{Float64}}}:
Root([-1.28998e-14, 1.22107e-14]_dac_NG, :unique)
Root([0.999999, 1.00001]_dac_NG, :unique)
Root([1.79769e+308, 1.7977e+308]_dac_NG, :unknown)
Root([1.79769e+308, 1.7977e+308]_dac_NG, :unknown) which seems fair. However, there is a discrepancy with roots(x -> x^2 - x, big(-Inf..Inf)) hangs... |
Well, since we are going to the last representable number, it may take some time for julia> prevfloat(typemax(Float64))
1.7976931348623157e308
julia> prevfloat(typemax(BigFloat))
5.875653789111587590936911998878442589938516392745498308333779606469323584389875e+1388255822130839282 I am tempted to say that this is a user issue, as the maximum number of iteration can now be set julia> roots(x -> x^2 - x, big(-Inf..Inf) ; max_iteration = 1000000)
3-element Vector{Root{Interval{BigFloat}}}:
Root([5.87565e+1388255822130839282, 5.87566e+1388255822130839282]₂₅₆_dac_NG, :unknown)
Root([5.87565e+1388255822130839282, 5.87566e+1388255822130839282]₂₅₆_dac_NG, :unknown)
Root([-2.84502e+1388255822130688854, 8.65093e+1388255822130688854]₂₅₆_dac, :unknown) Of course, |
Yes, I agree, I think this can be closed then. |
Currently the following hangs in an infinite calculation:
since it cannot prove that it can exclude the regions at infinity.
We should explicitly check for infinite intervals and stop bisecting at some point, say when the result is above
1e200
.The text was updated successfully, but these errors were encountered: