-
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
Speed up pow by 4x or more #210
Conversation
Codecov Report
@@ Coverage Diff @@
## master #210 +/- ##
=========================================
Coverage ? 96.66%
=========================================
Files ? 23
Lines ? 990
Branches ? 0
=========================================
Hits ? 957
Misses ? 33
Partials ? 0
Continue to review full report at Codecov.
|
Tests will fail until |
I've taken a look on this PR, and must begin saying that I understand the motivation, but I am not yet convinced that we should sacrifice tightness for speed; see #14. As it was discussed in #103, current Regarding the infimum and supremum of an empty interval, see this comment; we are currently following the standard on this, so this shouldn't be changed. Reverting the changes (here and here) in arithmetic.jl allows some tests to pass. Very nice tricks for |
The fast version of The fast powers in this PR give a result that is "almost" as tight as the terribly slow correctly-rounded version - for higher powers they will be less tight, since more squarings are required. In particular, squares ( I really think it's urgent that we make this change. Tight powers will still be available via |
I have been using fast powers for a few months now. |
545fd8c
to
cf5eae9
Compare
Tests are failing; I guess those that fail are related to |
Yes, exactly. |
That will require changes to itf1788. I think I have those in a branch somewhere. |
I guess the same holds; instead of using |
Is there a chance of getting this function in |
It is already there with the name |
I thought this branch gives a faster |
.. so if that's the case i was just proposing to export the "fast" version, possibly with a different name, keeping the slow one as default. |
I get this on master: julia> using BenchmarkTools, IntervalArithmetic
[ Info: Precompiling IntervalArithmetic [d1acc4aa-44c8-5952-acd4-ba5d80a2a253]
julia> @btime $(Ref(X))[]^2^C
julia> X = 0..1
[0, 1]
julia> @btime $(Ref(X))[]^2
673.264 ns (29 allocations: 1.25 KiB)
[0, 1]
julia> @btime pow($(Ref(X))[], 2)
30.811 ns (0 allocations: 0 bytes)
[0, 1] But yes you're right, the |
Oh, i see what you mean know. I was missing that there's already a difference between
Alright, i will keep it in mind. Thanks! |
We should definitely update |
I agree with @mforets that this should be in master with another name ( @dpsanders Do you have time to address the conflicts with the files currently in master? |
Yes we should definitely incorporate the latest version into base in the |
Solved in PR #593. |
No description provided.