Skip to content

Commit

Permalink
Just fall back to Float32
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion authored Jan 31, 2023
1 parent 7d41d32 commit 1304710
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/distrs/tdist.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,9 @@ tdistinvccdf(ν::Real, p::Real) = -tdistinvcdf(ν, p)

if VERSION < v"1.7.0-DEV.1172"
# expm1(::Float16) is not defined in older Julia versions
# https://github.com/JuliaLang/julia/pull/40867
function _log2mexp(x::Float16)
expm1_x = if -0.2 < x < 0.1
x * @evalpoly(x, Float16(1), Float16(1/2), Float16(1/6), Float16(1/24), Float16(1/120))
else
return exp(x) - 1
end
expm1_x = Float16(expm1(Float32(x)))
return log1p(-expm1_x)
end
end
Expand Down

0 comments on commit 1304710

Please sign in to comment.