BAPCtools icon indicating copy to clipboard operation
BAPCtools copied to clipboard

Implemented more efficient binomial sampling

Open mzuenni opened this issue 2 years ago • 2 comments

mzuenni avatar Jul 04 '22 23:07 mzuenni

Hmm, this is a lot of extra code. Is it really needed? Anyway it needs some more explanation ideally.

RagnarGrootKoerkamp avatar Jul 05 '22 00:07 RagnarGrootKoerkamp

I don't know if it's really useful. I recently implemented this and remembered that validation.h uses naive sampling. This seems to be the shortest algorithm which is efficient. Giving more explanations is a bit difficult for this algorithm... it has many magic constants. However, the referenced paper has pseudocode which is pretty detailed and this implementation exactly matches that.

mzuenni avatar Jul 05 '22 01:07 mzuenni

I will close this for now. If we ever want faster binomial sampling we can still copy the code from my implementation (which by now is more or less the implementation of python)

mzuenni avatar Dec 31 '23 16:12 mzuenni