Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions bench/Benchmark.hs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import Data.Proxy
import qualified Data.Vector.Unboxed as U
import qualified System.Random as R
import System.Random.Stateful (StatefulGen)

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.2.8 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.12.1 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.12.1 [1.2]

The import of ‘System.Random.Stateful’ is redundantbench/Benchmark.hs:53:3: warning

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.2.2 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.2.2 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.12.1 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.12.1 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.8.4 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.8.4 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.4.4 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.4.4 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.6.5 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.6.5 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.10.1 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.10.1 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.8.4 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.8.4 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.6.5 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.6.5 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 9.0.2 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.8 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.8 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.4.4 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.4.4 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.4.8 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 8.4.4 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.2.2 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.2.2 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 8.10.7 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.6 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.6 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 8.6.5 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.6.6 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.8 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.8 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.8.4 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 8.8.4 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.6 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.6 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.8.4 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.8.4 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.0.2 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.8.4 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.8.4 [1.2]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.0.2 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.0.2 [1.3]

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.2.8 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.4.8 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.12.1 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.6.6 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.10.1 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 8.10.7 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 8.8.4 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 8.6.5 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 8.4.4 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.10.1 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.12.1 []

The import of ‘System.Random.Stateful’ is redundant

Check warning on line 11 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.8.4 []

The import of ‘System.Random.Stateful’ is redundant
import System.Random.MWC
import System.Random.MWC.Distributions
import System.Random.MWC.CondensedTable
Expand Down Expand Up @@ -50,7 +50,7 @@
let iter = lookupOption opts
-- Set up RNG
mwc <- create
seed <- save mwc

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.2.8 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.12.1 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.2.2 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.2.2 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.8.4 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.8.4 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.4.4 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.4.4 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.6.5 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.6.5 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 9.0.2 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.4.8 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 8.4.4 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 8.10.7 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.6 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.6 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 8.6.5 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.6.6 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.8 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.8 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.8.4 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-13 / ghc 8.8.4 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.0.2 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.8.4 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.8.4 [1.2]

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.0.2 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.2.8 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.4.8 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.12.1 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.6.6 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.10.1 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 8.10.7 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 8.8.4 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 8.6.5 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 8.4.4 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.10.1 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.12.1 []

Defined but not used: ‘seed’

Check warning on line 53 in bench/Benchmark.hs

View workflow job for this annotation

GitHub Actions / windows-latest / ghc 9.8.4 []

Defined but not used: ‘seed’
mtg <- M.newMTGen . Just =<< uniform mwc
defaultMainWithIngredients ingredients $ bgroup "All"
[ bgroup "mwc"
Expand Down Expand Up @@ -93,6 +93,7 @@
, bench "exponential" $ whnfIO $ loop iter (exponential 3 mwc :: IO Double)
, bench "gamma,a<1" $ whnfIO $ loop iter (gamma 0.5 1 mwc :: IO Double)
, bench "gamma,a>1" $ whnfIO $ loop iter (gamma 2 1 mwc :: IO Double)
, bench "beta" $ whnfIO $ loop iter (beta 2 3 mwc :: IO Double)
, bench "chiSquare" $ whnfIO $ loop iter (chiSquare 4 mwc :: IO Double)
-- NOTE: We switch between algorithms when Np=10
, bgroup "binomial"
Expand All @@ -106,10 +107,6 @@
, (6000, 0.2), (6000, 0.8)
]
]
, bench "beta binomial 10" $ whnfIO $ loop iter (betaBinomial 600 400 10 mwc :: IO Int)
, bench "beta binomial 100" $ whnfIO $ loop iter (betaBinomial 600 400 100 mwc :: IO Int)
, bench "beta binomial table 10" $ whnfIO $ loop iter (betaBinomialTable 600 400 10 mwc :: IO Int)
, bench "beta binomial table 100" $ whnfIO $ loop iter (betaBinomialTable 600 400 100 mwc :: IO Int)
]
-- Test sampling performance. Table creation must be floated out!
, bgroup "CT/gen" $ concat
Expand Down Expand Up @@ -158,13 +155,3 @@
]
#endif
]

betaBinomial :: StatefulGen g m => Double -> Double -> Int -> g -> m Int
betaBinomial a b n g = do
p <- beta a b g
binomial n p g

betaBinomialTable :: StatefulGen g m => Double -> Double -> Int -> g -> m Int
betaBinomialTable a b n g = do
p <- beta a b g
genFromTable (tableBinomial n p) g
2 changes: 1 addition & 1 deletion mwc-random.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ library
, vector >= 0.7
, math-functions >= 0.2.1.0

ghc-options: -Wall -funbox-strict-fields -fwarn-tabs
ghc-options: -O2 -Wall -funbox-strict-fields -fwarn-tabs


-- We want to be able to build benchmarks using both tasty-bench and tasty-papi.
Expand Down
Loading