com.hedgehog.math.functions
Class LogarithmicIntegralFunction

java.lang.Object
  extended by com.hedgehog.HObject
      extended by com.hedgehog.math.functions.Function
          extended by com.hedgehog.math.functions.LogarithmicIntegralFunction
All Implemented Interfaces:
java.lang.Comparable, java.util.Comparator

public class LogarithmicIntegralFunction
extends Function

Title: LogarithmicIntegralFunction - represents the logarithmic integral function li(x).

Description: Represents the logarithmic integral function li(x), which is sometimes referred to as the "American" definition.

The function is evaluated using the Nielsen-Ramanujan formula.

Some special case values are:

 li(0.0)      : 0.0
 li(1.0)      : -1.0E20
 li(2.0)      : 1.045163768060353
 li(1.451...) : 0.0
 

For further details refer to MathWorld.

Copyright: Copyright (c) Hedgehog Software 2007-2009.

Company: Hedgehog Software

Since:
1.0
Version:
1.1

Field Summary
protected  double mTolerance
          Tolerance used for convergence.
 
Fields inherited from class com.hedgehog.math.functions.Function
method
 
Fields inherited from class com.hedgehog.HObject
mID, mName
 
Constructor Summary
LogarithmicIntegralFunction(double tolerance)
          Constructor.
LogarithmicIntegralFunction(LogarithmicIntegralFunction object)
          Copy constructor.
 
Method Summary
 double getValue(double x)
          Evaluates li(x).
 boolean isValid()
          Tests whether or not a valid object.
 double Li(double x)
          Evaluates Li(x)=li(x)-li(2), which is sometimes referred to as the "European" definition.
 
Methods inherited from class com.hedgehog.math.functions.Function
getMethod, setMethod, toString
 
Methods inherited from class com.hedgehog.HObject
clone, compare, compareTo, copy, equals, getID, getName, hashCode, hasID, hasName, setID, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mTolerance

protected double mTolerance
Tolerance used for convergence.

Constructor Detail

LogarithmicIntegralFunction

public LogarithmicIntegralFunction(double tolerance)
Constructor.

Parameters:
tolerance - Required tolerance of accuracy of evaluation of li(x).

LogarithmicIntegralFunction

public LogarithmicIntegralFunction(LogarithmicIntegralFunction object)
Copy constructor.

Parameters:
object - Object to copy.
Method Detail

getValue

public double getValue(double x)
Evaluates li(x). Note that li(1.0) is equal to -infinity and this method returns com.hedgehog.utility.Tolerances.NEGATIVE_INFINITE.

Parameters:
x - Value at which li(x) is to evaluated.
Returns:
Evaluation of li(x).

Li

public double Li(double x)
Evaluates Li(x)=li(x)-li(2), which is sometimes referred to as the "European" definition. The value of Li(x) as x becomes large provides an estimate for pi(x), where pi(x) is the prime counting function; see MathWorld.

Parameters:
x - Value at which to evaluate Li(x).
Returns:
Evaluation of Li(x).

isValid

public boolean isValid()
Tests whether or not a valid object.

Specified by:
isValid in class Function
Returns:
Logical-true if a valid object, else logical-false.