-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Access to beta function #9130
Comments
comment:1
For numerical evaluation, mpmath has beta and also the generalized incomplete beta function for complex arguments. But it's probably easy to do the complete beta function directly with Ginac. Simplification for rational arguments (beta(0.5,0.5) = pi) would be nice. Unless someone else wants to work on this, I might have a stab at it within a couple of days. |
comment:2
I wasn't suggesting which of the several packages in Sage should be used for numerical evaluation, though mpmath did come to mind :-) I don't think that beta(0.5,0.5) would work, given that
but beta(1/2,1/2) becoming pi should work fine once we have a symbolic wrapper (with or without Ginac):
Please do try to add this! We definitely often get email asking for various special functions both symbolically and numerically. Also, the more examples we have, the easier it is to finish off the rest of them by cut and paste. |
comment:3
GiNaC has a beta function, so this can probably be solved simply by wrapping that. See #8864 for an example. Though I don't know why the Fredrik, it would be great if you can do this. I'd be happy to answer questions if anything goes wrong. |
comment:4
Replying to @burcin:
I think the same reason the psi and psi2 ones are commented - when those were implemented, they didn't notice that they had been commented earlier. This was probably pretty early in the conversion, maybe when William was dealing with CLN (whatever that is)? |
comment:5
Replying to @kcrisman:
We'll find out when someone tries this out I suppose. |
Attachment: trac_9130_beta_function.patch.gz |
comment:7
Added ginac wrapper for beta function. --Karen
|
Attachment: trac_9130-py_float_segfault.patch.gz fix segfault in py_float |
Author: Karen T. Kohl, Burcin Erocal |
comment:8
Hi Karen, sorry for taking so long to look at this. It seems that I forgot to check for a NULL pointer in
Will you have time to finish the patch? You need to add an import statement to
is too vague. We should either remove it or explain how GiNaC evaluates this (see |
Changed keywords from special function, pynac to special function, pynac, sd35.5 |
Attachment: trac_9130_beta_function.2.patch.gz |
include beta in random_tests |
comment:12
Attachment: trac_9130_beta_function.3.patch.gz Apply all patches in the order they were added:
|
This comment has been minimized.
This comment has been minimized.
comment:14
I think we discovered that the only complex inputs that the code accepts are ones where one of the parameters is equal to 1. In that case On the other hand, mpmath does support evaluation at arbitrary precision complex numbers so that could be a useful enhancement that could take place in a new ticket. I would change the docstrings to clearly indicate that
|
Dependencies: 4498 |
This comment has been minimized.
This comment has been minimized.
Changed dependencies from 4498 to #4498 |
Attachment: trac_9130-beta_function.2.patch.gz |
Attachment: trac_9130-random-tests.patch.gz fixes random tests after rebasing against #4498 |
This comment has been minimized.
This comment has been minimized.
comment:37
I rebased the patches against #4498. This meant moving the changes to The tests in Would it make sense to open a new ticket for changes needed to |
comment:38
Replying to @benjaminfjones:
I think that would be making it more complicated for yourself and for reviewers. It also means that, if just one of those tickets has a problem, none of them can be merged. But I'm not against your suggestion. |
comment:39
Replying to @benjaminfjones:
Thank you for taking care of this.
At this stage I'd be happy to mark that test in |
comment:41
Just checked one last time - yes, everything is fine! A very minor quibble is that the (why here?) added prime pi file could use a few double backticks and one or two other things, but that is immaterial in this saga. |
Attachment: trac_9130-random-tests.2.patch.gz |
comment:42
Attachment: trac_9130-beta_function.3.patch.gz Rebased again. |
This comment has been minimized.
This comment has been minimized.
Merged: sage-5.0.beta6 |
Changed author from Karen T. Kohl, Burcin Erocal, Karl-Dieter Crisman to Karen Kohl, Burcin Erocal, Karl-Dieter Crisman |
Although Maxima has the beta function, Sage doesn't:
This is is Ginac, though, and there is even room for defining it in symbolic/expression.pyx . It probably is also included in some of our other libraries, as a standard special function.
Apply
Depends on #4498
Depends on #12507
CC: @benjaminfjones
Component: symbolics
Keywords: special function, pynac, sd35.5 Cernay2012
Author: Karen Kohl, Burcin Erocal, Karl-Dieter Crisman
Reviewer: Benjamin Jones, Burcin Erocal, Karl-Dieter Crisman
Merged: sage-5.0.beta6
Issue created by migration from https://trac.sagemath.org/ticket/9130
The text was updated successfully, but these errors were encountered: