public class MathFunctions extends Object
| Constructor and Description |
|---|
MathFunctions() |
| Modifier and Type | Method and Description |
|---|---|
static double |
algdiv(double a,
double b)
-----------------------------------------------------------------------
COMPUTATION OF LN(GAMMA(B)/GAMMA(A+B)) WHEN B >= 8.
|
static double |
alnrel(double a)
-----------------------------------------------------------------------
Evaluation of the function ln(1 + a)
-----------------------------------------------------------------------
|
static double |
apser(double a,
double b,
double x,
double eps) |
static double |
basym(double a,
double b,
double lambda,
double eps,
boolean log_p) |
static double |
bcorr(double a0,
double b0)
-----------------------------------------------------------------------
EVALUATION OF DEL(A0) + DEL(B0) - DEL(A0 + B0) WHERE
LN(GAMMA(A)) = (A - 0.5)*LN(A) - A + 0.5*LN(2*PI) + DEL(A).
|
static double |
bd0(double x,
double np) |
static double |
beta(double a,
double b)
This function returns the value of the beta function
evaluated with arguments a and b.
|
static double |
betaln(double a0,
double b0)
-----------------------------------------------------------------------
Evaluation of the logarithm of the beta function ln(beta(a0,b0))
-----------------------------------------------------------------------
|
static double |
bfrac(double a,
double b,
double x,
double y,
double lambda,
double eps,
boolean log_p) |
static double |
bgrat(double a,
double b,
double x,
double y,
double w,
double eps,
boolean log_w) |
static double |
bpser(double a,
double b,
double x,
double eps,
boolean log_p) |
static double[] |
bratio(double a,
double b,
double x,
double y,
boolean log_p)
-----------------------------------------------------------------------
Evaluation of the Incomplete Beta function I_x(a,b)
--------------------
It is assumed that a and b are nonnegative, and that x <= 1
and y = 1 - x.
|
static double |
brcmp1(int mu,
double a,
double b,
double x,
double y,
boolean give_log) |
static double |
brcomp(double a,
double b,
double x,
double y,
boolean log_p) |
static double |
bup(double a,
double b,
double x,
double y,
int n,
double eps,
boolean give_log) |
static double |
chebyshev_eval(double x,
double[] a,
int n)
evaluate the n-term Chebyshev series "a" at "x".
|
static double |
choose(double n,
double k) |
static double |
erf__(double x)
-----------------------------------------------------------------------
EVALUATION OF THE REAL ERROR FUNCTION
-----------------------------------------------------------------------
|
static double |
erfc1(int ind,
double x)
-----------------------------------------------------------------------
EVALUATION OF THE COMPLEMENTARY ERROR FUNCTION
ERFC1(IND,X) = ERFC(X) IF IND = 0
ERFC1(IND,X) = EXP(X*X)*ERFC(X) OTHERWISE
-----------------------------------------------------------------------
|
static double |
esum(int mu,
double x,
boolean give_log)
-----------------------------------------------------------------------
EVALUATION OF EXP(MU + X)
-----------------------------------------------------------------------
|
static double |
exparg(int l)
--------------------------------------------------------------------
IF L = 0 THEN EXPARG(L) = THE LARGEST POSITIVE W FOR WHICH
EXP(W) CAN BE COMPUTED.
|
static double |
fpser(double a,
double b,
double x,
double eps,
boolean log_p) |
static double |
gam1(double a)
------------------------------------------------------------------
COMPUTATION OF 1/GAMMA(A+1) - 1 FOR -0.5 <= A <= 1.5
------------------------------------------------------------------
|
static double |
gamln(double a)
-----------------------------------------------------------------------
Evaluation of ln(gamma(a)) for positive a
-----------------------------------------------------------------------
Written by Alfred H.
|
static double |
gamln1(double a)
-----------------------------------------------------------------------
EVALUATION OF LN(GAMMA(1 + A)) FOR -0.2 <= A <= 1.25
-----------------------------------------------------------------------
|
static double |
gammafn(double x) |
static double |
grat_r(double a,
double x,
double log_r,
double eps) |
static double |
gsumln(double a,
double b)
-----------------------------------------------------------------------
EVALUATION OF THE FUNCTION LN(GAMMA(A + B))
FOR 1 <= A <= 2 AND 1 <= B <= 2
-----------------------------------------------------------------------
|
static double |
lbeta(double a,
double b) |
static double |
lchoose(double n,
double k) |
static double |
lgamma1p(double a) |
static double |
lgammacor(double x) |
static double |
lgammafn_sign(double x,
int[] sgn) |
static double |
lgammafn(double x) |
static double |
lmvgammafn(double a,
int p)
Log of multivariate gamma function
By: Roby Joehanes
|
static double |
log1pmx(double x) |
static double |
log1px(double x)
log1px takes a double and returns a double.
|
static double |
psi(double x)
---------------------------------------------------------------------
Evaluation of the Digamma function psi(x)
-----------
Psi(xx) is assigned the value 0 when the digamma function cannot
be computed.
|
static double |
rexpm1(double x)
-----------------------------------------------------------------------
EVALUATION OF THE FUNCTION EXP(X) - 1
-----------------------------------------------------------------------
|
static double |
rlog1(double x)
-----------------------------------------------------------------------
Evaluation of the function x - ln(1 + x)
-----------------------------------------------------------------------
|
static double |
stirlerr(double n) |
static double |
trunc(double x) |
public static final double lmvgammafn(double a,
int p)
a - p - the order (or dimension)public static final double trunc(double x)
public static final double chebyshev_eval(double x,
double[] a,
int n)
x - a - n - public static final double lgammacor(double x)
public static final double lgammafn_sign(double x,
int[] sgn)
public static final double lgammafn(double x)
public static final double stirlerr(double n)
public static final double gammafn(double x)
public static final double bd0(double x,
double np)
public static final double lbeta(double a,
double b)
public static final double log1pmx(double x)
public static final double log1px(double x)
public static final double lgamma1p(double a)
public static final double[] bratio(double a,
double b,
double x,
double y,
boolean log_p)
-----------------------------------------------------------------------
Evaluation of the Incomplete Beta function I_x(a,b)
--------------------
It is assumed that a and b are nonnegative, and that x <= 1
and y = 1 - x. Bratio assigns w and w1 the values
w = I_x(a,b)
w1 = 1 - I_x(a,b)
ierr is a variable that reports the status of the results.
If no input errors are detected then ierr is set to 0 and
w and w1 are computed. otherwise, if an error is detected,
then w and w1 are assigned the value 0 and ierr is set to
one of the following values ...
ierr = 1 if a or b is negative
ierr = 2 if a = b = 0
ierr = 3 if x < 0 or x > 1
ierr = 4 if y < 0 or y > 1
ierr = 5 if x + y != 1
ierr = 6 if x = a = 0
ierr = 7 if y = b = 0
ierr = 8 "error" in bgrat()
--------------------
Written by Alfred H. Morris, Jr.
Naval Surface Warfare Center
Dahlgren, Virginia
Revised ... Nov 1991
-----------------------------------------------------------------------public static final double fpser(double a,
double b,
double x,
double eps,
boolean log_p)
public static final double apser(double a,
double b,
double x,
double eps)
public static final double bpser(double a,
double b,
double x,
double eps,
boolean log_p)
public static final double bup(double a,
double b,
double x,
double y,
int n,
double eps,
boolean give_log)
public static final double bfrac(double a,
double b,
double x,
double y,
double lambda,
double eps,
boolean log_p)
public static final double brcomp(double a,
double b,
double x,
double y,
boolean log_p)
public static final double brcmp1(int mu,
double a,
double b,
double x,
double y,
boolean give_log)
public static final double bgrat(double a,
double b,
double x,
double y,
double w,
double eps,
boolean log_w)
public static final double grat_r(double a,
double x,
double log_r,
double eps)
public static final double basym(double a,
double b,
double lambda,
double eps,
boolean log_p)
public static final double exparg(int l)
IF L = 0 THEN EXPARG(L) = THE LARGEST POSITIVE W FOR WHICH
EXP(W) CAN BE COMPUTED.
IF L IS NONZERO THEN EXPARG(L) = THE LARGEST NEGATIVE W FOR
WHICH THE COMPUTED VALUE OF EXP(W) IS NONZERO.
NOTE... ONLY AN APPROXIMATE VALUE FOR EXPARG(L) IS NEEDED.
--------------------------------------------------------------------public static final double esum(int mu,
double x,
boolean give_log)
public static final double rexpm1(double x)
public static final double alnrel(double a)
public static final double rlog1(double x)
public static final double erf__(double x)
public static final double erfc1(int ind,
double x)
public static final double gam1(double a)
public static final double gamln1(double a)
public static final double psi(double x)
---------------------------------------------------------------------
Evaluation of the Digamma function psi(x)
-----------
Psi(xx) is assigned the value 0 when the digamma function cannot
be computed.
The main computation involves evaluation of rational Chebyshev
approximations published in Math. Comp. 27, 123-127(1973) by
Cody, Strecok and Thacher.
---------------------------------------------------------------------
Psi was written at Argonne National Laboratory for the FUNPACK
package of special function subroutines. Psi was modified by
A.H. Morris (NSWC).
---------------------------------------------------------------------
public static final double betaln(double a0,
double b0)
public static final double gsumln(double a,
double b)
public static final double bcorr(double a0,
double b0)
public static final double algdiv(double a,
double b)
public static final double gamln(double a)
-----------------------------------------------------------------------
Evaluation of ln(gamma(a)) for positive a
-----------------------------------------------------------------------
Written by Alfred H. Morris
Naval Surface Warfare Center
Dahlgren, Virginia
-----------------------------------------------------------------------
public static final double beta(double a,
double b)
This function returns the value of the beta function
evaluated with arguments a and b.
NOTES
This routine is a translation into C of a Fortran subroutine
by W. Fullerton of Los Alamos Scientific Laboratory.
Some modifications have been made so that the routines
conform to the IEEE 754 standard.public static final double lchoose(double n,
double k)
public static final double choose(double n,
double k)
Copyright © 2013. All rights reserved.