-
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
Merged
lucaferranti
merged 11 commits into
JuliaIntervals:master
from
lucaferranti:lf/1788-compliance
Feb 4, 2022
Merged
Changes from 2 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
44413c5
fixed bugs towards ITF1788 compliance
lucaferranti b6e90d5
fix mul_rev_IEEE
lucaferranti 5251d81
bump IA version (#50)
lucaferranti 6babeac
Update Project.toml (#51)
lucaferranti 75ab7c5
fixed bugs towards ITF1788 compliance
lucaferranti 8068bab
fix mul_rev_IEEE
lucaferranti 4371384
added docstrings for power_rev, pow_rev1, pow_rev2
lucaferranti f3f0884
updated tests
lucaferranti 959e789
fixed conflicts
lucaferranti 6c59f1b
updated docstrings
lucaferranti 3d5bc23
updated CI
lucaferranti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
entiredecorated(T) = DecoratedInterval(entireinterval(T)) | ||
|
||
for op in (:sqr_rev, :abs_rev, :sin_rev, :cos_rev, :tan_rev, :cosh_rev, :sinh_rev, :tanh_rev) | ||
lbenet marked this conversation as resolved.
Show resolved
Hide resolved
|
||
@eval begin | ||
function $op(a::DecoratedInterval{T}, x::DecoratedInterval{T}) where T | ||
( isnai(a) || isnai(x) ) && return nai(T) | ||
bare = $op(interval(a), interval(x)) | ||
return (DecoratedInterval(bare[1], trv), DecoratedInterval(bare[2], trv)) | ||
end | ||
end | ||
@eval $op(a::Interval{T}) where T = $op(a, entireinterval(T)) | ||
@eval $op(a::DecoratedInterval{T}) where T = $op(a, entiredecorated(T)) | ||
end | ||
|
||
function power_rev(a::DecoratedInterval{T}, x::DecoratedInterval{T}, n::Integer) where T | ||
( isnai(a) || isnai(x) ) && return nai(T) | ||
bare = power_rev(interval(a), interval(x), n) | ||
return (DecoratedInterval(bare[1], trv), DecoratedInterval(bare[2], trv), n) | ||
end | ||
|
||
power_rev(a::DecoratedInterval{T}, n::Integer) where T = power_rev(a, entiredecorated(T), n) | ||
|
||
for op in (:mul_rev_IEEE1788, :pow_rev1, :pow_rev2) | ||
@eval begin | ||
function $op(b::DecoratedInterval{T}, c::DecoratedInterval{T}, x::DecoratedInterval{T}) where T | ||
(isnai(b) || isnai(c) || isnai(x) ) && return nai(T) | ||
bare = $op(interval(b), interval(c), interval(x)) | ||
return DecoratedInterval(bare, trv) | ||
end | ||
end | ||
|
||
@eval $op(a::Interval{T}, b::Interval{T}) where T = $op(a, b, entireinterval(T)) | ||
@eval $op(a::DecoratedInterval{T}, b::DecoratedInterval{T}) where T = $op(a, b, entiredecorated(T)) | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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...