supnorm fails on an easy case. (from gforge #15109)
Imported issue: Initially reported by @chevilla in https://gforge.inria.fr/tracker/?group_id=1015&aid=15109
The following behavior has been reported by Florent de Dinechin and looks like a bug.
p=1.86264514923095703125e-9 + 1.99542657355777919292449951171875e-4 * y^7 + 1.384407165460288524627685546875e-3 * y^6 + 8.33319686353206634521484375e-3 * y^5+ 4.16684038937091827392578125e-2 * y^4 + 0.16666667163372039794921875 * y^3 + 0.49999988079071044921875 * y^2 + y + 1;
supnorm(p, exp(y), [-347,347]/1000, absolute, 2^(-40));
This returns a plausible value. But
supnorm(p, exp(y), [-347,348]/1000, absolute, 2^(-40));
fails with an error.
What I have discovered so far:
-
before revision 1156 both cases failed. The commit of revision 1156 makes the algorithm succeeds on the first case, but not in the second (as it is with the current revision).
-
the problem could come from line 957 of supnorm.c. In the case of an unbalanced domain, x0 is not zero, so the substitution made a few lines earlier is non-trivial and the resulting polynomial bestPoly may have finite well-defined coefficients but only given by constant expressions and not dyadic constants. I have the feeling that the test is too conservative here but I am not sure, not being the author of these lines.