Logged In: YES

user_id=501686

The offending code is the function ABSARG in src/rpart.lisp.

The strangeness in ABSARG affects $POLARFORM, $CARG,

$REALPART and $IMAGPART applied to logarithms, and maybe

other functions. In 5.9.1 (official release and current cvs

as well):

declare (u, complex)$

polarform (u) => u (after asksign)

carg (u) => 0 or %pi (after asksign)

carg (log (u)) => 0 (after asksign)

realpart (log (u)) => log(u) (after asksign)

Here's a patch -- one new line to handle atoms which are

declared complex:

--- rpart.lisp 23 Nov 2004 18:25:33 -0000 1.6

+++ rpart.lisp 6 Feb 2005 03:45:58 -0000

@@ -440,6 +440,7 @@

(cons (abs l) (argnum l)))

((memq l '($%e $%pi)) (cons l 0))

((eq l '$infinity) (cons '$inf '$ind))

+ ((kindp l '$complex) (cons (list '($cabs) l)

(list '($carg) l)))

(absflag (cons (take '(mabs) l) 0))

(t ((lambda (gs)

(cond ((eq gs '$positive) (cons l 0))

After applying the patch:

declare (u, complex)$

polarform (u) => cabs(u) %e^(%i carg(u))

carg (u) => carg(u)

carg (log (u)) => atan2(carg(u), log(cabs(u)))

realpart (log (u)) => log(cabs(u))

imagpart (log (u)) => carg(u)

I'll run the test suite and see what happens.

Maxima version: 5.9.1.1cvs

Maxima build date: 23:52 1/25/2005

host type: i686-redhat-linux-gnu

lisp-implementation-type: CLISP

lisp-implementation-version: 2.31 (released 2003-09-01)