Statistics/Normal distribution: Difference between revisions

I added a missing parenthesis by the end of line 2, and, more importantly, corrected "cos(2*Pi*u1)" to "cos(2*Pi*u2)" on line 3.
(Added solution for EDSAC)
imported>Phyjob
(I added a missing parenthesis by the end of line 2, and, more importantly, corrected "cos(2*Pi*u1)" to "cos(2*Pi*u2)" on line 3.)
Line 2,269:
{{works with|PARI/GP|2.4.3 and above}}
<syntaxhighlight lang="parigp">rnormal()={
my(u1=random(1.),u2=random(1.));
sqrt(-2*log(u1))*cos(2*Pi*u1u2)
\\ Could easily be extended with a second normal at very little cost.
};
Anonymous user