|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--statistic.Mathematic
Field Summary |
Fields inherited from interface statistic.ComputerArithmetic |
MACHEP, MAXGAM, MAXLOG, MAXNUM, MAXSTIR, MINLOG, P, P0, P1, P2, Q, Q0, Q1, Q2, s2pi, SQTPI, STIR |
Constructor Summary | |
Mathematic()
|
Method Summary | |
static double |
factorial(double n)
Method factorial : Factorial function: compute factorial of n |
static double |
gamma(double x)
Returns the Gamma function of a double. |
static double |
gcf(double a,
double x)
Returns the incomplete gamma function Q(a,x) evaluated by its continued fraction representation as gammcf. |
static double |
gser(double a,
double x)
Returns the incomplete gamma function P(a,x) evaluated by its series representation as gamser |
static double |
incompleteGamma(double a,
double x)
left tail of incomplete gamma function: inf. |
static double |
incompleteGammaComplemented(double a,
double x)
|
static double |
incompleteGammaComplementedInverse(double a,
double y0)
Inverse of complemented imcomplete gamma integral |
static double |
invNormal(double y0)
Inverse of Normal distribution function |
static double |
lnGamma(double xx)
Returns the logarithm of the Gamma function of a double. |
static void |
main(java.lang.String[] args)
Methode: Main pour tester la classe |
static int |
pgcd(int a,
int b)
Method pgcd : calcule le PGCD de 2 entiers passes en arguments (on utilisera le fait que le PGCD de 2 nbs divise le reste de la divisionm de ces 2 nombres en iterant) |
static double |
pol1Eval(double x,
double[] coef,
int N)
Evaluate polynomial when coefficient of x^N is 1.0 => Cn=1. |
static double |
polEval(double x,
double[] coef,
int N)
Evaluate polynomial |
static int |
ppcm(int a,
int b)
Calcule le PPCM de deux entiers passes en arguments |
static int |
ppcmComplex(int[] nbs)
Method ppcmComplex : to compute the MCM(Minimum Commun Multiple) of a table of int Property: MCM(A,B,C) = MCM( MCM(A,B),C).... |
static double |
stirlingFormula(double x)
Gamma function computed by Stirling's formula. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Mathematic()
Method Detail |
public static double polEval(double x, double[] coef, int N)
x
- : valueN
- : degree
y = polEval( x, coef, N );
DESCRIPTION:
Evaluates polynomial of degree N:
y(x) = C + C x + C x^2 +...+ C x^N
0 1 2 N
Coefficients are stored in reverse order:
coef[0] = C , ..., coef[N] = C .
N 0
The function p1evl() assumes that coef[N] = 1.0 and is
omitted from the array. Its calling arguments are
otherwise the same as polevl().
SPEED:
In the interest of speed, there are no checks for out
of bounds arithmetic. This routine is used by most of
the functions in the library. Depending on available
equipment features, the user may wish to rewrite the
program in microcode or assembly language.
Cephes Math Library Release 2.1: December, 1988
Copyright 1984, 1987, 1988 by Stephen L. Moshier
Direct inquiries to 30 Frost Street, Cambridge, MA 02140public static double pol1Eval(double x, double[] coef, int N) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static double invNormal(double y0)
public static double incompleteGammaComplementedInverse(double a, double y0)
a
- y0
- DESCRIPTION:
Given p, the function finds x such that
incompleteGammaComplemented( a, x ) = p.
Starting with the approximate value
x = a t^3
where :
t = 1 - d - invNormal(p) sqrt(d) and d = 1/9a,
It performs up to 10 Newton iterations to find the
root of incompleteGammaComplemented(a,x) - p = 0.
ACCURACY:
Tested at random a, p in the intervals indicated.
a p Relative error:
arithmetic domain domain # trials peak rms
IEEE 0.5,100 0,0.5 100000 1.0e-14 1.7e-15
IEEE 0.01,0.5 0,0.5 100000 9.0e-14 3.4e-15
IEEE 0.5,10000 0,0.5 20000 2.3e-13 3.8e-14
Cephes Math Library Release 2.8: June, 2000
Copyright 1984, 1987, 1995, 2000 by Stephen L. Moshierpublic static double incompleteGammaComplemented(double a, double x)
public static double incompleteGamma(double a, double x)
public static double lnGamma(double xx) throws java.lang.IllegalArgumentException
xx
- A double value
Returns the value of ln[Gamma(xx)] for xx>0
Methodes takes from NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING
If x is a negative integer, the result is NaN.
java.lang.IllegalArgumentException
public static double gamma(double x)
x
- A double value.
public static double gser(double a, double x) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static double gcf(double a, double x) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public static double stirlingFormula(double x)
public static double factorial(double n) throws java.lang.IllegalArgumentException
n
- it'a a long
java.lang.IllegalArgumentException
public static int pgcd(int a, int b)
a
- b
-
public static int ppcm(int a, int b)
a
- an intb
- an int
public static int ppcmComplex(int[] nbs)
nbs
-
public static void main(java.lang.String[] args)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |