pub fn expint_e1(x: f64) -> f64Expand description
The exponential integral $E_{1}(x) = \int_{x}^{\infty} \frac{e^{-t}}{t}, dt$, $x > 0$: the series $-\gamma - \ln x - \sum_{k \ge 1} \frac{(-x)^{k}}{k, k!}$ for $x \le 1$, the continued fraction $\cfrac{e^{-x}}{x + 1 - \cfrac{1}{x + 3 - \cfrac{4}{x + 5 - \dotsb}}}$ beyond (Press et al., Numerical Recipes, §6.3); relative error about $10^{-15}$. $e^{1/\rho} E_{1}(1/\rho)$ is the ergodic capacity (nats) of the Rayleigh channel at the mean SNR $\rho$.
§Examples
use comnum_math::expint_e1;
assert!((expint_e1(1.0) - 0.219_383_934_395_520_5).abs() < 1e-15);
assert!((expint_e1(10.0) / 4.156_968_929_685_325e-6 - 1.0).abs() < 1e-14);