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

Improve mul_rev #28

Closed
dpsanders opened this issue Jun 11, 2019 · 1 comment · Fixed by #29
Closed

Improve mul_rev #28

dpsanders opened this issue Jun 11, 2019 · 1 comment · Fixed by #29

Comments

@dpsanders
Copy link
Member

dpsanders commented Jun 11, 2019

Consider the following example from Hickey 1997 (in the notation of this package):

julia> x = -1..5
[-1, 5]

julia> y = -1..1
[-1, 1]

julia> z = 2..10
[2, 10]

julia> result = mul_rev(z, x, y)
([2, 10], [-1, 5], [-1, 1])

However, in fact it's possible to show that the result for x and y should be

(2..10, 0.4..1, 2..5)

(and z should be 2..5).

This can be obtained by splitting up x and y into positive and negative parts and then taking the hull:

julia> x .∩ extended_div(z, y)
(∅, [2, 5])

julia> union( (x .∩ extended_div(z, y))...)
[2, 5]

julia> union( (y .∩ extended_div(z, x))...)
[0.4, 1]
@dpsanders
Copy link
Member Author

dpsanders commented Jun 11, 2019

According to Hickey, it's necessary to separate out 0 for separate treatment.?

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 a pull request may close this issue.

1 participant