-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
[GSoC]Adding series methods for gamma and incomplete gamma functions and expint #26892
base: master
Are you sure you want to change the base?
Conversation
✅ Hi, I am the SymPy bot. I'm here to help you write a release notes entry. Please read the guide on how to write release notes. Your release notes are in good order. Here is what the release notes will look like:
This will be added to https://github.com/sympy/sympy/wiki/Release-Notes-for-1.14. Click here to see the pull request description that was parsed.
|
if nu.is_real and nu >= 1: | ||
arg = 1/(nu - 1) | ||
if nu == 1: |
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.
Writing if nu >= 1
can result in an error if nu is an expression rather than a rational number:
In [1]: x, y = symbols('x, y', real=True)
In [2]: expint(x, y)
Out[2]: Eₓ(y)
In [3]: expint(x, y).leadterm(x)
---------------------------------------------------------------------------
TypeError: cannot determine truth value of Relational: x >= 1
Checking if nu == 1
only checks if nu is the explicit integer 1. If nu is any other symbolic expression then it will return False.
The code shown might work for integer values of nu
but will fail in different ways for symbolic expressions.
Also if checking nu == 1
then it should be done before computing 1/(nu - 1)
.
fucntions Signed-off-by: arnabnandikgp <arnabnandi2002@gmail.com>
21c8d3a
to
8eb7f61
Compare
Benchmark results from GitHub Actions Lower numbers are good, higher numbers are bad. A ratio less than 1 Significantly changed benchmark results (PR vs master) Significantly changed benchmark results (master vs previous release) Full benchmark results can be found as artifacts in GitHub Actions |
ping for reviews @anutosh491 and @oscarbenjamin. |
Signed-off-by: arnabnandikgp <arnabnandi2002@gmail.com>
ee8cefc
to
f8f617b
Compare
It seems there were a lot of problems with the expint function,
in the latest commit I have fixed these issues |
45d269b
to
70ae81c
Compare
…ctable at infinty Signed-off-by: arnabnandikgp <arnabnandi2002@gmail.com>
70ae81c
to
989028a
Compare
Signed-off-by: arnabnandikgp <arnabnandi2002@gmail.com>
point = args0[1] | ||
nu = self.args[0] | ||
|
||
if point is S.Infinity: |
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.
We should have the following here !
if point in [S.Infinity, S.NegativeInfinity]:
On top of it, we could surely have checks for eg
expint(1, 1/x).as_leading_term(x, logx=None, cdir=1)
and cdir = -1
returning self
Then if we add tests for limits eg limit(expint(1, 1/x), x, 0) (check both + and - ... we should get separate results) .... we then know for sure that the results are returned through gruntz as expected.
try: | ||
_, ex = self.args[1].leadterm(x) | ||
except (ValueError, NotImplementedError): | ||
return self |
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.
How necessary are these try-except blocks here ?
They might be important but I don't see any tests being added for this case. Maybe you can add some ?
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 like a good portion of what I see. Left some comments. The main one which should be addressed is this https://github.com/sympy/sympy/pull/26892/files#r1745358695
|
||
# test limits | ||
assert limit(expint(3, x), x, oo) == S.Zero | ||
assert limit(expint(1, x), x, oo) == S.Zero |
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.
test negative infinity too (should be 0 so can be checked bi-directionally)
…nding tests Signed-off-by: arnabnandikgp <arnabnandi2002@gmail.com>
References to other Issues or PRs
Closes #24027
Brief description of what is fixed or changed
Other comments
Release Notes