From 320ac8c348fe9fb2ba01d36df0b6491547865773 Mon Sep 17 00:00:00 2001 From: Aaron Steele Date: Wed, 10 Apr 2024 18:48:08 -0700 Subject: [PATCH] fix reduction style and swap in neg? --- src/gen/distribution/math/gamma.cljc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gen/distribution/math/gamma.cljc b/src/gen/distribution/math/gamma.cljc index 6960c13..3951fc9 100644 --- a/src/gen/distribution/math/gamma.cljc +++ b/src/gen/distribution/math/gamma.cljc @@ -75,8 +75,7 @@ [3 14.136097974741746] [2 -59.59796035547549] [1 57.15623566586292]]] - (+ (reduce (fn [sum [i l]] (+ sum (/ l (+ x i)))) 0.0 c) - 0.99999999999999709182))) + (reduce (fn [sum [i l]] (+ sum (/ l (+ x i)))) 0.99999999999999709182 c))) (defn inv-gamma-1pm1 "Computes an approximation to 1/gamma(1 + x) - 1 for -0.5 <= x <= 1.5. @@ -102,7 +101,7 @@ 0.166538611382291489501700795102105E+00 -0.420026350340952355290039348754298E-01 -0.655878071520253881077019515145390E+00]] - (if (< t 0) + (if (neg? t) (let [A [0.611609510448141581788E-08 0.624730830116465516210E-08] B [0.195755836614639731882E-09