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

ENH: special: add log_wright_bessel #20646

Merged
merged 3 commits into from May 7, 2024
Merged

Conversation

lorentzenchr
Copy link
Contributor

Reference issue

Closes gh-20598

What does this implement/fix?

This PR adds the special function log_wright_bessel, i.e. the logarithm of Wright's Bessel function.

Additional information

Simply put, this might be (one of) the hardest to evaluate special function in scipy.special. Taking the logarithm makes the possible domain of the 3 parameters even larger.

- wb_large_a more numerically stabel
- wb_small_a factored out C and X coefficients
- comments improved
@github-actions github-actions bot added scipy.special C/C++ Items related to the internal C/C++ code base Cython Issues with the internal Cython code base enhancement A new feature or improvement labels May 5, 2024
@lucascolley lucascolley changed the title ENH add log_wright_bessel ENH: special: add log_wright_bessel May 5, 2024
@steppi
Copy link
Contributor

steppi commented May 5, 2024

Thanks @lorentzenchr! This is excellent work. I'll give this a close sometime in the next week.

Copy link
Contributor

@steppi steppi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great @lorentzenchr! Nice work getting all of the infrastructure stuff right before we've even documented it.

Comment on lines +163 to 167
A[4] = X[1] * (C[0] + C[1] * b + C[2] * B[2] + C[3] * B[3] + C[4] * B[4]);
A[3] = X[2] / 2. * (C[1] + C[2] * b + C[3] * B[2] + C[4] * B[3]);
A[2] = X[3] / 6. * (C[2] + C[3] * b + C[4] * B[2]);
A[1] = X[4] / 24. * (C[3] + C[4] * b);
A[0] = X[5] / 120. * C[4];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does look nice lined up like this, but we've been using clang-format to format the code in this folder: https://github.com/scipy/scipy/blob/main/scipy/special/special/.clang-format. I think it's fine to merge it like this, but just giving you a heads up that the formatting here is likely to be automatically changed back in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C/C++ Items related to the internal C/C++ code base Cython Issues with the internal Cython code base enhancement A new feature or improvement scipy.special
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ENH: special: add log of wright_bessel
3 participants