haskell / haskell/mwc-random

simpler version of MWC256?

Open
#33 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
61
Forks
27
PR merge metrics
No merged PRs in 30d

Description

I found a different (simpler) version of MWC256 that George Marsaglia himself posted on the internet. It has the same 2^8222 period and Marsaglia vetted the quality of the PRNG as well. The version that we currently use comes from Feb 25, 2003 https://groups.google.com/d/msg/sci.math/k3kVM8KwR-s/jxPdZl8XWZkJ:

```
static unsigned long Q[256],c=362436;
unsigned long MWC256(void){
unsigned long long t,a=1540315826LL;
unsigned long x;
static unsigned char i=255;
t=a*Q[++i]+c; c=(t>>32);
x=t+c; if(x>32);
return(Q[i]=t); }
```

Why was the first version chosen for mwc-random?

Contributor guide

No contributing guide indexed for this repository

Research direction

Read the two George Marsaglia references included in the issue and compare them with the current MWC256 implementation in mwc-random. Establish why the existing version was selected and whether the simpler variant is suitable; done requires a documented decision, not merely a code change.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, haskell
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.