Skip to content

Commit

Permalink
fix reduction style and swap in neg?
Browse files Browse the repository at this point in the history
  • Loading branch information
eightysteele committed Apr 11, 2024
1 parent a7b5e0e commit 320ac8c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gen/distribution/math/gamma.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 320ac8c

Please sign in to comment.