Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for special functions #534

Open
Kolaru opened this issue Jun 5, 2022 · 1 comment
Open

Support for special functions #534

Kolaru opened this issue Jun 5, 2022 · 1 comment

Comments

@Kolaru
Copy link
Collaborator

Kolaru commented Jun 5, 2022

Supporting special functions would be nice (see e.g. JuliaIntervals/IntervalRootFinding.jl#175).

I thought already was an issue here about this, but I can't find it.

This is only easy to do for monotonous functions for which we can guarantee rounding correctness (e.g. by going through BigFloat or if a rounding mode is directly available). I don't think there is a general way to treat the other special functions.

The "good" think is that special functions seem to error (more or less gracefully) right now, rather that returning incorrect results:

julia> using SpecialFunctions

julia> besselk(2, Interval(0.7))
ERROR: StackOverflowError:
Stacktrace:
 [1] besselk(nu::Int64, x::Interval{Float64}) (repeats 79984 times)
   @ SpecialFunctions C:\Users\Kolaru\.julia\packages\SpecialFunctions\oPGFg\src\bessel.jl:583

julia> zeta(Interval(1.3))
ERROR: MethodError: no method matching _zeta(::Interval{Float64})
Closest candidates are:
  _zeta(::Union{Float64, ComplexF64}) at C:\Users\Kolaru\.julia\packages\SpecialFunctions\oPGFg\src\gamma.jl:414
  _zeta(::T, ::T) where T<:Union{Float64, ComplexF64} at C:\Users\Kolaru\.julia\packages\SpecialFunctions\oPGFg\src\gamma.jl:233
  _zeta(::Union{Float16, ComplexF16}) at C:\Users\Kolaru\.julia\packages\SpecialFunctions\oPGFg\src\gamma.jl:519
  ...
Stacktrace:
 [1] zeta(s::Interval{Float64})
   @ SpecialFunctions C:\Users\Kolaru\.julia\packages\SpecialFunctions\oPGFg\src\gamma.jl:412
 [2] top-level scope
   @ REPL[22]:1
@lucaferranti
Copy link
Member

There is IntervalSpecialFunctions.jl, but the repo hasn't been updated in a while (I don't . It also has this PR which despite the name adds support for several special functions using Arb. Not sure how mature it is etc, but I can try to resurrect the repo and have a look at the PR.

That being said, computing special functions of intervals is a nice beast of itself. This paper from Fredrik Johansson describes some techniques for hypergeometric functions (which cover a good piece of special functions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants