Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Random-numbers/PARI-GP/random-numbers.parigp
Normal file
6
Task/Random-numbers/PARI-GP/random-numbers.parigp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
rnormal()={
|
||||
my(pr=32*ceil(default(realprecision)*log(10)/log(4294967296)),u1=random(2^pr)*1.>>pr,u2=random(2^pr)*1.>>pr);
|
||||
sqrt(-2*log(u1))*cos(2*Pi*u2) \\ in previous version "u1" instead of "u2" was used --> has given crap distribution
|
||||
\\ Could easily be extended with a second normal at very little cost.
|
||||
};
|
||||
vector(1000,unused,rnormal()/2+1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue