-
-
Notifications
You must be signed in to change notification settings - Fork 560
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
Gamma of complex numbers incorrectly simplifies to factorial #13869
Comments
comment:1
This seems to be our doing. In
Here is what the Maxima manual says about
There is also a corresponding |
comment:2
In Sage 5.2:
So I agree with Burcin that this comes from us. The problem is that we do rely on this for some examples of the (mostly improved) simplification. E.g. from #6636
On the other hand, does Maxima really want these occurrences with non-integer inputs to be transformed thusly? |
comment:3
So, should we report upstream? |
comment:4
Replying to @sagetrac-JoalHeagney:
I'm not a special functions expert, so maybe it would be nice if someone who had work interrupted reported. |
comment:5
Hmm, maybe not. From what I can see from the maxima documentation, it's kinda hinted that if you call makefact, it's assumed that you know what you're asking for. Would it be possible to change the simplification code to use makegamma instead? In the sage -maxima interface, I was able to do the following (these are all out of order cut-and-paste from my maxima session.)
The benefits here, are that makegamma and gamma_expand functions seem to provide the same simplifications (if not more) that minfactorial and makefact do, but gamma functions can handle (by definition) more fields (RR, CC). I don't know if we want gamma_expand to be true all the time, but it does seem to give another level of simplification, pulling out i(i+1) in my second example. Then we could document the .makefact function so that users could convert sagemath (new default) gamma answers to factorials for themselves? |
comment:6
In the documentation of maxima http://maxima.sourceforge.net/docs/manual/en/maxima_15.html there are also a lot of other expand options we may want to investigate as well: E.g. besselexpand, beta_expand, expintexpand, hypergeometric and expand_hypergeometric, |
comment:7
Another argument for the makegamma option is the following simplification from a maxima newsgroup:
|
comment:8
I don't see any reason why not. If we start using Maxima code more like it's meant to be, that is a good thing, as long as we can keep as many simplifications as possible working.
The standard thing we do is make another |
Changed keywords from gamma, simplify_full to gamma, simplify_full, simplify_factorial, maxima |
comment:9
Hah hah hah. You won't believe this, but I went to the maxima-bugs newsgroup and found out that maxima has the following behaviour: (%i2) float((%i + 3)!); So, the issue seems to be:
|
comment:10
Replying to @sagetrac-JoalHeagney:
Why is that appalling? \Gamma is a natural extension of factorial to the complex plane that agrees with factorial everywhere that factorial is defined. +1 to exposing more simplification options from Maxima. |
comment:11
I don't argue with using gamma to extend factorial - just find it worrying that maxima treats factorial as equivalent to gamma. Much the same way sage doesn't treat ZZ as identically equivalent to RR, despite the fact that every element of ZZ appears in RR. I'm finishing moving house for the next few days (2000km by car), and won't have reliable Internet for about a month after, so I am unable to code anything up, but I would much prefer that if we/maxima are going to treat factorial = gamma, to replace simplify_factorial with simplify_gamma instead? Out of curiosity, does anyone know how we would do the maxima gamma_!expand:true; function call from sage/python? |
comment:17
Okay, after a long time, I think I can say that this ticket could be modified/closed. Using the following I can get the behaviour I want from sage:
and similar to set the different options for maxima expansion and:
to force expressions back to gammas rather than factorials. Messy, but effective. |
comment:18
Well, I'll go with modify, not close, because we would both want to document this workaround as well as still decide what to do. I mean, if |
comment:19
Note also that gamma_expand does alter some other stuff, like incomplete gammas, that come up in various integrals. Maybe making that |
comment:20
The issue with |
If I type the following into sage-5.5 built from source,
I get the following result:
This:
gives the obvious error:
while:
gives no problems.
I've only noticed this happening in 5.5 - no such problems in 5.4 (that I remember).
CC: @benjaminfjones @sagetrac-dsm @eviatarbach @paulmasson
Component: symbolics
Keywords: gamma, simplify_full, simplify_factorial, maxima
Issue created by migration from https://trac.sagemath.org/ticket/13869
The text was updated successfully, but these errors were encountered: