diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d83f5958..0da0b519 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,12 +21,6 @@ jobs: - ubuntu-latest - macOS-latest - windows-latest - exclude: - - os: macOS-latest # Apple Silicon - version: 'min' - include: - - os: macOS-13 # Intel - version: 'min' steps: - uses: actions/checkout@v5 - uses: julia-actions/setup-julia@v2 @@ -42,7 +36,7 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} # required fail_ci_if_error: true - file: ./lcov.info + files: ./lcov.info flags: unittests docs: name: Documentation diff --git a/Project.toml b/Project.toml index 4bd436e9..b163a3ba 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "SpecialFunctions" uuid = "276daf66-3868-5448-9aa4-cd146d93841b" -version = "2.5.1" +version = "2.6.0" [deps] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" @@ -22,7 +22,7 @@ IrrationalConstants = "0.1, 0.2" LogExpFunctions = "0.3.2" OpenLibm_jll = "0.7, 0.8" OpenSpecFun_jll = "0.5" -julia = "1.5" +julia = "1.10" [extras] ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" diff --git a/src/SpecialFunctions.jl b/src/SpecialFunctions.jl index 0d296cc0..864d2883 100644 --- a/src/SpecialFunctions.jl +++ b/src/SpecialFunctions.jl @@ -103,9 +103,6 @@ include("gamma.jl") include("gamma_inc.jl") include("betanc.jl") include("beta_inc.jl") -if !isdefined(Base, :get_extension) - include("../ext/SpecialFunctionsChainRulesCoreExt.jl") -end include("deprecated.jl") for f in (:digamma, :erf, :erfc, :erfcinv, :erfcx, :erfi, :erfinv, :logerfc, :logerfcx, @@ -119,13 +116,9 @@ for f in (:beta, :lbeta) end polygamma(m::Integer, x::Missing) = missing - # In future just use `fastabs` from Base.Math - # https://github.com/JuliaLang/julia/blob/93fb785831dcfcc442f82fab8746f0244c5274ae/base/special/trig.jl#L1057 -if isdefined(Base.Math, :fastabs) - import Base.Math: fastabs -else - fastabs(x::Number) = abs(x) - fastabs(x::Complex) = abs(real(x)) + abs(imag(x)) -end +# `fastabs` is identical to `Base.Math.fastabs` which is not used here since it is not public +# https://github.com/JuliaLang/julia/blob/93fb785831dcfcc442f82fab8746f0244c5274ae/base/special/trig.jl#L1057 +fastabs(x::Number) = abs(x) +fastabs(x::Complex) = abs(real(x)) + abs(imag(x)) end # module diff --git a/src/gamma.jl b/src/gamma.jl index 47442289..ce02132b 100644 --- a/src/gamma.jl +++ b/src/gamma.jl @@ -26,7 +26,7 @@ function _digamma(z::ComplexOrReal{Float64}) # argument," Computer Phys. Commun. vol. 4, pp. 221–226 (1972). x = real(z) if x <= 0 # reflection formula - ψ = -π * _cotpi(z) + ψ = -π / tanpi(z) z = 1 - z x = real(z) else @@ -55,13 +55,6 @@ function _digamma(x::BigFloat) return z end -""" - _cotpi(x) = cot(π * x) - -Accurate for integer arguments -""" -_cotpi(x) = @static VERSION >= v"1.10.0-DEV.525" ? inv(tanpi(x)) : cospi(x) / sinpi(x) - """ trigamma(x) @@ -139,12 +132,12 @@ const cotderiv_Q = [cotderiv_q(m) for m in 1:100] function cotderiv(m::Integer, z) isinf(imag(z)) && return zero(z) if m <= 0 - m == 0 && return π * _cotpi(z) + m == 0 && return π / tanpi(z) throw(DomainError(m, "`m` must be nonnegative.")) end if m <= length(cotderiv_Q) q = cotderiv_Q[m] - x = _cotpi(z) + x = inv(tanpi(z)) y = x*x s = q[1] + q[2] * y t = y @@ -816,8 +809,7 @@ function logabsbeta(a::T, b::T) where T<:Real if a <= 0 && isinteger(a) if a + b <= 0 && isinteger(b) r = logbeta(1 - a - b, b) - # in julia ≥ 1.7, iseven doesn't require Int (julia#38976) - sgn = iseven(@static VERSION ≥ v"1.7" ? b : Int(b)) ? 1 : -1 + sgn = iseven(b) ? 1 : -1 return r, sgn else return -log(zero(a)), 1