-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | The error function, erf, and related functions.
--   
--   A type class for the error function, erf, and related functions.
--   Instances for Float and Double.
@package erf
@version 2.0.0.0

module Data.Number.Erf

-- | Error function related functions.
--   
--   The derivative of <a>erf</a> is <tt> x -&gt; 2 / sqrt pi * exp
--   (x^2)</tt>, and this uniquely determines <a>erf</a> by <tt>erf 0 =
--   0</tt>.
--   
--   Minimal complete definition is <a>erfc</a> or <a>normcdf</a>.
class (Floating a) => Erf a where erf x = 1 - erfc x erfc x = 2 * normcdf (- x * sqrt 2) erfcx x = exp (x * x) * erfc x normcdf x = erfc (- x / sqrt 2) / 2
erf :: Erf a => a -> a
erfc :: Erf a => a -> a
erfcx :: Erf a => a -> a
normcdf :: Erf a => a -> a

-- | Inverse error functions, e.g., <tt>inverf . erf = id</tt> and <tt>erf
--   . inverf = id</tt> assuming the appropriate codomain for
--   <a>inverf</a>. Note that the accuracy may drop radically for extreme
--   arguments.
class (Floating a) => InvErf a where inverf p = inverfc (1 - p) inverfc p = - invnormcdf (p / 2) / sqrt 2
inverf :: InvErf a => a -> a
inverfc :: InvErf a => a -> a
invnormcdf :: InvErf a => a -> a
instance Data.Number.Erf.Erf GHC.Types.Double
instance Data.Number.Erf.Erf GHC.Types.Float
instance Data.Number.Erf.InvErf GHC.Types.Double
instance Data.Number.Erf.InvErf GHC.Types.Float
