Skip to content

Commit 3ac6136

Browse files
authored
fix typos
1 parent 2942829 commit 3ac6136

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

src/gamma.jl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,41 @@ function gamma(_x::Float64)
1717
w = muladd(w, evalpoly(w, s), 1.0)
1818
# avoid overflow
1919
v = x ^ muladd(0.5, x, -0.25)
20-
2120
res = SQ2PI(T) * v * (v / exp(x)) * w
22-
23-
if _x < 0
24-
return π / (res * s)
25-
else
26-
return res
27-
end
21+
22+
if _x < 0
23+
return π / (res * s)
24+
else
25+
return res
26+
end
2827
end
2928
P = (
30-
1.000000000000000000009e0, 8.378004301573126728826e-1, 3.629515436640239168939e-1, 1.113062816019361559013e-1,
31-
2.385363243461108252554e-2, 4.092666828394035500949e-3, 4.542931960608009155600e-4, 4.212760487471622013093e-5
29+
1.000000000000000000009e0, 8.378004301573126728826e-1, 3.629515436640239168939e-1, 1.113062816019361559013e-1,
30+
2.385363243461108252554e-2, 4.092666828394035500949e-3, 4.542931960608009155600e-4, 4.212760487471622013093e-5
3231
)
3332
Q = (
34-
9.999999999999999999908e-1, 4.150160950588455434583e-1, -2.243510905670329164562e-1, -4.633887671244534213831e-2,
35-
2.773706565840072979165e-2, -7.955933682494738320586e-4, -1.237799246653152231188e-3, 2.346584059160635244282e-4,
36-
-1.397148517476170440917e-5
33+
9.999999999999999999908e-1, 4.150160950588455434583e-1, -2.243510905670329164562e-1, -4.633887671244534213831e-2,
34+
2.773706565840072979165e-2, -7.955933682494738320586e-4, -1.237799246653152231188e-3, 2.346584059160635244282e-4,
35+
-1.397148517476170440917e-5
3736
)
3837

3938
z = 1.0
4039
while x >= 3.0
41-
x -= 1.0
42-
z *= x
40+
x -= 1.0
41+
z *= x
4342
end
4443
while x < 2.0
45-
z /= x
46-
x += 1.0
44+
z /= x
45+
x += 1.0
4746
end
4847

4948
x -= 2.0
5049
p = evalpoly(x, P)
5150
q = evalpoly(x, Q)
52-
retrun _x < 0 ? π * q / (s * z * p) : z * p / q
51+
return _x < 0 ? π * q / (s * z * p) : z * p / q
5352
end
5453

54+
5555
function gamma(_x::Float32)
5656
x = Float64(_x)
5757
if _x < 0

0 commit comments

Comments
 (0)