realpart((%I*%E^-%I-%E^%I*%I)^a) returns the
expression itself. This is correct in a sense -- the
expression has an imaginary part of zero -- but the
result of realpart should not contain a %I.
;;If all else fails, we use the trigonometric form.
(cond ((and (=0 (cdr sp)) (=0 (cdr aa))
(freeof '$%i l)) ; NEW CLAUSE
(cons l 0))
Unfortunately, this is not a complete solution.
Consider (LOG(-2)-LOG(-1))^a. This, too, has a real
value, but contains non-real subexpressions. The fix for
that would be to remove the entire COND clause above.
Though that is overkill, it is probably better than not
remove that cond-clause completely.
Log in to post a comment.