Complex mode for $sign



Von: macrakis at gmail.com
> I don't have time for a complete answer, but there are several big
> issues in all this:

> 1) Maxima in general assumes that all variables are real-valued.  This
> assumption is implicit in many simplifications etc. Using
> declare(z,complex) should override this default, but it is not checked
> for in many places.  Also, Maxima in general assumes that functions
> are real-valued.  In theory, domain:complex overrides that default,
> but in practice it does not. e.g. abs(sqrt(x)) -> sqrt(x).

Thank you for your feedback.

Yes, in general all symbols and functions are assumed real. That is a design
issue. If this would be consequently implemented for all functions Complex
support would no longer be possible. Second, all functions should preserve the
declarations and assumptions made by the user. This is not implemented
consequently, too. So we get a lot of problems and workarounds.

> 2) There is a very big difference between abs() and cabs(), and they
> should not be unified.  In effect, abs is a noun form and cabs is a
> verb form. Cabs (like rectform or integrate or limit) is a *routine*
> which returns the absolute value of the expression by using a variety
> of techniques, including asking the user questions.  Abs is a
> *mathematical function* which *represents* an absolute value.  When
> the user writes abs(log(a)), he/she typically wants to manipulate that
> expression, not be asked a question about the sign of a, or get a
> messy expression like (if a>0 then log(a) else log(-a)+%i*%pi).

> These are *design decisions*, not bugs, and have been debated and
> thought about quite a bit.  They may well need to be reconsidered, but
> this is NOT a matter of "fixing bugs", but "changing the
> specification".

Yes, there is a difference between a simplifying function abs and a verb
function cabs. The problem is that abs has Complex support via cabs (not $cabs)
and $cabs return sometimes a noun form of abs as part of a result. This can be
circular and works in my opinion sometimes by accident because the support of
Complex values in both functions is not very strong implemented.

The main point for me was to get more support for Complex expressions as a basic
to do more correct mathematic with functions. A starting point was for me to get
a function $sign with support of Complex expressions. A next step would be to
overcome the problems with the functions for Complex components.

Dieter Kaiser