Skip to content

Commit 91c5278

Browse files
committed
remove lgamma and use logabsgamma from Quadmath
1 parent 1518da5 commit 91c5278

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
1818

1919
[compat]
2020
Polynomials = "1, 2, 3, 4, 5, 6"
21-
Quadmath = "0.4, 0.5, 0.6, 0.7, 0.8"
21+
Quadmath = "0.5.10, 0.6, 0.7, 0.8"
2222
Requires = "1"
2323
SpecialFunctions = "1.0, 1.1, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5"
2424
GenericLinearAlgebra = "0.2.5, 0.3, 0.4, 0.5, 0.6"

src/math/special/gamma_erf.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
erf(x::Double64) = Double64Float128(erf, x)
22
erfc(x::Double64) = Double64Float128(erfc, x)
33
gamma(x::Double64) = Double64Float128(gamma, x)
4-
lgamma(x::Double64) = Double64Float128(lgamma, x)
54

65
erf(x::Double32) = Double32Float128(erf, x)
76
erfc(x::Double32) = Double32Float128(erfc, x)
87
gamma(x::Double32) = Double32Float128(gamma, x)
9-
lgamma(x::Double32) = Double32Float128(lgamma, x)
108

119
erf(x::Double16) = Double16Float128(erf, x)
1210
erfc(x::Double16) = Double16Float128(erfc, x)
1311
gamma(x::Double16) = Double16Float128(gamma, x)
14-
lgamma(x::Double16) = Double16Float128(lgamma, x)
1512

1613
function logabsgamma(x::DoubleFloat{T}) where {T<:IEEEFloat}
17-
sign = x >= 0 ? 1 : 2*mod(ceil(Int64,x),2)-1
18-
return lgamma(x), sign
14+
result = logabsgamma(Float128(x))
15+
return DoubleFloat{T}(result[1]), result[2]
1916
end

src/math/special/specialfunctions.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import .SpecialFunctions
2-
import .SpecialFunctions: erf, erfc, gamma, lgamma, logabsgamma,
2+
import .SpecialFunctions: erf, erfc, gamma, logabsgamma,
33
besselj0, besselj1, besselj, bessely0, bessely1, bessely,
44
ellipk
55

0 commit comments

Comments
 (0)