Skip to content

Commit

Permalink
Backport #401 and prepare release of SpecialFunctions 1.8.6 (#402)
Browse files Browse the repository at this point in the history
* Fix `beta_inc_inv` bug introduced in #399 (#401)

* Release 1.8.6
  • Loading branch information
devmotion authored Jun 2, 2022
1 parent 5d9b8a8 commit 6fe017e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "SpecialFunctions"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "1.8.5"
version = "1.8.6"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Expand Down
2 changes: 1 addition & 1 deletion src/beta_inc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ function _beta_inc_inv(a::Float64, b::Float64, p::Float64, q::Float64=1-p)
sq = 1.0
prev = 1.0

x = clamp(x, fpu, prevfloat(1.0))
x = clamp(x, 0.0001, 0.9999)

# This first argument was proposed in
#
Expand Down
6 changes: 6 additions & 0 deletions test/beta_inc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -305,4 +305,10 @@ end
y = 2.0e-280
@test beta_inc(2.0, 1.0, beta_inc_inv(2.0, 1.0, y, 1.0)[1])[1] y
end

@testset "StatsFuns#145" begin
y = 0.92
@test beta_inc_inv(0.01, 0.1, y)[1] 0.7803014210919872
@test beta_inc(0.01, 0.1, beta_inc_inv(0.01, 0.1, y)[1])[1] y
end
end

2 comments on commit 6fe017e

@devmotion
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/61601

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.8.6 -m "<description of version>" 6fe017e1bd9937e8d252bb093dbeef903c6c8517
git push origin v1.8.6

Please sign in to comment.