Monte Carlo methods: Difference between revisions

m
Line 1,307:
where
rnd = randomRIO (0, 1) :: IO Double
go a x =
go a x = rnd >>= (\rx -> rnd >>= (pure . flip (f rx) a))
f x y
| 1 > x ** 2 + y ** 2 = succ
9,659

edits