Tractables/Dice.jl

this should be given path condition too

Closed this issue · 1 comments

https://github.com/Juice-jl/Dice.jl/blob/e28346c910f8e0a9bb0a9a1f13e2ed681e247f86/src/dist/integer/uint.jl#L450

    # for prime in primes_at_most(max_hi)
    #     prod *= prime ^ floor_log(prime, max_hi)
    # end
    prod = lcm([BigInt(x) for x in keys(pr(hi)) if x != 0]) # TODO: this should be given path condition too
    u = uniform(DistUInt{ndigits(prod, base=2)}, 0, prod)
    rem_trunc(u, hi)
end

flip_reciprocal(x) = prob_equals(DistUInt32(0), Dice.unif_half(x))

Closed in 407aefe