mpfr-special-functions {Rmpfr} | R Documentation |
Special Mathematical Functions (MPFR)
Description
Special Mathematical Functions, supported by the MPFR Library.
Note that additionally, all the Math
and
Math2
group member functions are “mpfr-ified”, too;
ditto, for many more standard R functions. See see the methods listed
in mpfr
(aka ?`mpfr-class`
).
Usage
zeta(x)
Ei(x)
Li2(x)
erf(x)
erfc(x)
Arguments
x |
Details
zeta(x)
computes Riemann's Zeta function
important in analytical number theory and
related fields. The traditional definition is
Ei(x)
computes the exponential integral,
Li2(x)
computes the dilogarithm,
erf(x)
and erfc(x)
are the error, respectively
complementary error function which are both reparametrizations
of pnorm
, erf(x) = 2*pnorm(sqrt(2)*x)
and
erfc(x) = 2* pnorm(sqrt(2)*x, lower=FALSE)
,
and hence Rmpfr provides its own version of pnorm
.
Value
A vector of the same length as x
, of class mpfr
.
See Also
pnorm
in standard package stats;
the class description mpfr
mentioning the
generic arithmetic and mathematical functions (sin
, log
,
..., etc) for which "mpfr"
methods are available.
Note the (integer order, non modified) Bessel functions ,
, etc, named
j0, yn
etc, and Airy
function in Bessel_mpfr.
Examples
curve(Ei, 0, 5, n=2001)
## As we now require (mpfrVersion() >= "2.4.0"):
curve(Li2, 0, 5, n=2001)
curve(Li2, -2, 13, n=2000); abline(h=0,v=0, lty=3)
curve(Li2, -200,400, n=2000); abline(h=0,v=0, lty=3)
curve(erf, -3,3, col = "red", ylim = c(-1,2))
curve(erfc, add = TRUE, col = "blue")
abline(h=0, v=0, lty=3)
legend(-3,1, c("erf(x)", "erfc(x)"), col = c("red","blue"), lty=1)