New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for bidirectional limits (dir="real") #8194
Conversation
skirpichev
commented
Oct 3, 2014
- Do we need this at all? 1) We don't have specific algorithms for bidirectional limits yet. 2) Not all CAS support this conception, see e.g. Mathematica.
- Better name for dir value? (variants: "0", "both" or just None); "real" is from the Maple.
- Raise different errors for discontinuities of different type.
tex = r"\lim_{%s \to %s}" % (self._print(z), | ||
self._print(z0)) | ||
tex = r"\lim_{%s \to " % self._print(z) | ||
if str(dir) == "real" or z0 in (S.Infinity, S.NegativeInfinity): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you wrapping dir in str to do the test here and throughout?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because dir is a Symbol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. I missed the sympification of the arg. Would dir.name be better than str(dir)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this more cryptic.
On Oct 4, 2014 11:32 PM, "Christopher Smith" notifications@github.com
wrote:
In sympy/printing/latex.py:
@@ -562,8 +562,11 @@ def _print_Integral(self, expr):
def _print_Limit(self, expr):
e, z, z0, dir = expr.args
tex = r"\lim_{%s \to %s}" % (self._print(z),
self._print(z0))
tex = r"\lim_{%s \to " % self._print(z)
if str(dir) == "real" or z0 in (S.Infinity, S.NegativeInfinity):
ok. I missed the sympification of the arg. Would dir.name be better than
str(dir)?—
Reply to this email directly or view it on GitHub
https://github.com/sympy/sympy/pull/8194/files#r18431164.
rebased on top of #8201 |
I think it's better just in terms of usability. People expect limit to be bidirectional by default. |
Maybe (any proofs?). Anyway, are you sure this worth a performance penalty right now? |
There have been several issues about it. I do think it would be better if we could make this work on a low level in the Gruntz algorithm to avoid duplicate work. |
On Tue, Oct 28, 2014 at 10:20:20AM -0700, Aaron Meurer wrote:
Sure, but it's far from trivial and it will be not the Gruntz algorithm. |
Feel free to pick up this work. |
Ok, maybe this is not so easy:
But probably there are similar silent failures where the left- and right-hand limit are unevaluated expressions. |
|
@asmeurer Strictly from a SymPy user's point of view (and writing about it for others to learn), is it possible that the default will be bidirectional in a future release? |