Skip to content

Commit

Permalink
Use alternate design for loglogistic
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjradcliffe committed May 3, 2024
1 parent 51b9a5b commit 9f24823
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/basicfuns.jl
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,10 @@ than the naive composition of functions.
Its inverse is the [`logitexp`](@ref) function.
"""
loglogistic(x::AbstractFloat) = -log1pexp(-x)
loglogistic(x::T) where {T<:Real} = -log1pexp(-convert(promote_type(Float64, T), x))
loglogistic(x::Real) = -log1pexp(-x)
loglogistic(x::T) where {T<:Integer} = loglogistic(convert(promote_type(Float64, T), x))
loglogistic(x::T) where {U<:Integer, T<:Rational{U}} =
loglogistic(convert(promote_type(Float64, T), x))

#=
this uses the identity:
Expand Down

0 comments on commit 9f24823

Please sign in to comment.