Menu

#170 Finer-grained logexpand

None
open
nobody
None
5
2022-05-10
2022-05-09
No

logexpand currently allows for the values

  • false: Don't mess with logarithms
  • true: converts log(a^b) to b*log(a)
  • all: 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.

Discussion

  • Gunter Königsmann

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -6,3 +6,5 @@
     * `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`. 
    
    • Group: -->
     
  • Stavros Macrakis

    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
  • Gunter Königsmann

     
  • Gunter Königsmann

    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).

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.