Misleading error message (from gforge #21659)
Imported issue: Initially reported by @chevilla in https://gforge.inria.fr/tracker/?group_id=1015&aid=21659
A bug in the internal function dirtyIsConstant leads it to think that some expressions are constant while they are not. This can be observed on the following example, where it shows up under the form of an obscure error message:
f = atan(x); I = [1,2]; p = remez(f,[|log(x),x|],I);
Warning: the given expression should be constant in this context.
The expression actually seems to be constant but no proof could be established.
The resulting syntax error might be unjustified.
The problem comes from remez trying to check whether it gets a list of integers or a list of functions: this calls in particular dirtyIsConstant, which tries to determine whether log is constant by evaluating it at several points around -1, and falsely concludes that it is constant.
Minimal patch: consider that when the tested expression evaluates to NaN somewhere (e.g., at -1) it is not constant. I could patch it by myself, but I let Christoph see if he agrees with the proposed patch or prefers to setup something more robust.