java.lang.Object
de.tilman_neumann.jml.transcendental.Ln

public class Ln
extends java.lang.Object
Implementation of the natural logarithm function for BigDecimals.
  • Constructor Summary

    Constructors
    Constructor Description
    Ln()  
  • Method Summary

    Modifier and Type Method Description
    static java.math.BigDecimal ln​(java.math.BigDecimal x, Precision outPrec)  
    static java.math.BigDecimal ln​(java.math.BigDecimal x, Scale outScale)
    Compute the natural logarithm of x, for x>0.
    static java.math.BigDecimal ln2​(Scale outScale)
    Faster ln2 implementation, computing the series expansion of 2^(1/k) for some optimally chosen k.
    static void main​(java.lang.String[] argv)
    Test.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Ln

      public Ln()
  • Method Details

    • ln2

      public static java.math.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 java.math.BigDecimal ln​(java.math.BigDecimal x, Precision outPrec)
    • ln

      public static java.math.BigDecimal ln​(java.math.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​(java.lang.String[] argv)
      Test.
      Parameters:
      argv - ignored