log vs. logb simplification

Help
2010-08-24
2012-11-20
  • Nathan Carter
    Nathan Carter
    2010-08-24

    In reduce, I find this behavior:

    log(e^x);
    x
    logb(a^x,a);
          x
    logb(a ,a)
    

    Any ideas how to get logb to behave like log in this case?  Should I add my own global simplification rules, or is there some switch I have wrong?
    Thank you!
    Nathan

     
  • Rainer Schöpf
    Rainer Schöpf
    2011-07-15

    log(e^x) is implented is packages/alg/elem.red with a pattern matching rule:

    for all x let log(e**x)=x;
    

    Similarly, you can add the second simplification with

    for all x,a let logb(a**x,a) = x;
    

      Rainer

     
  • Nathan Carter
    Nathan Carter
    2011-07-15

    Great, thank you!

     
  • Rainer Schöpf
    Rainer Schöpf
    2011-07-16

    I've just checked in extra simplication rules for log10 and logb, including the two above and differentiation rules.

    Rainer