-
Notifications
You must be signed in to change notification settings - Fork 71
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
Powers of rational intervals #515
Comments
The reason for this seems to be that if picks some fallback case from base (which uses power by squaring) julia> a = interval(-1//1, 1//1)
[-1//1, 1//1]
julia> a ^ 2
[-1//1, 1//1]
julia> @which a ^ 2
^(x::Number, p::Integer) in Base at intfuncs.jl:291
julia> b = interval(-1, 1)
[-1, 1]
julia> b ^ 2
[0, 1]
julia> @which b ^ 2
^(a::Interval{Float64}, x::Integer) in IntervalArithmetic at /home/lferrant/.julia/packages/IntervalArithmetic/997vH/src/intervals/functions.jl:10 I guess this could be fixed by updating the type signature |
Has there been any update on this? I am hitting this issue as well. |
@schillic @agerlach |
I guess rational intervals can be useful for symbolical computations. Sure they are restricted to only rational operations, but that is probably enough for several applications (think e.g. matrix power). Side note, we could always define const FloatOrRat = Union{AbstractFloat, Rational} and have struct Interval{T <: FloatOrRat} <: Real # to reflect how it is now, does not imply I agree it should be suptype of Real :P
low::T
high::T
end this would allow to keep rational and floats and avoid stack overflow issues we had in the past |
I am not really using it. We just test our functionality also with |
I was using it to validate a manually derived interval remainder for a Taylor model. I was getting much wider intervals numerically and wanted to test with rationals to quantify the effects due to round-off vs truncation. |
|
That definitely sounds useful! Thanks for chiming in.
Seems like a good idea.
You are absolutely right. Side note: |
Is the following expected?
The text was updated successfully, but these errors were encountered: