-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Port implementations of math functions from cpython #153
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
Comments
Can we use Rust FFI to call C function to simplify the implementation? |
That would be possible, but even in CPython no library is used, but a hand crafted implementation. If there is a rust library implementing these functions, that would be preferred. |
I think we can use this: https://docs.rs/statrs/0.9.0/statrs/index.html |
Okay, that looks indeed like it provides the right functions! Nice find! |
@yodalee is this issue now completed, or do we require more actions? |
I think this one is complete. If you want to add more function implementation, I think open another issue is better. |
Is this able to be closed? Can someone please close it? (I am trying to find |
Yes, it can be, thanks for the reminder. Have you tried running |
There are four math functions which are pretty complex.
math.erf
math.erfc
math.gamma
math.lgamma
They are implemented in cpython, as can be seen here:
https://github.com/python/cpython/blob/master/Modules/mathmodule.c#L113
The documentation is listed here:
https://docs.python.org/3/library/math.html#special-functions
In rust python, they must be implemented in
vm/src/stdlib/math.rs
.The text was updated successfully, but these errors were encountered: