-
Notifications
You must be signed in to change notification settings - Fork 10
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
fixed bugs towards ITF1788 compliance #49
fixed bugs towards ITF1788 compliance #49
Conversation
* fixed typo in po_rev2 * fixed power_rev for exponent zero integer * added support for decorated intervals * added methods with one less parameter with x=R * fixed cosh_rev * added mul_rev_to_pair * added tests from ITF1788 test suite
@lbenet most ITF1788 tests were failing for reverse functions, this PR fixes most of them. The remaining one are other tedious (rev_pow, there's a whole phd dissertation on how to compute that) or probably difficult (power_rev in some cases returns slightly wider results). I suggest to merge this now and track the remaining issues in an issue for later. (As I briefly mentioned yesterday, I think going through rev_pow and implement it could be a suitable project for an undergrad with some interest in interval methods) |
remaining things to do tracked in #48 |
@lucaferranti I'll try to find some space this afternoon to review this PR; today I have a very busy morning... Aside from that, wouldn't this be better in IntervalAithmetic.jl package, precisely for compliance with the standard? This package at the end relies on IA, so there is no new dependency. |
I don't have an opinion about whether the reverse functions should be here or in IA, from a standard compliance it may make more sense to have those in IA. Alternatively, one can sell ValidatedNumerics as "the" package. One thing that could be nice to do in this package is to define a common contractor interface for both IntervalRootFinding.jl and IntervalConstraintProgramming, e.g. currently both packages export I think @dpsanders had some reasons to have reverse functions in a separate package? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've left essentially two comments:
- one related to the generation of the rev functions when the last interval argument omitted (is optional), which I think should include all the fnctions in the compacted code
- one (actually two) related with the docstrings
Since this PR impacts (I think) JuliaIntervals/IntervalArithmetic.jl#505, I suggest to take into account the first comment and merge this PR, and leave the second comment to another PR. Once said this, apart from that comment, LGTM.
src/arithmetic.jl
Outdated
""" | ||
Reverse power | ||
""" | ||
function power_rev(a::Interval, b::Interval, n::Integer) # a = b^n, log(a) = n.log(b), b = a^(1/n) | ||
function power_rev(a::Interval{T}, b::Interval{T}, n::Integer) where T # a = b^n, log(a) = n.log(b), b = a^(1/n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since there are various "powRev" functions specified in the standard (cf. Sect 10.5.4 and Table 10.1), it's important to have very descriptive docstrings, in this case, of the specific function in the standard, or the differences with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this comment applies to other functions...
* fixed typo in po_rev2 * fixed power_rev for exponent zero integer * added support for decorated intervals * added methods with one less parameter with x=R * fixed cosh_rev * added mul_rev_to_pair * added tests from ITF1788 test suite
@lbenet I've updated some docstrings (the three for powers to disambiguate and a few more), if you think the template is good, I can add to the others too (maybe in a separate PR, if the idea was to merge this before the other PR in IntervalArithmetic.jl). I didn't quite understand your other comment, the |
In view of JuliaIntervals/IntervalArithmetic.jl#271, my only suggestion is to add the reference section of the standard where the rev functions are described; I think this is Sect 10.5.4 and Table 10.1. But this can be included in a separated PR. |
@lbenet apologies for my delay in coming back to this. I have now clarified the docstrings for the functions with reference to the standard. Let me know if you want me to do other changes, otherwise once this is merged I can update JuliaIntervals/IntervalArithmetic.jl#505 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! In another PR we may add more descriptive docstrings (with regards to all rev functions and their mention in the standard). Thanks a lot!
Please, go ahead and merge this! |
remaining issues
ieeep1788_rev.itl
33 tests failing withmul_rev_IEEE1788
, but haven't had time to look at those yetpow_rev.itl