Skip to content

Commit 6fe017e

Browse files
authored
Backport #401 and prepare release of SpecialFunctions 1.8.6 (#402)
* Fix `beta_inc_inv` bug introduced in #399 (#401) * Release 1.8.6
1 parent 5d9b8a8 commit 6fe017e

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "SpecialFunctions"
22
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
3-
version = "1.8.5"
3+
version = "1.8.6"
44

55
[deps]
66
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"

src/beta_inc.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ function _beta_inc_inv(a::Float64, b::Float64, p::Float64, q::Float64=1-p)
967967
sq = 1.0
968968
prev = 1.0
969969

970-
x = clamp(x, fpu, prevfloat(1.0))
970+
x = clamp(x, 0.0001, 0.9999)
971971

972972
# This first argument was proposed in
973973
#

test/beta_inc.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,4 +305,10 @@ end
305305
y = 2.0e-280
306306
@test beta_inc(2.0, 1.0, beta_inc_inv(2.0, 1.0, y, 1.0)[1])[1] y
307307
end
308+
309+
@testset "StatsFuns#145" begin
310+
y = 0.92
311+
@test beta_inc_inv(0.01, 0.1, y)[1] 0.7803014210919872
312+
@test beta_inc(0.01, 0.1, beta_inc_inv(0.01, 0.1, y)[1])[1] y
313+
end
308314
end

0 commit comments

Comments
 (0)