Skip to content
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

Replace the coefficient of abs in the lookup table of meijerint. #11283

Merged
merged 2 commits into from Jun 27, 2016

Conversation

jksuom
Copy link
Member

@jksuom jksuom commented Jun 24, 2016

The denominator of the coefficient pi/(cos(pi*a/2)*gamma(a))
becomes indeterminate for negative odd integers a where cos(pi*a/2)
has a zero and gamma(a) has a pole. There is no code for computing
the limit at such argument values. This PR replaces the coefficient
with 2*sin(pi*a/2)*gamma(1 - a), which is well defined for re(a) < 1,
since the only poles of gamma occur at nonpositive integers.

The equivalence of the two forms can be derived from the standard
formulas

gamma(a)*gamma(1 - a) = pi/sin(pi*a)

and

sin(pi*a) = 2*sin(pi*a/2)*cos(pi*a/2).

The denominator of the coefficient  pi/(cos(pi*a/2)*gamma(a))
becomes indeterminate for negative odd integers  a  where  cos(pi*a/2)
has a zero and  gamma(a)  has a pole. There is no code for computing
the limit at such argument values. This PR replaces the coefficient
with  2*sin(pi*a/2)*gamma(1 - a), which is well defined for  re(a) < 1,
since the only poles of gamma occur at nonpositive integers.

The equivalence of the two forms can be derived from the standard
formulas

    gamma(a)*gamma(1 - a) = pi/sin(pi*a)

and

    sin(pi*a) = 2*sin(pi*a/2)*cos(pi*a/2).
@smichr
Copy link
Member

smichr commented Jun 25, 2016

I double checked the derivation and it looks fine. Code changes look fine, too. I don't know a lot about meijerint, however, so will defer to someone else for any other comments. Lacking any, I am +1 to commit in 24 hrs.

@smichr smichr merged commit fae35ce into sympy:master Jun 27, 2016
@jksuom
Copy link
Member Author

jksuom commented Jun 27, 2016

Thanks, @smichr !

@jksuom jksuom deleted the abs-as-meijerg branch June 27, 2016 11:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants