Class ErfDifference


  • public final class ErfDifference
    extends java.lang.Object
    Computes the difference between error function values.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static double X_CRIT
      This number solves erf(x) = 0.5 within 1 ulp.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ErfDifference()
      Private constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double value​(double x1, double x2)
      The implementation uses either Erf or Erfc, depending on which provides the most precise result.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • X_CRIT

        private static final double X_CRIT
        This number solves erf(x) = 0.5 within 1 ulp. More precisely, the current implementations of Erf.value(double) and Erfc.value(double) satisfy:
        • Erf.value(X_CRIT) == 0.5,
        • Erf.value(Math.nextUp(X_CRIT)) > 0.5,
        • Erfc.value(X_CRIT) == 0.5, and
        • Erfc.value(Math.nextUp(X_CRIT)) < 0.5
        See Also:
        Constant Field Values
    • Constructor Detail

      • ErfDifference

        private ErfDifference()
        Private constructor.
    • Method Detail

      • value

        public static double value​(double x1,
                                   double x2)
        The implementation uses either Erf or Erfc, depending on which provides the most precise result.
        Parameters:
        x1 - First value.
        x2 - Second value.
        Returns:
        Erf.value(x2) - Erf.value(x1).
        Throws:
        java.lang.ArithmeticException - if the algorithm fails to converge.