diff --git a/include/instances.h b/include/instances.h index a1235d9..1e1bb81 100644 --- a/include/instances.h +++ b/include/instances.h @@ -97,9 +97,9 @@ instance BODY1(RealFrac a) => RealFrac (HEAD) where instance BODY1(Erf a) => Erf (HEAD) where erf = lift1 erf $ \x -> (2 / sqrt pi) * exp (negate x * x) erfc = lift1 erfc $ \x -> ((-2) / sqrt pi) * exp (negate x * x) - normcdf = lift1 normcdf $ \x -> ((-1) / sqrt pi) * exp (x * x * fromRational (- recip 2) / sqrt (2)) + normcdf = lift1 normcdf $ \x -> (recip $ sqrt (2 * pi)) * exp (- x * x / 2) instance BODY1(InvErf a) => InvErf (HEAD) where - inverf = lift1 inverfc $ \x -> recip $ (2 / sqrt pi) * exp (negate x * x) - inverfc = lift1 inverfc $ \x -> recip $ negate (2 / sqrt pi) * exp (negate x * x) - invnormcdf = lift1 invnormcdf $ \x -> recip $ ((-1) / sqrt pi) * exp (x * x * fromRational (- recip 2) / sqrt 2) + inverf = lift1_ inverf $ \x _ -> sqrt pi / 2 * exp (x * x) + inverfc = lift1_ inverfc $ \x _ -> negate (sqrt pi / 2) * exp (x * x) + invnormcdf = lift1_ invnormcdf $ \x _ -> sqrt (2 * pi) * exp (x * x / 2)