Skip to content

Commit

Permalink
Fix missing parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
quildtide committed Aug 9, 2024
1 parent 2a70002 commit c1ab292
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/univariate/continuous/inversegaussian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function cdf(d::InverseGaussian, x::Real)
# 2λ/μ and normlogcdf(-u*(v+1)) are similar magnitude, opp. sign
# truncating to [0, 1] as an additional precaution
# Ref https://github.com/JuliaStats/Distributions.jl/issues/1873
z = clamp(normcdf(u * (v - 1)) + exp(2λ / μ + normlogcdf(-u * (v + 1)), 0, 1)
z = clamp(normcdf(u * (v - 1)) + exp(2λ / μ + normlogcdf(-u * (v + 1)), 0, 1))

# otherwise `NaN` is returned for `+Inf`
return isinf(x) && x > 0 ? one(z) : z
Expand All @@ -116,7 +116,7 @@ function ccdf(d::InverseGaussian, x::Real)
# 2λ/μ and normlogcdf(-u*(v+1)) are similar magnitude, opp. sign
# truncating to [0, 1] as an additional precaution
# Ref https://github.com/JuliaStats/Distributions.jl/issues/1873
z = clamp(normccdf(u * (v - 1)) - exp(2λ / μ + normlogcdf(-u * (v + 1)), 0, 1)
z = clamp(normccdf(u * (v - 1)) - exp(2λ / μ + normlogcdf(-u * (v + 1)), 0, 1))

# otherwise `NaN` is returned for `+Inf`
return isinf(x) && x > 0 ? zero(z) : z
Expand Down

0 comments on commit c1ab292

Please sign in to comment.