Skip to content

Can't evaluate limits of piecewise #536

Closed

Description

@Illuminati-CRAZ

The version I use: AngouriMath/AngouriMath.Interactive

Unexpected behaviour or bug:
image

Activity

  1. WhiteBlackGoose commented on Oct 29, 2021

    @WhiteBlackGoose
    Member

    Um... I'm not sure... if this even has a limit, since there's a jump discontinuity at x = 0

  2. WhiteBlackGoose commented on Oct 29, 2021

    @WhiteBlackGoose
    Member

    Ah, so it returned a limit. Correct, I see. But for the other cases... well, there definitely are limits, and it didn't find it. I see. That's kind of bug, but... as well as a missing feature

  3. Rafael-SOWNet commented on Aug 5, 2026

    @Rafael-SOWNet
    Member

    Fixed in #714, on master now.

    Two causes sat on top of each other. The gate at the top of ComputeLimit admits ContinuousNode only, and a Piecewise is not one, so the descent's Piecewise case was never reached. And that case was dead anyway: it tested allLims.Select(c => c.lim is null).Any(), which is Any() with no predicate -- "is the sequence non-empty" -- so it always returned null. Even had it run, it built a piecewise of the cases' limits carrying predicates that still speak about the variable the limit had just removed.

    It now picks the case that holds near the destination, reading each predicate from the sign its comparisons keep on the way in. With the piecewise from your screenshot:

    lim x->0-    =>  -1
    lim x->0+    =>   1
    lim x->0     =>  NaN     (the two sides disagree, so there is no limit)
    lim x->-456  =>  -1
    lim x->123   =>   1
    

    Closing.

  4. added theissue type on Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions