Exponential Integral and Incomplete Gamma Function

The exponential integrals E_1(x), E_2(x), E_n(x) and Ei(x), and the incomplete gamma function G(a, x) defined for negative values of its first argument. The package also gives easy access to the underlying C routines through an API; see the package vignette for details. A test package included in sub-directory example_API provides an implementation. C routines derived from the GNU Scientific Library < https://www.gnu.org/software/gsl/>.

Exponential integral and incomplete gamma function for R.

What it is

The exponential integral `E_1(x) = int_x^Inf exp(-t)/t dt` and the incomplete gamma function `G(a, x) = int_x^Inf t^(a-1) exp(-t) dt` are closely related functions that arise in various fields of mathematics and statistics.

expint is a small R package that provides functions to compute the exponential integral and the incomplete gamma function.

Most conveniently for R package developers, the package also gives access to the underlying C workhorses through an API.

Features

• R interface consisting of one main and four auxiliary functions to compute the exponential integral, and one function to compute the incomplete gamma function.
• Underlying C routines derived from mature and stable code of the GNU Scientific Library.
• Test package implementing the access to the C routine through the API. This test package uses the `.External` R to C interface and, as a bonus, shows how to vectorize an R function on the C side.
• Exhaustive package vignette providing all the details about the formulas that are implemented in the package as well as a complete presentation of the API and its usage.

Examples

We tabulate the values of the exponential integral of order `n` for `x = 1.275, 10, 12.3` and `n = 1, 2, ..., 10` as found in examples 4 through 6 of Abramowitz and Stegun (1972), section 5.3.

We also tabulate the values of the incomplete gamma function for `a = -1.5, -1, -0.5, 1` and `x = 1, 2, ..., 10`.

Status

Unless important bugs are discovered either upstream in the GSL functions or in our adaptation, the code base of the package is not expected to change much in the future. In other words: stable.

Installation

You should install the stable version of the package from the Comprehensive R Archive Network (CRAN) using:

Author

Vincent Goulet is the author and maintainer of the package. Many other copyright holders (for the original GSL code and for parts of the base R code) are credited in the `DESCRIPTION` file.

expint is free software licensed under the GNU General Public License (GPL), version 2 or later.

Reference manual

install.packages("expint")

0.1-6 by Vincent Goulet, a year ago

https://gitlab.com/vigou3/expint

Report a bug at https://gitlab.com/vigou3/expint/issues

Browse source code at https://github.com/cran/expint

Authors: Vincent Goulet [cre, aut] , Gerard Jungman [aut] (Original GSL code) , Brian Gough [aut] (Original GSL code) , Jeffrey A. Ryan [aut] (Package API) , Robert Gentleman [aut] (Parts of the R to C interface) , Ross Ihaka [aut] (Parts of the R to C interface) , R Core Team [aut] (Parts of the R to C interface) , R Foundation [aut] (Parts of the R to C interface)

Documentation:   PDF Manual