janet-lang / spork

Various Janet utility modules - the official "Contrib" library.
MIT License
117 stars 35 forks source link

Feature: Add a Gaussian sampler #171

Closed hyiltiz closed 6 months ago

hyiltiz commented 7 months ago

This adds a Gaussian sampler that exposes a similar interface to spork/rand-uniform, that is:

sogaiu commented 7 months ago

I've been informed that this PR is sort of a "reboot" of this earlier one due to technical issues :)

sogaiu commented 7 months ago

Seems to be working here -- at least the tests pass :)

Some minor points:


[1] Wasn't clear on the choice to retain muller over box -- I think a previous version went with the reverse choice.

hyiltiz commented 7 months ago

Updated w.r.t. feedback.

sogaiu commented 7 months ago

I'm a bit fuzzy on this, but did we not conclude that using yield would lead to undesirable places wrt the function being usable in certain types of scenarios?

If so, I think leaving this comment is on the misleading side and potentially asking for trouble down the line.

sogaiu commented 7 months ago

Thanks for the update.

LGTM.

hyiltiz commented 7 months ago

Ready to merge and close it out.