xorshift-plus-0.1.0.0: Simple implementation of xorshift+ PRNG

Copyright(c) OSANAI Kazuyoshi 2019
LicenseBSD 3-Clause
Maintainerosmium.k@gmail.com
Stabilityexperimental
PortabilityGHC, word size 64bit
Safe HaskellNone
LanguageHaskell2010

Random.XorshiftPlus

Contents

Description

Simple implementation of xorshift+.

>>> gen <- genXorshiftPlusInt 1
>>> getInt gen
2455688531189531812
Synopsis

IO version

Generator

genXorshiftPlusWord Source #

Arguments

:: Word

random seed

-> IO XorshiftPlus 

Generate a new random state by a Word seed.

genXorshiftPlusInt Source #

Arguments

:: Int

random seed

-> IO XorshiftPlus 

Generate a new random state by an Int seed.

Values

getWord :: XorshiftPlus -> IO Word Source #

Get a new random value as Word.

getInt :: XorshiftPlus -> IO Int Source #

Get a new random value as Int.

getDouble :: XorshiftPlus -> IO Double Source #

Get a new random value as Double [0, 1.0].

Low level, ST version

data XorshiftPlusST s Source #

Random state

genXorshiftPlusWordST :: Word -> ST s (XorshiftPlusST s) Source #

Generate a new random state by a Word seed.

getWordST :: XorshiftPlusST s -> ST s Word Source #

Get a new random value as Word.

Internal

splitMix64Next :: Word# -> Word# Source #

For first return value.

>>> W# (splitMix64Next 1##)
10451216379200822465