https://github.com/JuliaLang/julia/pull/17627 adds MethodError domain checks that you cannot call randn or randexp for any types besides the currently supported Float16,Float32,Float64.
Do we also want to extend support to BigFloat? I don't know much about, but I've left TODO code comments in https://github.com/JuliaLang/julia/pull/17627#issuecomment-235198088 asking to consider this question.
This is a tracking issue for that discussion.
x-ref #13950
I wonder what bits of the Marsaglia and Tsang paper need to be reworked to do this right.
cf http://randomlib.sourceforge.net/html/index.html, which has an MIT/X11 license.
Also http://exrandom.sourceforge.net/
and the paper http://arxiv.org/abs/1303.6257
Looks like MPFR implements the cited paper: https://gforge.inria.fr/scm/viewvc.php/mpfr/trunk/src/nrandom.c?view=markup. Any reason we don't just hook this up?
Seems like a good project for someone to tackle!
Any reason we don't just hook this up?
I guess this would be easy, but AFAIU, MPFR doesn't allow to pass our own random RNGs. So if we want to do this, we should IMHO first wrap GMP RNG into a proper Julia type, and then provide only randn(::GMP_RNG, ...).
Or patch GMP to allow arbitrary RNGs鈥攖hat might not be so hard and I bet they'd accept a patch.
bump! this is sorely missing. anyone looking for a project could try this.
AFAIU, MPFR doesn't allow to pass our own random RNGs
Actually I was wrong (unless this changed recently), you can pass your RNG, albeit in a quite involved way.
Most helpful comment
Looks like MPFR implements the cited paper: https://gforge.inria.fr/scm/viewvc.php/mpfr/trunk/src/nrandom.c?view=markup. Any reason we don't just hook this up?