Functional importance sampler with pretty-good importance
Functional importance sampler with pretty-good importance

Yay, it works. I'm not sure what was wrong before.
I think I might have still have 'continue' in the i==j case?
Anyway, it's getting the correct average now.

This sampler isn't sampling with the exactly-correct probability,
but it's not bad. It's better than choosing i 'correctly' and then
choosing 'j' uniformly.

essex-edwards/precondition-add