gov.sns.tools.math
Class ElementaryFunction

java.lang.Object
  |
  +--gov.sns.tools.math.ElementaryFunction

public final class ElementaryFunction
extends java.lang.Object

Utility case for defining elementary mathemtical functions that are not, but should be, included in the java.Math class.


Field Summary
static double EPS
          small tolerance value
 
Constructor Summary
ElementaryFunction()
           
 
Method Summary
static double acosh(double x)
          Inverse hyperbolic cosine function.
static double asinh(double x)
          Inverse hyperbolic sine function.
static double atanh(double x)
          Inverse hyperbolic tangent function.
static double cosh(double x)
          Hyperbolic cosine function.
static double sinc(double x)
          sinc function = sin(x)/x For small values of x we Taylor expand the sine function to sixth order, sinc(x) = 1 - x^2/6 + x^4/120 - x^6/5040 + O(x^8) otherwise we return Math.sin(x)/x.
static double sinch(double x)
          sinch function = sinh(x)/x For small values of x we Taylor expand the hyperbolic sine function to sixth order, sinch(x) = 1 + x^2/6 + x^4/120 + x^6/5040 + O(x^8) otherwise we return sinh(x)/x.
static double sinh(double x)
          Hyperbolic sine function.
static double tanh(double x)
          Hyperbolic tangent function.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EPS

public static final double EPS
small tolerance value

See Also:
Constant Field Values
Constructor Detail

ElementaryFunction

public ElementaryFunction()
Method Detail

sinc

public static double sinc(double x)
sinc function = sin(x)/x For small values of x we Taylor expand the sine function to sixth order, sinc(x) = 1 - x^2/6 + x^4/120 - x^6/5040 + O(x^8) otherwise we return Math.sin(x)/x.

Parameters:
x - any real number

sinch

public static double sinch(double x)
sinch function = sinh(x)/x For small values of x we Taylor expand the hyperbolic sine function to sixth order, sinch(x) = 1 + x^2/6 + x^4/120 + x^6/5040 + O(x^8) otherwise we return sinh(x)/x.

Parameters:
x - any real number

sinh

public static final double sinh(double x)
Hyperbolic sine function. This should really be included in Java.

Parameters:
x - any real number

cosh

public static final double cosh(double x)
Hyperbolic cosine function. This too.

Parameters:
x - any real number

tanh

public static final double tanh(double x)
Hyperbolic tangent function.


asinh

public static final double asinh(double x)
Inverse hyperbolic sine function.

Parameters:
x - any real number

acosh

public static final double acosh(double x)
                          throws java.lang.IllegalArgumentException
Inverse hyperbolic cosine function. Note that due to the nature of the hyperbolic cosine function the argument must be greater than 1.0.

Parameters:
x - a real number in the interval [1,+inf)
Throws:
java.lang.IllegalArgumentException - argument value is outside the domain of definition

atanh

public static final double atanh(double x)
                          throws java.lang.IllegalArgumentException
Inverse hyperbolic tangent function. Note that do to the nature of the inverse hyperbolic tangent function overflow may occur for arguments close to the values -1 and 1.

Parameters:
x - a real number in the open interval (-1,1)
Throws:
java.lang.IllegalArgumentException - argument value is outside the domain of definition