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

exp(x::MC) contains NaNs when x is degenerate #60

Closed
StevenChui88 opened this issue Jul 6, 2023 · 1 comment · Fixed by #61
Closed

exp(x::MC) contains NaNs when x is degenerate #60

StevenChui88 opened this issue Jul 6, 2023 · 1 comment · Fixed by #61

Comments

@StevenChui88
Copy link

I am a summer undergraduate research assistant working with Dr. Kamil Khan. We found that the concave relaxation of exp(x::MC) seems to be computed as NaN when x is degenerate. Presumably this is because of division by 0 in the secant formula in the concave relaxation of exp.

Example (using Julia v1.9.2 and McCormick.jl v0.13.4):

julia> using McCormick

julia> x = MC{1,NS}(2.0)
MC{1, NS}(2.0, 2.0, [2, 2], [0.0], [0.0], true)

julia> exp(x)
MC{1, NS}(7.38905609893065, NaN, [7.38905, 7.38906], [0.0], [NaN], true)

julia> exp(x).cc
NaN
@DimitriAlston DimitriAlston linked a pull request Jul 12, 2023 that will close this issue
@DimitriAlston
Copy link
Member

DimitriAlston commented Jul 12, 2023

Hey @StevenChui88. Apologies for the delayed response.

Thank you for pointing this out. We have made a change to the master branch that should address this issue.
Previously, McCormick checked the difference between the exp of the interval rather than the difference between the interval itself and this led to additional floating-point operations which essentially ignored the degeneracy.
We plan to look into the use of outward-rounded intervals in the future as a more extensive change.

There are a few other changes we have planned before we tag another release, so keep an eye out.

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.

2 participants