#1020 limit(n/(n^2+1), n, -inf); + FIX

closed
nobody
5
2007-11-25
2006-11-12
No

I think limit should change -inf to minf before doing
the calculation:

(%i1) limit(n/(n^2+1), n, -inf);
(%o1) -inf/(inf^2+1)
(%i2) limit(n/(n^2+1), n, minf);
(%o2) 0

Andrej

Discussion

  • Andrej Vodopivec

    Logged In: YES
    user_id=1179910

    Attached a patch which does this. Testsuite reports no errors.

    Andrej

     
  • Robert Dodier

    Robert Dodier - 2006-12-04
    • summary: limit(n/(n^2+1), n, -inf); --> limit(n/(n^2+1), n, -inf); + FIX
     
  • Robert Dodier

    Robert Dodier - 2006-12-04

    Logged In: YES
    user_id=501686
    Originator: NO

    I put FIX in the title to make it easier to find patch.

     
  • Raymond Toy

    Raymond Toy - 2006-12-04

    Logged In: YES
    user_id=28849
    Originator: NO

    Rather than fixing this just for limit, shouldn't we fix this at a higher level so that -inf is always simplified to minf?

     
  • Raymond Toy

    Raymond Toy - 2006-12-04

    Logged In: YES
    user_id=28849
    Originator: NO

    The following replacement for simpmin in simp.lisp makes -inf return minf. This doesn't fix the issue that -1*inf is still -inf.

    (defun simpmin (x vestigial z)
    vestigial ;Ignored
    (oneargcheck x)
    (cond ((numberp (cadr x)) (minus (cadr x)))
    ((atom (cadr x))
    (if (eq (cadr x) '$inf) ;; New
    '$minf ;; New
    (list '(mtimes simp) -1 (cadr x))))
    (t (simplifya (list '(mtimes) -1 (simplifya (cadr x) z)) t))))

     
  • Dan Gildea

    Dan Gildea - 2007-11-25
    • status: open --> closed
     
  • Dan Gildea

    Dan Gildea - 2007-11-25

    Logged In: YES
    user_id=1797506
    Originator: NO

    Generally, inf doesn't have its special meaning outside the limit package.
    Added call to infsimp in $limit in limit.lisp rev 1.47.

    (%i50) limit(n/(n^2+1), n, -inf);
    (%o50) 0

    (though perhaps just generating an error message would be better - see bug 1498047)

     

Log in to post a comment.

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

Sign up for the SourceForge newsletter:





No, thanks