#1428 a bug of radcan() and radexpand

closed
nobody
5
2009-11-28
2008-06-02
No

Dear Developers of Maxima,

radcan() does not behave in the correct way.

In the online desription of radcan() with the correction of a misprint,
which is informed in a separate report by me, it is written that

-- Function: radcan (<expr>)
...
...
When `radexpand' is `false', certain transformations are inhibited.
`radcan (sqrt (1-x))' remains `sqrt (1-x)' and is not simplified
to `%i sqrt (x-1)'. `radcan (sqrt (x^2 - 2*x + 1))' remains
`sqrt (x^2 - 2*x + 1)' and is not simplified to `x - 1'.
...
...

The control by the variable `radexpand' does not work in the present Maxima.
A demonstration program is as follows:
-------------------------------------------------------------------------------
/*
* a_bug_of_radcan.maxima:
*
* S.Adachi 2008/06/01
*/

display2d:false;

radexpand; /* Inspect the value of `radexpand' */

radcan(sqrt(x^2-2*x+1)); /* expected to reduce to x-1 */

radexpand:false;

radcan(sqrt(x^2-2*x+1)); /* expected to remain sqrt(x^2-2*x+1) */

/* END */
-------------------------------------------------------------------------------

The result of execution is as follows:
-------------------------------------------------------------------------------
Maxima 5.14.0cvs http://maxima.sourceforge.net
Using Lisp GNU Common Lisp (GCL) GCL 2.6.7 (aka GCL)
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) batch(a_bug_of_radcan.maxima)

batching #p/Volumes/HFS+2/home/adachi/work/301/a_bug_of_radcan.maxima
(%i2) display2d : false
(%o2) false
(%i3) radexpand
(%o3) true
(%i4) radcan(sqrt(1-2*x+x^2))
(%o4) x-1
(%i5) radexpand:false
(%o5) false
(%i6) radcan(sqrt(1-2*x+x^2))
(%o6) x-1
(%o7) "a_bug_of_radcan.maxima"
-------------------------------------------------------------------------------

If `radexpand' is `false', `radcan(sqrt(x^2-2*x+1))' is expected to remain
`sqrt(x^2-2*x+1)'. However, Maxima returns `x-1' in reality.
This is a bug.

I think that this is a very serious bug of radcan().
Please fix it.

Sincerely yours,
Satoshi Adachi

Discussion

  • Robert Dodier

    Robert Dodier - 2008-06-23
    • labels: --> Lisp Core - Simplification
     
  • Nobody/Anonymous

    (%i1) radcan(sqrt((x-1)^2));
    (%o1) abs(x - 1)
    (%i2) radcan(sqrt(x^2-2*x+1));
    (%o2) x - 1
    (%i3) build_info();
    Maxima version: 5.17.1
    Maxima build date: 19:10 12/18/2008
    host type: i686-pc-mingw32
    lisp-implementation-type: GNU Common Lisp (GCL)
    lisp-implementation-version: GCL 2.6.8

     
  • Dieter Kaiser

    Dieter Kaiser - 2009-11-28

    This bug report is a duplicate of the bug report ID: 1977146 - radexpand does not work as explained in documentation.

    Closing this bug report as a duplicate:

    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2009-11-28
    • status: open --> closed
     

Log in to post a comment.