Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#937 sum(1/k^2,k,2,inf), simpsum;

closed
Robert Dodier
Lisp Core (472)
5
2006-06-07
2006-05-30
Anonymous
No

I have got this result:

(%i1) sum(1/k^2,k,2,inf), simpsum;
(%o1) inf

The good result is: %pi^2/6 -1

Maxima version: 5.9.3
Maxima build date: 20:8 5/30/2006
host type: i686-pc-linux-gnu
lisp-implementation-type: CMU Common Lisp
lisp-implementation-version: CVS release-19a
19a-release-20040728 + minimal debian patches

Discussion

  • Robert Dodier
    Robert Dodier
    2006-06-05

    Logged In: YES
    user_id=501686

    Also observed in Maxima 5.9.3 / clisp 2.34. Not observed in
    Maxima 5.9.1 / cmucl -- probably this bug was introduced by
    sum/product revisions Nov 2005.

    Incidentally 5.9.3 does return %pi^2/6 for
    sum(1/k^2,k,1,inf), simpsum (i.e. starting at 1 instead of 2).

     
  • Robert Dodier
    Robert Dodier
    2006-06-05

    • labels: --> Lisp Core
    • assigned_to: nobody --> robert_dodier
     
  • Robert Dodier
    Robert Dodier
    2006-06-07

    Logged In: YES
    user_id=501686

    Fixed this bug by patching IPOLY2 (src/combin.lisp) as shown
    below. After this change, run_testsuite reports no
    unexpected errors on Maxima 5.9.3cvs with GCL 2.6.7, Clisp
    2.34, and SBCL 0.9.9.

    After some investigation, I still don't entirely know what
    is going on here. Apparently the ADSUM call is modifying
    SIGN. ADSUM calls SIMPLIFY so pretty much anything can
    happen at that point. Putting the (LET ((SIGN SIGN)) ...) in
    ADSUM fixed this bug but broke several infinite summations
    in the test suite; the general characteristic was that the
    summations were not simplified as much as expected.

    Despite lack of complete comprehension here, I'm going ahead
    with this change since it fixes the bug shown in this report
    and doesn't break anything in the test suite.

    Changes committed to src/combin.lisp r1.12 and
    tests/rtestsum.mac r1.4.

    --- combin.lisp 20 Dec 2005 18:47:16 -0000 1.11
    +++ combin.lisp 7 Jun 2006 04:28:46 -0000
    @@ -977,11 +977,12 @@
    (defun ipoly2 (a n sign)
    (cond ((memq (asksign lo) '($zero $negative))
    (throw 'isumout '$inf)))
    (and (null (equal lo 1))
    - (adsum `((%sum)
    - ((mtimes) ,a -1 ((mexpt) ,*var* ,n))
    - ,*var* 1 ((mplus) -1 ,lo))))
    + (let ((sign sign))
    + (adsum `((%sum)
    + ((mtimes) ,a -1 ((mexpt) ,*var* ,n))
    + ,*var* 1 ((mplus) -1 ,lo)))))
    (cond ((eq sign '$negative)
    (list '(mtimes) a ($zeta (meval (list '(mtimes) -1
    n)))))
    ((throw 'isumout '$inf))))

     
  • Robert Dodier
    Robert Dodier
    2006-06-07

    • status: open --> closed