All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class maths.SpecialMath

java.lang.Object
   |
   +----maths.SpecialMath

public final class SpecialMath
extends Object
The special function math library. This class cannot be subclassed or instantiated because all methods are static.

Version:
0.5
Author:
Mark Hale

Method Index

 o airy(double)
Airy function.
 o besselFirstOne(double)
Bessel function of first kind, order one.
 o besselFirstZero(double)
Bessel function of first kind, order zero.
 o besselSecondOne(double)
Bessel function of second kind, order one.
 o besselSecondZero(double)
Bessel function of second kind, order zero.
 o beta(double, double)
Beta function.
 o cError(double)
Complementary error function.
 o chebyshev(double, double[])
Evaluates a Chebyshev series.
 o error(double)
Error function.
 o gamma(double)
Gamma function.
 o iBeta(double, double, double)
Incomplete beta function.
 o iGamma(double, double)
Incomplete gamma function.
 o logBeta(double, double)
The natural logarithm of the beta function.
 o logGamma(double)
The natural logarithm of the gamma function.
 o mBesselFirstOne(double)
Modified Bessel function of first kind, order one.
 o mBesselFirstZero(double)
Modified Bessel function of first kind, order zero.

Methods

 o chebyshev
 public static double chebyshev(double x,
                                double series[])
Evaluates a Chebyshev series.

Parameters:
x - value at which to evaluate series
series - the coefficients of the series
 o airy
 public static double airy(double x)
Airy function. Based on the NETLIB Fortran function ai written by W. Fullerton.

 o besselFirstZero
 public static double besselFirstZero(double x)
Bessel function of first kind, order zero. Based on the NETLIB Fortran function besj0 written by W. Fullerton.

 o mBesselFirstZero
 public static double mBesselFirstZero(double x)
Modified Bessel function of first kind, order zero. Based on the NETLIB Fortran function besi0 written by W. Fullerton.

 o besselFirstOne
 public static double besselFirstOne(double x)
Bessel function of first kind, order one. Based on the NETLIB Fortran function besj1 written by W. Fullerton.

 o mBesselFirstOne
 public static double mBesselFirstOne(double x)
Modified Bessel function of first kind, order one. Based on the NETLIB Fortran function besi1 written by W. Fullerton.

 o besselSecondZero
 public static double besselSecondZero(double x)
Bessel function of second kind, order zero. Based on the NETLIB Fortran function besy0 written by W. Fullerton.

 o besselSecondOne
 public static double besselSecondOne(double x)
Bessel function of second kind, order one. Based on the NETLIB Fortran function besy1 written by W. Fullerton.

 o gamma
 public static double gamma(double x)
Gamma function. Based on public domain NETLIB (Fortran) code by W. J. Cody and L. Stoltz
Applied Mathematics Division
Argonne National Laboratory
Argonne, IL 60439

References:

  1. "An Overview of Software Development for Special Functions", W. J. Cody, Lecture Notes in Mathematics, 506, Numerical Analysis Dundee, 1975, G. A. Watson (ed.), Springer Verlag, Berlin, 1976.
  2. Computer Approximations, Hart, Et. Al., Wiley and sons, New York, 1968.

From the original documentation:

This routine calculates the GAMMA function for a real argument X. Computation is based on an algorithm outlined in reference 1. The program uses rational functions that approximate the GAMMA function to at least 20 significant decimal digits. Coefficients for the approximation over the interval (1,2) are unpublished. Those for the approximation for X .GE. 12 are from reference 2. The accuracy achieved depends on the arithmetic system, the compiler, the intrinsic functions, and proper selection of the machine-dependent constants.

Error returns:
The program returns the value XINF for singularities or when overflow would occur. The computation is believed to be free of underflow and overflow.

Returns:
Double.MAX_VALUE if overflow would occur, i.e. if abs(x) > 171.624
 o logGamma
 public static double logGamma(double x)
The natural logarithm of the gamma function. Based on public domain NETLIB (Fortran) code by W. J. Cody and L. Stoltz
Applied Mathematics Division
Argonne National Laboratory
Argonne, IL 60439

References:

  1. W. J. Cody and K. E. Hillstrom, 'Chebyshev Approximations for the Natural Logarithm of the Gamma Function,' Math. Comp. 21, 1967, pp. 198-203.
  2. K. E. Hillstrom, ANL/AMD Program ANLC366S, DGAMMA/DLGAMA, May, 1969.
  3. Hart, Et. Al., Computer Approximations, Wiley and sons, New York, 1968.

From the original documentation:

This routine calculates the LOG(GAMMA) function for a positive real argument X. Computation is based on an algorithm outlined in references 1 and 2. The program uses rational functions that theoretically approximate LOG(GAMMA) to at least 18 significant decimal digits. The approximation for X > 12 is from reference 3, while approximations for X < 12.0 are similar to those in reference 1, but are unpublished. The accuracy achieved depends on the arithmetic system, the compiler, the intrinsic functions, and proper selection of the machine-dependent constants.

Error returns:
The program returns the value XINF for X .LE. 0.0 or when overflow would occur. The computation is believed to be free of underflow and overflow.

Returns:
Double.MAX_VALUE for x < 0.0 or when overflow would occur, i.e. x > 2.55E305
 o iGamma
 public static double iGamma(double a,
                             double x)
Incomplete gamma function. The computation is based on approximations presented in Numerical Recipes, Chapter 6.2 (W.H. Press et al, 1992).

Parameters:
a - require a>=0
x - require x>=0
Returns:
0 if x<0, a<=0 or a>2.55E305 to avoid errors and over/underflow
 o beta
 public static double beta(double p,
                           double q)
Beta function.

Parameters:
p - require p>0
q - require q>0
Returns:
0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
 o logBeta
 public static double logBeta(double p,
                              double q)
The natural logarithm of the beta function.

Parameters:
p - require p>0
q - require q>0
Returns:
0 if p<=0, q<=0 or p+q>2.55E305 to avoid errors and over/underflow
 o iBeta
 public static double iBeta(double x,
                            double p,
                            double q)
Incomplete beta function. The computation is based on formulas from Numerical Recipes, Chapter 6.4 (W.H. Press et al, 1992).

Parameters:
x - require 0<=x<=1
p - require p>0
q - require q>0
Returns:
0 if x<0, p<=0, q<=0 or p+q>2.55E305 and 1 if x>1 to avoid errors and over/underflow
 o error
 public static double error(double x)
Error function. Based on C-code for the error function developed at Sun Microsystems.

 o cError
 public static double cError(double x)
Complementary error function. Based on C-code for the error function developed at Sun Microsystems.


All Packages  Class Hierarchy  This Package  Previous  Next  Index