simplification of abs



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

Barton