summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libraries/base/GHC/Float.hs12
-rw-r--r--testsuite/tests/numeric/should_run/all.T2
2 files changed, 11 insertions, 3 deletions
diff --git a/libraries/base/GHC/Float.hs b/libraries/base/GHC/Float.hs
index c534bafa07..d60c660bd0 100644
--- a/libraries/base/GHC/Float.hs
+++ b/libraries/base/GHC/Float.hs
@@ -367,7 +367,11 @@ instance Floating Float where
(**) x y = powerFloat x y
logBase x y = log y / log x
- asinh x = log (x + sqrt (1.0+x*x))
+ asinh x
+ | x > huge = log 2 + log x
+ | x < 0 = -asinh (-x)
+ | otherwise = log (x + sqrt (1 + x*x))
+ where huge = 1e10
acosh x = log (x + (x+1.0) * sqrt ((x-1.0)/(x+1.0)))
atanh x = 0.5 * log ((1.0+x) / (1.0-x))
@@ -492,7 +496,11 @@ instance Floating Double where
(**) x y = powerDouble x y
logBase x y = log y / log x
- asinh x = log (x + sqrt (1.0+x*x))
+ asinh x
+ | x > huge = log 2 + log x
+ | x < 0 = -asinh (-x)
+ | otherwise = log (x + sqrt (1 + x*x))
+ where huge = 1e20
acosh x = log (x + (x+1.0) * sqrt ((x-1.0)/(x+1.0)))
atanh x = 0.5 * log ((1.0+x) / (1.0-x))
diff --git a/testsuite/tests/numeric/should_run/all.T b/testsuite/tests/numeric/should_run/all.T
index 9f2f52a0fb..37fff44bde 100644
--- a/testsuite/tests/numeric/should_run/all.T
+++ b/testsuite/tests/numeric/should_run/all.T
@@ -41,7 +41,7 @@ test('arith018', normal, compile_and_run, [''])
test('arith019', normal, compile_and_run, [''])
test('expfloat', normal, compile_and_run, [''])
-test('FloatFnInverses', expect_broken(14927), compile_and_run, [''])
+test('FloatFnInverses', normal, compile_and_run, [''])
test('T1603', skip, compile_and_run, [''])
test('T3676', expect_broken(3676), compile_and_run, [''])