Skip to content

Support for special functions #534

Open
@Kolaru

Description

@Kolaru

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions