#1706 rootscontract(%i/2);

closed
nobody
Lisp Core (471)
6
2009-09-02
2009-07-12
No

(%i1) rootscontract(%i/2);
(%o1) -%i/2

(%i2) build_info();
Maxima version: 5.18.1
Maxima build date: 20:57 4/19/2009
host type: i686-pc-mingw32
lisp-implementation-type: GNU Common Lisp (GCL)
lisp-implementation-version: GCL 2.6.8
(%o2)

Discussion

  • Dieter Kaiser

    Dieter Kaiser - 2009-08-29

    The following line in the routine rtcon in comm2.lisp is responsible for the bug:

    (setq e (list* (car e) -1 '((mexpt) -1 ((rat simp) -1 2))
    (delete '$%i (copy-list (cdr e)) :count 1 :test #'eq)))

    This code replaces the symbol %i with (-1)*(-1)^(-1/2). The expression (-1)^(-1/2) is put on a list of roots. This is mathematically correct, but does not work. The routine rtc-fixitup, which constructs the result does not handle inverse roots. In rtc-fixitup (-1)^(-1/2) is replaced by %i but it has to be -%i.

    I have no idea, why %i is not replaced simply by (-1)^(1/2).

    I have tried this change. %i is replaced by (-1)^(1/2):

    (setq e (list* (car e)
    '((mexpt) -1 ((rat simp) 1 2))
    (delete '$%i
    (copy-list (cdr e))
    :count 1 :test #'eq))))

    I have got no problems with the testsuite and the reported bug will vanish.

    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2009-09-02

    The code which causes the wrong results has been commented out.

    Closing this bug report as fixed.

    Dieter Kaiser

     
  • Dieter Kaiser

    Dieter Kaiser - 2009-09-02
    • status: open --> closed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks