MastodonC / kixi.stats

A library of statistical distribution sampling and transducing functions
https://cljdoc.xyz/d/kixi/stats
Eclipse Public License 1.0
355 stars 17 forks source link

Fix bug in `rand-gamma` algorithm #44

Closed sritchie closed 11 months ago

sritchie commented 11 months ago

This PR:

(let [rng (clojure.test.check.random/make-random 1)]
  (time (dotimes [_ 5000000] (rand-gamma 1.4 rng))))

;; before this patch:
"Elapsed time: 3308.692334 msecs"

;; after this patch:
"Elapsed time: 1468.73025 msecs"