Skip to content

Commit

Permalink
one-line
Browse files Browse the repository at this point in the history
Co-authored-by: David Widmann <[email protected]>
  • Loading branch information
cossio and devmotion authored Mar 9, 2022
1 parent 3bb22ba commit 74f9459
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/basicfuns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,7 @@ end

#= The precision of BigFloat cannot be computed from the type only and computing
thresholds is slow. Therefore prefer version without thresholds in this case. =#
function log1pexp(x::BigFloat)
if x > 0
return x + log1p(exp(-x))
else
return log1p(exp(x))
end
end
log1pexp(x::BigFloat) = x > 0 ? x + log1p(exp(-x)) : log1p(exp(x))

#=
Returns thresholds x0, x1, x2 such that:
Expand Down

0 comments on commit 74f9459

Please sign in to comment.