logexpand
currently allows for the values
false
: Don't mess with logarithmstrue
: converts log(a^b)
to b*log(a)
log(a*b)
converts to log(a)+log(b)
super
: log(a/b)
converts to log(a)-log(b)
, even if the sign of a and b isn't known. ...but there is no way to tell maxima not to do these conversions if for example it is not known if the sign of the expression within the logarithm makes these conversions fail. We should add such a n option, or to logexpand, or as a new option variable.
In https://sourceforge.net/p/maxima/bugs/3973/ there is a proposal to add the option to set logexpand:'abs
.
Diff:
I suggest that
logexpand:'careful
expand only if the transformation is always correct:log(PZ*ANY) => log(PZ)+log(ANY)
(recursively; covers division, too)log(PZ^ANY) => ANY*log(PZ)
log(ANY^EVEN) => EVEN*log(abs(ANY))
Remember that all quantities are treated as real in Maxima by default.
Last edit: Stavros Macrakis 2022-05-09
Sounds fine to me. As soon as this is implemented I'll add this flag to wxMaxima's menus.
I personally would opt for making "careful" the default: This will beak user code, but will also avoid some hard-to-detect errors (errors that result in plausibly -looking maths).