Class Ln
- java.lang.Object
-
- de.tilman_neumann.jml.transcendental.Ln
-
public class Ln extends Object
Implementation of the natural logarithm function for BigDecimals.- Author:
- Tilman Neumann
-
-
Constructor Summary
Constructors Constructor Description Ln()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigDecimal
ln(BigDecimal x, Precision outPrec)
static BigDecimal
ln(BigDecimal x, Scale outScale)
Compute the natural logarithm of x, for x>0.static BigDecimal
ln2(Scale outScale)
Faster ln2 implementation, computing the series expansion of 2^(1/k) for some optimally chosen k.static void
main(String[] argv)
Test.
-
-
-
Method Detail
-
ln2
public static BigDecimal ln2(Scale outScale)
Faster ln2 implementation, computing the series expansion of 2^(1/k) for some optimally chosen k.- Parameters:
outScale
- Wanted precision in after-comma decimal digits- Returns:
- ln(2)
-
ln
public static BigDecimal ln(BigDecimal x, Precision outPrec)
-
ln
public static BigDecimal ln(BigDecimal x, Scale outScale)
Compute the natural logarithm of x, for x>0. This algorithm takes the reciprocal of x>1 and then uses the simple reduction, followed by an AGM reduction. The fastest algorithm for all number ranges.- Parameters:
x
-outScale
-- Returns:
- ln(x)
-
main
public static void main(String[] argv)
Test.- Parameters:
argv
- ignored
-
-