Skip to content
Snippets Groups Projects
Commit bca01968 authored by Andreas Klebinger's avatar Andreas Klebinger
Browse files

Adjust integrate output for ghc-9

ghc-9 introduces a regression(?) in FP precision (See ghc ticket #19569).
While this is unfortunate we want nofib to be useable with ghc 8.10 and
9.0 as far as possible.

So I added an additional argument to the benchmark which controls if we
output the benchmark result or not, which is off by default.

This allows easy checking of the output manually without causing
benchmark errors because the output differs.

I've also added the benchmark to the ghc testsuite to avoid future
regressions.
parent 2341139a
No related branches found
No related tags found
1 merge request!47Adjust integrate output for ghc-9
Pipeline #49916 passed
......@@ -17,8 +17,8 @@ integrate1D l u f =
(f u)*0.5]
integrate2D l1 u1 l2 u2 f = integrate1D l2 u2
(\y->integrate1D l1 u1
(\x->f x y))
(\y->integrate1D l1 u1
(\x->f x y))
zark u v = integrate2D 0.0 u 0.0 v (\x->(\y->x*y))
......@@ -37,7 +37,7 @@ etotal n = sum (take n es)
-- The (analytical) result should be zero
main = do
[range] <- getArgs
putStrLn $ show $ etotal $ read range
[with_output,range] <- getArgs
if (read with_output)
then putStrLn $ show $ etotal $ read range
else seq (etotal $ read range) (putStrLn "Exact result hidden for lack of stability.\nPass 'True' as first argument to the benchmark if you want to view the computed output for testing purposes.")
......@@ -4,6 +4,6 @@ include $(TOP)/mk/boilerplate.mk
-include opts.mk
include $(TOP)/mk/target.mk
FAST_OPTS = 100000
NORM_OPTS = 1000000
SLOW_OPTS = 5000000
FAST_OPTS = False 100000
NORM_OPTS = False 1000000
SLOW_OPTS = False 5000000
0.0
1.3615586841036482e34
9.093955583391733e28
Exact result hidden for lack of stability.
Pass 'True' as first argument to the benchmark if you want to view the computed output for testing purposes.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment