Skip to content

exponential integral (Ei, E1, En...) function #7089

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

Closed
stevengj opened this issue Jun 2, 2014 · 8 comments
Closed

exponential integral (Ei, E1, En...) function #7089

stevengj opened this issue Jun 2, 2014 · 8 comments
Labels
help wanted Indicates that a maintainer wants help on an issue or pull request

Comments

@stevengj
Copy link
Member

stevengj commented Jun 2, 2014

This is a common special function that it would be nice to include. It already is supplied by MPFR, which gives us a BigFloat version.

@StefanKarpinski
Copy link
Member

Does it make sense for types other than BigFloat or are the typical values too large?

@stevengj
Copy link
Member Author

stevengj commented Jun 3, 2014

No, typical values are well within the range of ordinary floating-point precisions, and there are practical algorithms to compute it with ordinary precision. (Or to compute them... there are several related functions.)

@stevengj stevengj changed the title exponential integral (Ei) function exponential integral (Ei, E1, En...) function Jun 3, 2014
@stevengj
Copy link
Member Author

stevengj commented Jun 5, 2014

At some point, we should just have a Special.jl package, as there is a long list of useful special functions that can be computed reasonably efficiently, and it is not clear they all belong in Base.

Of course, we might also want to dump a whole bunch of C and Fortran implementations from SciPy and elsewhere into openlibm, in which case they would be exported from Base.

@stevengj
Copy link
Member Author

stevengj commented Jun 5, 2014

See also the mailing list discussion on exponential integrals.

@stevengj
Copy link
Member Author

stevengj commented Jun 6, 2014

Some potentially useful references:

Of course, the usual copyright caveats apply: don't even look at the source code of any of these, just the equations. Especially for the ACM TOMS journal, the most evil journal in numerical analysis.

@stevengj
Copy link
Member Author

I assigned the problem of implementing E₁ to double-precision accuracy in the right-half complex plain (real(z) ≥ 0) in problem set 3 of our course 18.S096 this January. In the solutions, I showed how to implement it using a combination of Taylor series and continued fractions, with some custom macros to do inlining, and got performance 5–6 times faster than the Fortran code used in SciPy.

This should be helpful as a starting point for more full-featured implementations.

@tkelman
Copy link
Contributor

tkelman commented Jan 31, 2017

neat, but sounds best for inclusion in a SpecialFunctions.jl rather than Base at this point.

@stevengj
Copy link
Member Author

Closed in favor of SpecialFunctions issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Indicates that a maintainer wants help on an issue or pull request
Projects
None yet
Development

No branches or pull requests

5 participants