From: SourceForge.net <no...@so...> - 2009-09-01 19:51:19
|
Bugs item #2848682, was opened at 2009-09-01 21:51 Message generated for change (Tracker Item Submitted) made by crategus You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2848682&group_id=4933 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Lisp Core - Assume Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Dieter Kaiser (crategus) Assigned to: Nobody/Anonymous (nobody) Summary: abs(log(-1)) --> -log(-1) Initial Comment: Maxima always simplifies abs(log(x)) to -log(x) if x<1: (%i38) assume(x<0)$ (%i39) abs(log(x)); (%o39) -log(x) This happens for negative numbers too: (%i40) abs(log(-1)); (%o40) -log(-1) As a consequence the absolute value of e.g. log(-1) is imaginary: (%i45) rectform(abs(log(-1))); (%o45) -%i*%pi This is the correct result: (%i46) abs(rectform(log(-1))); (%o46) %pi The reason is that for every argument x<1 the function sign returns neg. (%i42) sign(log(x)); (%o42) neg But this is true only for 0 < x < 1. For x<0 sign should return pnz. This could be a correction to the routine sign in compar.lisp: ((eq (caar x) '%log) ;; Return a negative or positive sign only when the argument ;; is a real positive value in all other cases '$pnz. (cond ((eq (setq sign (compare (cadr x) 0)) '$neg) ;; Negative argument. (setq sign '$pnz)) (t ;; Positive argument to the Log function. ;; Check argument < 1 or > 1. (compare (cadr x) 1)))) Dieter Kaiser ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=104933&aid=2848682&group_id=4933 |