Commit 13e2f4a9 authored by ghc@cainnorris.net's avatar ghc@cainnorris.net
Browse files

FIX #4228 (atanh (-1) returns NaN instead of -Infinity)

parent 8e812825
......@@ -198,4 +198,4 @@ instance (RealFloat a) => Floating (Complex a) where
asinh z = log (z + sqrt (1+z*z))
acosh z = log (z + (z+1) * sqrt ((z-1)/(z+1)))
atanh z = log ((1+z) / sqrt (1-z*z))
atanh z = 0.5 * log ((1.0+z) / (1.0-z))
......@@ -249,7 +249,7 @@ instance Floating Float where
asinh x = log (x + sqrt (1.0+x*x))
acosh x = log (x + (x+1.0) * sqrt ((x-1.0)/(x+1.0)))
atanh x = log ((x+1.0) / sqrt (1.0-x*x))
atanh x = 0.5 * log ((1.0+x) / (1.0-x))
instance RealFloat Float where
floatRadix _ = FLT_RADIX -- from float.h
......@@ -331,7 +331,7 @@ instance Floating Double where
asinh x = log (x + sqrt (1.0+x*x))
acosh x = log (x + (x+1.0) * sqrt ((x-1.0)/(x+1.0)))
atanh x = log ((x+1.0) / sqrt (1.0-x*x))
atanh x = 0.5 * log ((1.0+x) / (1.0-x))
{-# RULES "truncate/Double->Int" truncate = double2Int #-}
instance RealFrac Double where
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment