public final class SpecialFunctions
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
protected static double |
lastLPX |
|
protected static double[] |
lp |
|
protected static int |
maxLPN |
Modifier and Type | Method | Description |
---|---|---|
static double |
besselI(double order,
double x) |
The modified Bessel function of the first kind, I
Reference: http://mathworld.wolfram.com/ModifiedBesselFunctionoftheFirstKind.html
|
static double |
besselJ(double order,
double x) |
The unmodified Bessel function of the first kind, J.
|
static double |
calcLegendrePolynomial(int n,
double x) |
Calculates Pn(x), Legendre polynomial of order n for the given input value.
|
static double |
confluentHypergeometric1F1(double a,
double c,
double xin) |
The confluent hypergeometric function, usually given the symbol 1F1.
|
static double |
erfc(double x) |
Complementary error function, computed using the approximant 7.1.26 of Abramowitz & Stegun.
|
static long |
factorial(int n) |
The factorial function, n! Will overflow with any input value greater than 20.
|
static double |
gamma(double x) |
Returns the value of the gamma function of x.
|
static double |
lnFactorial(int n) |
The log of the factorial function, ln(n!).
|
static double |
lnGamma(double x) |
Returns the ln(gamma), the natural logarithm of the gamma function.
|
static void |
main(java.lang.String[] args) |
protected static double[] lp
protected static double lastLPX
protected static int maxLPN
public static double erfc(double x)
Erf.erfc(double)
, which is more accurate
but substantially slower (~10x - 100x) than the method given here.x
- argument to function, may take values from Double.NEGATIVE_INFINITY to Double.POSITIVE_INFINITY.public static long factorial(int n)
n
- an integer greater than or equal to 0java.lang.IllegalArgumentException
- if n < 0public static double lnFactorial(int n)
n
- an integer greater than or equal to 0java.lang.IllegalArgumentException
- if n < 0public static double lnGamma(double x)
x
- a real number. If x is a non-positive integer (or if gamma(x) is negative), then NaN is returned.public static double gamma(double x)
x
- a real number.public static double confluentHypergeometric1F1(double a, double c, double xin)
public static double calcLegendrePolynomial(int n, double x)
n
- order of the polynomial; must be non-negative.x
- argument of the polynomial.java.lang.IllegalArgumentException
- if n < 0.public static double besselI(double order, double x)
order
- of the Bessel functionx
- the argument of the Bessel functionpublic static double besselJ(double order, double x)
order
- of the Bessel functionx
- the argument of the Bessel functionpublic static void main(java.lang.String[] args)