Skip to content

Commit ce7a3c3

Browse files
committed
add logabsgamma
1 parent 875b9fa commit ce7a3c3

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

src/math/ops/op_dd_dd.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ end
5656
end
5757

5858
function sqrt_dd_dd(x::Tuple{T,T}) where {T<:IEEEFloat}
59-
iszero(HI(x))) && return x
59+
iszero(HI(x)) && return x
6060
signbit(HI(x)) && throw(DomainError("sqrt(x) expects x >= 0")) # maybe we can remove this check? It will return nan anyway.
6161

6262
ahi, alo = HILO(x)

src/math/special/gamma_erf.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,11 @@ erfc(x::Double16) = Double16Float128(erfc, x)
1515
gamma(x::Double16) = Double16Float128(gamma, x)
1616
lgamma(x::Double16) = Double16Float128(lgamma, x)
1717
loggamma(x::Double16) = Double16Float128(lgamma, x)
18+
19+
function logabsgamma(x::DoubleFloat{T}) where {T<:IEEEFloat}
20+
keep_precision = precision(BigFloat)
21+
setprecision(BigFloat, 128)
22+
result = logabsgamma(BigFloat(x))
23+
setprecision(BigFloat, keep_precision)
24+
return DoubleFloat{T}(result[1]), result[2]
25+
end

src/math/special/specialfunctions.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import .SpecialFunctions
2-
import .SpecialFunctions: erf, erfc, gamma, lgamma,
3-
besselj0, besselj1, besselj, bessely0, bessely1, bessely
2+
import .SpecialFunctions: erf, erfc, gamma, lgamma, loggamma, logabsgamma,
3+
besselj0, besselj1, besselj, bessely0, bessely1, bessely,
4+
ellipk
45

56
include("agm.jl")
67
include("bessel.jl")

0 commit comments

Comments
 (0)