Am Freitag, den 24.09.2010, 15:00 -0500 schrieb Barton Willis:
> I think the general simplifier for abs does some things that it shouldn't. Example:
>
> (%i1) abs(log(x));
> (%o1) sqrt(log(abs(x))^2+atan2(0,x)^2)
>
> Surely, (%o1) causes trouble for limit, integrate, solve, ... Another problem with (%o1) is
>
> (%i2) subst(x=%i,%);
> (%o2) sqrt(atan2(0,%i)^2)
>
> Rectform and related functions will *not* simplify %o2 to %pi/2. Changing log to plog and all is well:
>
> (%i4) abs(plog(x));
> (%o4) abs(plog(x))
>
> (%i5) subst(x=%i,%);
> (%o5) %pi/2
>
> A related bug (maybe this is more of a problem with carg, not abs)
>
> (%i6) declare(z,complex);
> (%o6) done
>
> (%i7) abs(log(-z));
> (%o7) sqrt(log(abs(z))^2+(carg(z)+%pi)^2)
>
> Wrong: Should be 0, not 2 pi:
>
> (%i8) subst(z=-1,%);
> (%o8) 2*%pi
>
> (%i9) abs(log(1));
> (%o9) 0
Yes, the problem is that we call the function cabs in the simplifier of
abs. cabs is called every time an expression seems to be complex. The
call of cabs is present since the initial revision of Maxima. Older
versions have not the reported problems, but we have improved other code
of Maxima to handle complex expressions more completely. This causes now
the problems with the abs function, because Maxima has more knowledge
about expressions and functions which are complex, e.g.
(%i1) csign(log(x));
(%o1) complex
but
(%i2) csign(plog(x));
(%o2) pnz
We have to redesign the function abs without a call of cabs to get the
desired results.
Dieter Kaiser