Add hyperbolic functions to test of Float-inverses
authorJustus Sagemüller <sagemueller@geo.uni-koeln.de>
Wed, 28 Mar 2018 12:44:51 +0000 (14:44 +0200)
committerBen Gamari <ben@smart-cactus.org>
Sun, 6 May 2018 00:28:18 +0000 (20:28 -0400)
The area hyperbolic sine is currently broken,
see https://ghc.haskell.org/trac/ghc/ticket/14927.

testsuite/tests/numeric/should_run/FloatFnInverses.hs
testsuite/tests/numeric/should_run/FloatFnInverses.stdout
testsuite/tests/numeric/should_run/all.T

index 773790e..13bf873 100644 (file)
@@ -20,6 +20,15 @@ main = mapM_ print
    -- @tan@ is invertible on @]-π/4…π/4[ <-> ]-∞…∞[@.
  , invDeviation @Double tan atan <$> [-0.7, -0.6 .. 0.7]
  , invDeviation @Float  tan atan <$> [-0.7, -0.6 .. 0.7]
+   -- @sinh@ is invertible on @ℝ <-> ℝ@, but grows very fast.
+ , invDeviation @Double sinh asinh <$> [-700, -672 .. 700]
+ , invDeviation @Float  sinh asinh <$> [-80, -71 .. 80]
+   -- @cosh@ is invertible on @[0…∞[ <-> [1…∞[@, but grows fast
+ , invDeviation @Double cosh acosh <$> [0, 15 .. 700]
+ , invDeviation @Float  cosh acosh <$> [0, 15 .. 80]
+   -- @tanh@ is invertible on @ℝ <-> ]-1…1[@.
+ , invDeviation @Double atanh tanh <$> [-0.99, -0.87 .. 0.9]
+ , invDeviation @Float  atanh tanh <$> [-0.99, -0.87 .. 0.9]
  ]
 
 invDeviation :: KnownNumDeviation a
index 7fa3691..2d019b8 100644 (file)
@@ -8,3 +8,9 @@
 [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
 [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
 [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
+[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
+[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
+[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
+[0.0,0.0,0.0,0.0,0.0,0.0]
+[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
+[0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0]
index 37fff44..9f2f52a 100644 (file)
@@ -41,7 +41,7 @@ test('arith018', normal, compile_and_run, [''])
 test('arith019', normal, compile_and_run, [''])
 test('expfloat', normal, compile_and_run, [''])
 
-test('FloatFnInverses', normal, compile_and_run, [''])
+test('FloatFnInverses', expect_broken(14927), compile_and_run, [''])
 
 test('T1603', skip, compile_and_run, [''])
 test('T3676', expect_broken(3676), compile_and_run, [''])