While we're on the topic of plot2d, I'd like plot2d to optionally
accept a function as its first argument. Currently, the first
argument must be an expression (aka a formula for a function).
Consider
(C1) f(x) := if (x < 0) then -x^2 else x^2;
(D1) f(x):=IF x < 0 THEN -x^2 ELSE x^2
(C2) plot2d(f(x),[x,-5,5]);
MACSYMA was unable to evaluate the predicate:
x < 0
#0: f(x=x)
-- an error. Quitting. To debug this try DEBUGMODE(TRUE);)
(C3)
Yes, I know why this happens. And sure, for this function,
alternatively I could
plot2d(signum(x) * x^2,[x,-5,5]);
but such a trick could be wearisome for other "split-rule"
functions.
I'd like to be able to give plot2d a first argument that is a
function; something like
plot2d(f, [-5,5]);
This would (or should) solve the "split-rule" function problem
and it would also allow one to use modedeclare and
compilation on the function to make graphics faster.
Additionally, I agree with Felix; we should have an option that
(optionally) clips a graph vertically near poles.
Didn't Watson say something like "singularity is invariably a clue"?
Barton