Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 1.0-dev #533 +/- ##
===========================================
+ Coverage 85.44% 85.58% +0.13%
===========================================
Files 34 34
Lines 1814 1831 +17
===========================================
+ Hits 1550 1567 +17
Misses 264 264 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
What differences? I think nthroot and |
|
I agree with the comment, indeed, they should behave the same. Yet, we are speaking about the power function, which means the possibility to different interpretations related to the actual julia> nthroot( -27 .. 27, 3)
[-3, 3]
julia> (-27 .. 27)^(1//3)
[0, 3]This PR doesn't (yet) address these differences, but tries to ensure that the results are the same when they should be. |
|
Very good example! Now I actually think they should not be the same, as they have different domains and codomains. This is also highlighted comparing the definition of |
|
Thanks for pointing out those tables; I'll check them. I also think that we can now reduce the code duplication. |
260b4eb to
e99f547
Compare
|
This should fix the problems in JuliaIntervals/IntervalContractors.jl#55; once this is merged to 1.0-dev branch, tests should pass there... |
lucaferranti
left a comment
There was a problem hiding this comment.
@lbenet in general LGTM. I left two very minor comments.
As a more general comment, have you looked at the current tests for nthroot and rational power? Are there some corner cases which this PR fixes that should be added to the tests?
I checked in IntervalContractors and with this branch there are "only" 233 broken tests in pow_rev, which are presumably some tricky cases.
Could you tell me which tests are still not passing? I admit that I did not checked where are the broken tests, though I saw the 233... |
The ones marked as |
but that's very likely to be an inssue in function pow_rev1(b, c, x) # c = x^b
return x ∩ c^(1/b)
end
function pow_rev2(a, c, x) # c = a^x
return x ∩ (log(c) / log(a))
endmy point simply being that this PR can be merged with clean consciousness even if tests in IntervalContractors still fail |
I agree to merge this, at least to make it easier to see what's going on in IntervalContractors... Incidentally, I did not touch |
|
Going ahead and merging! |
The idea behind this PR is to get the same results for
a^(1//n)andnthroot(a, n)forn::Integer, when the comparison makes sense (there are small differences, which are related toa). This allows to pass a bunch of tests inIntervalContractors.jl, after some tweeks (see JuliaIntervals/IntervalContractors.jl#55).