Download Fluctuat - User manual
Transcript
unfolding of loops, but to the fact that the computed growth of the errors induces no longer a growth of the
error intervals (convergence due to the use of finite precision numbers for the analysis).
This rather disappointing behaviour when loops are unfolded, is in this example due to the fact that
the value of y when entering the loop is a single value and not an interval, so that errors are computed
exactly and their behaviour is chaotic, they do not necessarily decrease as would ulp(y). If we substitute “y
= FBETWEEN(0,.618034) ;” for “y=.618034 ;” in the second example, then the convergence for the errors is
much more easily reached. If we unfold the loop at least twice (Cyclic unfolding greater or equal to 2), a
bounded value for the error is got for any value of Widening Threshold. The bounds for the error obtained,
when finite, for same Cyclic unfolding, may be a little smaller when y is a value and not an interval, but
they are still comparable. And the computing time starting from an interval for y, and unfolding the loop
at least twice, is on this example about 10 times smaller than starting from a value (whatever the value of
Cyclic unfolding), because the fixpoint is got with only a few iterations.
The parameter Exact error calculation for constants can also be used to overcome this problem :
setting it to false (errors computed exactly only outside loops) on second example, the analysis converges
when unfolding at least 5 times, with any value of Widening Threshold.
We can also notice that first order errors converge whenever the loop is unfolded at least 3 times, and
only higher order errors, which are in this case negligible, delay the convergence. Setting the parameter
Convergence of higher order errors to true, we then get the convergence unfolding only three times,
but higher order errors are over-approximated.
Finally, executing 4 times (or more) the loop, with parameter Initial unfolding set to 1, before
beginning the unions over iterations, allows to obtain convergence without unfolding.
Now look at this other linear iterative scheme whatever the values of the parameters, you see that the
initial error is not amplified (this scheme is stable for a wide class of input), and with Cyclic unfolding at
least equal to 3, all errors are bounded.
int main(int n) {
float x,y,z;
int i;
x=1.0;
y = FLOAT_WITH_ERROR(-2.0,3.0,-0.01,0.01);
y = y-1.0/3.0;
for (i=1;i<=n;i++) {
z=x;
x=y;
y=(x+z)/6.0; }
}
For the following unstable one, the analyser gives infinite bounds for the errors when we do not unfold
completely the loop. These warnings are correct : see how the initial error can propagate – up to 1015 ,
the floating-point value may be completely meaningless ! – when the loop is completely unfolded, i.e., when
Cyclic unfolding is set to a value greater or equal to 51 = 100/2 + 1.
int main()
{
float x,y,z;
int i;
x=1.0;
z=1.0;
y=FLOAT_WITH_ERROR(0,.618034,-0.00001,0.00001);
for (i=1;i<=100;i++) {
z=x;
x=y;
y=z-y; }
52