Closed yuriy0 closed 7 years ago
expected: fn x2 real: x1 <~ uniform(nat2real(0), nat2real(1)) x0 <~ uniform(nat2real(0), nat2real(1)) if if nat2real(0) < x2 / (x0 + x1): x2 / (x0 + x1) < nat2real(1) else: false: weight(1/ real2prob(x0 + x1), return ()) else: reject. measure(unit) but got: fn x2 real: if +1/1 <= x2 && x2 < +2/1: weight (real2prob (log(real2prob(x2)) * (-2/1) + x2 + log(2/1) * (+2/1) + (-2/1)), return ()) else: if +0/1 < x2 && x2 < +1/1: weight(real2prob(log(2/1) * (+2/1) + x2 * (-1/1)), return ()) else: reject. measure(unit)
and
The new result is clearly more efficient as a sampler, so if somebody can confirm they are the same measure (it seems to me they are) I think this result should be accepted.
Confirmed. Nice.
(These two expected/got pairs are identical.)
expected
got
and
The new result is clearly more efficient as a sampler, so if somebody can confirm they are the same measure (it seems to me they are) I think this result should be accepted.