Menu

#2488 radexpand:all/true broken

open
nobody
7
2013-06-16
2012-11-08
No

block([radexpand:all], sqrt(x^2) ) => sqrt(x^2), should be x per doc
block([radexpand:true,domain:'real], sqrt(x^2) ) => sqrt(x^2), should be abs(x) per doc

Tested in Maxima 5.27.0 2012-04-30 11:59:06 i686-apple-darwin11.3.0 SBCL 1.0.55.0-abb03f9

Discussion

  • Raymond Toy

    Raymond Toy - 2012-11-08

    Maxima version too old? I get this with the current sources (and cmucl):

    block([radexpand:all], sqrt(x^2) ) => x
    block([radexpand:true,domain:'real], sqrt(x^2) ) => abs(x)

     
  • kcrisman

    kcrisman - 2013-06-16

    I think that the documentation is currently just wrong. It says:

    (c) If RADEXPAND is FALSE, or RADEXPAND is TRUE and DOMAIN is COMPLEX, SQRT(X^2) will be returned.

    Maxima 5.29.1 http://maxima.sourceforge.net
    using Lisp ECL 12.12.1
    Distributed under the GNU Public License. See the file COPYING.
    Dedicated to the memory of William Schelter.
    The function bug_report() provides bug reporting information.
    (%i1) radexpand;
    (%o1) true
    (%i2) domain:complex;
    (%o2) complex
    (%i3) radcan(sqrt(x^2));
    (%o3) x
    (%i4) radexpand:false;
    (%o4) false
    (%i5) radcan(sqrt(x^2));
    (%o5) x
    (%i6) domain:real;
    (%o6) real
    (%i7) radcan(sqrt(x^2));
    (%o7) x

    So in no case do we seem to get sqrt(x^2) returned. Well, we get it in the case we don't use radcan!

     

Log in to post a comment.