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

ibex::System generates different results when declared globally vs locally #358

Closed
joshpunb opened this issue Feb 28, 2019 · 2 comments
Closed

Comments

@joshpunb
Copy link

When declaring an ibex::System locally or globally with the same minibex file, the resulting systems are not equivalent. The locally declared system is correct and the globally declared system is incorrect. It seems that the predefined interval constant pi disappears from the constraints in the globally declared system.

As an example, the following program produces two non-equal systems:

#include "ibex.h"

ibex::System system_shoulder_axial_global("minibex/system_test.mbx");

int main(int argc, char** argv) {

	ibex::System system_shoulder_axial_local("minibex/system_test.mbx");

	std::cout << system_shoulder_axial_global << std::endl;
	std::cout << system_shoulder_axial_local << std::endl;

	return 0;
}

The minibex file (system_test.mbx) is:

Variables
alpha in [-1.7453,2.2689];
beta in [-1.3963,1.3963];
EXT in [-oo,oo];
INT in [-oo,oo];

Constraints
EXT = pi + pi/180 * (0.724559*beta+alpha);
INT = pi + pi/180 * (3.417002*beta+alpha);
end

An the program output is:

Automatic initialization of gaol... done
variables: 
  alpha, beta, EXT, INT
box: 
  ([-1.745300000000001, 2.2689] ; [-1.396300000000001, 1.396300000000001] ; [-inf, inf] ; [-inf, inf])
goal: 
  (none)
constraints:
  (EXT-((0.724559*beta)+alpha))=0
  (INT-((3.417002000000001*beta)+alpha))=0

variables: 
  alpha, beta, EXT, INT
box: 
  ([-1.745300000000001, 2.2689] ; [-1.396300000000001, 1.396300000000001] ; [-inf, inf] ; [-inf, inf])
goal: 
  (none)
constraints:
  ((EXT-([0.01745329251994329, 0.0174532925199433]*((0.724559*beta)+alpha)))-[3.141592653589793, 3.141592653589794])=0
  ((INT-([0.01745329251994329, 0.0174532925199433]*((3.417002000000001*beta)+alpha)))-[3.141592653589793, 3.141592653589794])=0

Automatic cleanup of gaol... done

The issue seems to be resolved by replacing pi by 3.141592654 or by adding a constant for pi (e.g., pi_ = 3.141592654). Therefore it seems that the issue is related to the predefined interval constant pi.

@gchabert
Copy link
Contributor

gchabert commented Mar 5, 2019

Thanks for reporting. It will be fixed soon.

gchabert pushed a commit that referenced this issue Apr 28, 2019
@gchabert
Copy link
Contributor

Fixed (will be in release 2.8.1).
There is still a slight difference (1 ulp in a constant) between the two systems of your example, but it is due to the rounding mode initialization of Gaol (which occurs after your global system is built). This is not a serious problem, you can ignore that.

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

No branches or pull requests

2 participants