Closed AdBedouhene closed 4 years ago
Hi,
Just taking your example for boxes b and y, they do not meet perfectly at the same point, they slightly overlap : b & y = (<0.25, 0.2500000000000001> ; [0.968245836551854, 0.9682458365518544])
.
And in fact, with f(x, y) = x^2+y^2-1
, f(b & y) = [-4.440892098500627e-16, 4.440892098500627e-16]
.
You can verify that with this code:
#include "ibex.h"
using namespace ibex;
int main(int argc, char** argv) {
IntervalVector a{{0.25000000000000005551, 0.50000000000000011102},{0.86602540378443837454, 0.9682458365518543663}};
IntervalVector b{{0, 0.25000000000000005551} ,{ 0.9682458365518540333, 1.000000000000000222}};
Function f("x", "y", "x^2+y^2-1");
std::cout << (a&b) << std::endl;
Interval res = f.eval(a & b);
std::cout << res << std::endl;
return 0;
}
Regards
Hi, Thanks for answering so quickly. You're right, the circle goes across the overlapping part. The vibes drawing shows the circle going outside the boxes, I shouldn't have trusted that. Regards
Hi, I've got an issue while trying to make an approximation of a circle using bisections and the hc4 contractor. At some points, it seems that the circle doesn't belong to the set of boxes I generated due to an inaccurate contraction. My constraint is : x² + y² = 1 (I added the constraint x>=0 and y >=0 to generate less boxes and to isolate the problem to the up right part of the circle) The program behaves as follow:
The resulting boxes are:
The boxes b and y perfectly meet at the point (0.25000000000000005551, 0.9682458365518540333) but the distance of this point to the centre (0.0) is [0.99999999999999955591, 0.99999999999999977796] < 1. It means that the circle goes outside the y box then goes inside the b box.
As we can see it in the line 18 and 19 of the result, the box b results from a non accurate contraction from [0.25, 0.5] ; [0.866025, 1] to [0.866025, 0.968246].
So I don't know if I'm doing the bisections and contractions wrong, or if it is due to a bug.
There is the code: