Skip to content
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

#961 - Make low/high of Interval faster #971

Merged
merged 2 commits into from
Jan 8, 2019
Merged

#961 - Make low/high of Interval faster #971

merged 2 commits into from
Jan 8, 2019

Conversation

mforets
Copy link
Member

@mforets mforets commented Jan 6, 2019

Closes #961.

Let

julia> using LazySets, BenchmarkTools

julia> x = Interval(0.9, 1.1)
Interval{Float64,IntervalArithmetic.Interval{Float64}}([0.9, 1.10001])

Master:

julia> @btime low($x)
  97.383 ns (3 allocations: 288 bytes)

1-element Array{Float64,1}:
 0.8999999999999999

This branch:

julia> @btime low($x)
 28.365 ns (1 allocation: 96 bytes)
1-element Array{Float64,1}:
0.9

Copy link
Member

@schillic schillic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, you also found a floating-point issue here 👍

src/Interval.jl Show resolved Hide resolved
@mforets mforets merged commit ef74e0a into master Jan 8, 2019
@mforets mforets deleted the mforets/961 branch January 8, 2019 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants