How to sample from an hypergeometric distribution mathematically?

57 Views Asked by At

There are lots of implementations of functions that sample from hypergeometric distributions and they use these 2 constants:

    D1 = 1.7155277699214135
    D2 = 0.8989161620588988

an example is here:

http://project-thrill.org/docs/master/classthrill_1_1common_1_1hypergeometric__distribution.html

All of these examples use the function names hypergeometric_hyp and hypergeometric_hrua:

◆ rk_hypergeometric_hyp()
◆ rk_hypergeometric_hrua()

what are them, where I can read about the theory behind this implementation? What's the difference between hyp and hrua?