Function integral

Source
pub fn integral(x: f64, n: u64) -> Option<f64>
Expand description

Computes the generalized Exponential Integral function where x is the argument and n is the integer power of the denominator term.

Returns None if x < 0.0 or the computation could not converge after 100 iterations

§Remarks

This implementation follows the derivation in

“Handbook of Mathematical Functions, Applied Mathematics Series, Volume 55” - Abramowitz, M., and Stegun, I.A 1964

AND

“Advanced mathematical methods for scientists and engineers” - Bender, Carl M.; Steven A. Orszag (1978). page 253

The continued fraction approach is used for x > 1.0 while the taylor series expansions is used for 0.0 < x <= 1.