From 9f24823fbb5f71fec25e197e02954abba04c3888 Mon Sep 17 00:00:00 2001 From: Andrew Radcliffe Date: Fri, 3 May 2024 15:14:06 -0700 Subject: [PATCH] Use alternate design for `loglogistic` --- src/basicfuns.jl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/basicfuns.jl b/src/basicfuns.jl index f602ef6..24e4cbe 100644 --- a/src/basicfuns.jl +++ b/src/basicfuns.jl @@ -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: