Skip to content

Conversation

@JSorngard
Copy link
Contributor

@JSorngard JSorngard commented Oct 31, 2025

Hello!

I found this interesting implementation of the Gamma function by T. Fukushima (same person that published the algorithm I use in the lambert_w crate) in Fortran. It has a lower relative error than the current implementation (often within a single ulp), so I thought I could try implementing it in Rust.

This PR implements this new Gamma function and makes the tests more stringent to show the reduced error.

@JSorngard
Copy link
Contributor Author

JSorngard commented Oct 31, 2025

It seems the tests fail because pyo3 expects an older version of python (3.13) than is available on the CI image (3.14).

The tests compile and run fine on my local machine.

I don't know how to fix the problem though.

@JSorngard
Copy link
Contributor Author

JSorngard commented Oct 31, 2025

It may be that updating the pyo3 dependency of peroxide will make it able to compile on the latest CI images. I opened that PR in Axect/Peroxide#89.

@JSorngard
Copy link
Contributor Author

If this PR is interesting then this code might also be interesting as it contains functions for computing the incomplete and complementary incomplete Gamma functions.

@JSorngard
Copy link
Contributor Author

Should the polynomial function also be exported outside the crate?

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.

1 participant