Sampling from non-analytical distribution in C++

Right now, it seems to me that using nutpie with ctypes remains the only optimal solution.

Thank you all for your help and the time you’ve spent on my problem!