Class Erf


  • public final class Erf
    extends java.lang.Object
    Error function.

    \[ \operatorname{erf}(z) = \frac{2}{\sqrt\pi}\int_0^z e^{-t^2}\,dt \]

    • Constructor Summary

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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static double value​(double x)
      Returns the error function.
      • Methods inherited from class java.lang.Object

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

      • Erf

        private Erf()
        Private constructor.
    • Method Detail

      • value

        public static double value​(double x)
        Returns the error function.

        The returned value is always between -1 and 1 (inclusive). The appropriate extreme is returned when erf(x) is indistinguishable from either -1 or 1 at double precision.

        Special cases:

        • If the argument is 0, then the result is 0.
        • If the argument is > 6, then the result is 1.
        • If the argument is < 6, then the result is -1.
        • If the argument is nan, then the result is nan.
        Parameters:
        x - the value.
        Returns:
        the error function.