Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/syocy/xorshift-plus
Simple implementation of xofshift+ PRNG in Haskell
https://github.com/syocy/xorshift-plus
haskell prng random xorshift
Last synced: about 2 months ago
JSON representation
Simple implementation of xofshift+ PRNG in Haskell
- Host: GitHub
- URL: https://github.com/syocy/xorshift-plus
- Owner: syocy
- License: bsd-3-clause
- Created: 2019-01-21T17:59:40.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-03-21T01:12:40.000Z (almost 6 years ago)
- Last Synced: 2023-08-20T06:17:38.818Z (over 1 year ago)
- Topics: haskell, prng, random, xorshift
- Language: Haskell
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# xorshift-plus
Simple implementation of xorshift+.
```haskell
import Random.XorshiftPlus
main = do
s <- genXorshiftPlusInt 1
i <- getInt s
print i -- 2455688531189531812
```## Performance
```
> cabal new-run --enable-benchmarks micro -- compareWithOtherPRNGs --small
Up to date
compareWithOtherPRNGs/xorshift-plus_Int (THIS PACKAGE) mean 10.63 μs ( +- 40.63 ns )
compareWithOtherPRNGs/xorshift-plus_Word (THIS PACKAGE) mean 10.72 μs ( +- 36.54 ns )
compareWithOtherPRNGs/xorshift_Int32 mean 250.5 μs ( +- 917.1 ns )
compareWithOtherPRNGs/xorshift_Ina64 mean 457.1 μs ( +- 1.070 μs )
compareWithOtherPRNGs/Xorshift128Plus_Word64 mean 24.61 μs ( +- 111.9 ns )
```