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

Numerical implementation of logarithmic integral function #23732

Open
Qazalbash opened this issue Sep 18, 2024 · 3 comments
Open

Numerical implementation of logarithmic integral function #23732

Qazalbash opened this issue Sep 18, 2024 · 3 comments
Labels
enhancement New feature or request P3 (no schedule) We have no plan to work on this and, if it is unassigned, we would be happy to review a PR

Comments

@Qazalbash
Copy link

Hi, it would be nice to have a Logarithmic integral function1. It is defined as,

$$ \displaystyle\mathrm{li}(x)=\int_{0}^{x}\frac{\mathrm{d}{t}}{\ln{(t)}} $$

Footnotes

  1. https://en.wikipedia.org/wiki/Logarithmic_integral_function

@Qazalbash Qazalbash added the enhancement New feature or request label Sep 18, 2024
@jakevdp jakevdp added the P3 (no schedule) We have no plan to work on this and, if it is unassigned, we would be happy to review a PR label Sep 18, 2024
@jakevdp
Copy link
Collaborator

jakevdp commented Sep 18, 2024

Hi - thanks for the request! Agreed this would be useful. It's interesting that I couldn't find any function for this (or any feature request) for scipy.special, but maybe I just wasn't searching for the right keywords.

Implementing this in JAX would probably involve finding an appropriate series expansion for the function, which may be somewhat tricky given its singularity at x=1. I'm going to mark this as a P3 enhancement for now.

@carlosgmartin
Copy link
Contributor

@jakevdp
Copy link
Collaborator

jakevdp commented Sep 23, 2024

JAX does implement the exponential integral expi.

It looks like you could comput li using that with a change of variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request P3 (no schedule) We have no plan to work on this and, if it is unassigned, we would be happy to review a PR
Projects
None yet
Development

No branches or pull requests

3 participants