One of the next bugs I would like to close is the bug ID: 2031312 "take
macro".
I think it is more correct to cut out the shortcuts to the simplifier
from the macro TAKE, e.g. the calls to simp-%sin, simp-%cos, or simpabs.
Because of these shortcuts the general simplification rules of the
simplifier will not work as expected.
Because there are some discussions in the thread of the bug report I try
to summarize some aspects:
1.
Both the macro TAKE and the function SIMPLIFY are shortcuts for a call
of the simplifier, that is (simplifya expr simpflag):
(take '(op) args) --> (simplifya (list '(op) args) t)
(simplify (list '(op) args)) --> (simplifya (list '(op) args) nil)
Here expr is the list (list '(op) args).
The call with a simpflag NIL is more general and works for simplified or
unsimplified arguments of an expression. The macro TAKE is a bit more
efficient, when it is known that the arguments are already simplified.
Unfortunately, the names TAKE and SIMPLIFY do not reflect this small
difference. I have no idea what names would be the best for both.
Furthermore, we have a macro definition for TAKE and a function
definition for SIMPLIFY.
Remark: I think TAKE and SIMPLIFY are shortcuts which help to make the
code more readable.
2.
The function RESIMPLIFY calls the simplifier too, but sets the flag
DOSIMP to T. Therefore, simpflags of an expression are ignored. The
expression is again simplified completely.
RESIMPLIFY is called by the function $expand. Therefore a call from the
user like expand(expr,0,0) resimplifies the expression.
The function RESIMPLIFY has a duplicate SSIMPLIFY. This duplicate is
only used at a few places and should be replaced by RESIMPLIFY.
Remark: Because RESIMPLIFY ignores the simplification work which has
been done already, this function has to be used very carefully.
At last, I think we should start and cut out the shortcuts to the
simplifier from the macro TAKE.
Dieter Kaiser