Expint {gsl}R Documentation

exponential functions

Description

Expint functions as per the Gnu Scientific Library, reference manual section 7.17 and AMS-55, chapter 5. These functions are declared in header file gsl_sf_expint.h.

Usage

expint_E1(x, give=FALSE, strict=TRUE)
expint_E2(x, give=FALSE, strict=TRUE)
expint_Ei(x, give=FALSE, strict=TRUE)
Shi(x, give=FALSE, strict=TRUE)
Chi(x, give=FALSE, strict=TRUE)
expint_3(x, give=FALSE, strict=TRUE)
Si(x, give=FALSE, strict=TRUE)
Ci(x, give=FALSE, strict=TRUE)
atanint(x, give=FALSE, strict=TRUE)

Arguments

x input: real values
give Boolean with TRUE meaning to return a list of three items: the value, an estimate of the error, and a status number
strict Boolean, with TRUE meaning to return NaN if status is an error

Note

Function expint_En() is coded up in the package but commented out. This is because it is new in GSL version 1.10, which many users might not have on their systems. This package requires GSL version 1.8 for its use.

To access expint_En():

  1. Make sure you have GSL-1.10 installed.
  2. Untar the package using tar -xvzf gsl_1.8-8.tar.gz.
  3. Uncomment expint_En_e() from file expint.c in the src/ directory (in C, anything between “/*” and “*/” is a comment. Remove the these two character strings from lines 34 and 47).
  4. Uncomment Expint_En() from file expint.R in the R/ directory (in R, code between if(FALSE){ and } is comment. Remove these two strings from lines 55 and 88).
  5. Uncomment various documentation lines from file Expint.Rd in directory man/ (ie this file). In .Rd files, everything following a “%” symbol is a comment. Remove this symbol from lines 22 and 33 of this file. Also remove the ## Not run: ... directive below.
  6. Reinstall by typing sudo R CMD INSTALL ./gsl from the directory containing gsl/.

Author(s)

Robin K. S. Hankin

References

http://www.gnu.org/software/gsl

Examples

x <- seq(from=0.5, to=1, by=0.01)
cbind(x,Si(x),Ci(x),expint_Ei(x),expint_E1(x))  #table 5.1 of AS, p239

x <- seq(from=0, to=12, len=100)
plot(x,Ci(x),col="black",type="l",xaxt="n",yaxt="n",bty="n",xlab="",ylab="",main="Figure 5.6, p232",xlim=c(0,12),ylim=c(-1,2.0))
lines(x,Si(x))
axis(1,pos=0)
axis(2,pos=0)
 abline(h=pi/2,lty=2)

## Not run: 
# Table 5.4, page 245:
 xvec <- seq(from=0,by=0.01,len=20)
 nvec <- c(2,3,4,10,20)
 x <- kronecker(xvec,t(rep(1,5)))
 n <- kronecker(t(nvec),rep(1,20))
 ans <- cbind(x=xvec,expint_En(n,x))
 rownames(ans) <- rep(" ",length(xvec))
 colnames(ans) <- c("x",paste("n=",nvec,sep=""))
 class(ans) <- "I do not understand the first column"

 ans
## End(Not run)

[Package gsl version 1.8-8 Index]