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

Error when trying to get domain for sqrt function #431

Closed
JulienDamers opened this issue Dec 19, 2019 · 2 comments
Closed

Error when trying to get domain for sqrt function #431

JulienDamers opened this issue Dec 19, 2019 · 2 comments
Assignees
Labels

Comments

@JulienDamers
Copy link

I tried to implement a function that checks if a box belongs to the domain of a function.

Using the following code I noticed unexpected results with the square root function.

Function f("x","y","(sqrt(x+y))");
Interval y(0,0);
CtcFwdBwd ctc(f,y);

IntervalVector x(2);
x.init(Interval(-5,0));
ctc.contract(x);
cout << "x " << x << endl;

Output:

x ([-5, 0] ; [-5, 0])

The result I expected here was x (<0, 0> ; <0, 0>). Is there anything wrong in my test?

I tried with various values for the constraint y and here are the different outputs.

Test 1:

Interval y(0,ibex::next_float(0));

output

x (<-0, 0> ; <-0, 0>)

Test 2:

Interval y(ibex::next_float(0),ibex::next_float(0));

output

x empty vector

Test 3:

Interval y(ibex::previous_float(0),0);

output

x (<-0, 0> ; <-0, 0>)

Test 4:

Interval y(ibex::previous_float(0),ibex::previous_float(0));

output

x empty vector
@JulienDamers
Copy link
Author

I forgot to mention, I am using ibex version 2.8.2.

@gchabert
Copy link
Contributor

gchabert commented Jan 2, 2020

Yes, I never noticed that. Thanks for reporting the issue.
It will be fixed in the next release.
Gilles

@gchabert gchabert self-assigned this Jan 2, 2020
@gchabert gchabert added the bug label Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants