Configuration options
The IntervalArithmetic.jl package provides a configure
function that allows users to fine-tune certain aspects of the package’s behavior. This is particularly useful for controlling trade-offs between computational speed and rigor.
The configure
function redines methods that alter the internal behavior of IntervalArithmetic. This persists across the current Julia session and affect all subsequent interval arithmetic computations.
Each keyword argument sets a specific configuration option:
numtype
: control the default numerical type used to represent the bounds of the intervals.flavor
: control the flavor type of the intervals.rounding
: control the rounding type.power
: control the implementation used for the interval power operation, that is, the computation ofx^n
wherex
is an interval andn
is a number. The choice of power implementation has implications for both performance and accuracy.matmul
: control the matrix multiplication algorithm.
julia> using IntervalArithmetic
julia> x = interval(π)
Interval{Float64}(3.141592653589793, 3.1415926535897936, com)
julia> configure(; pow = :fast)
ERROR: UndefVarError: `configure` not defined in `Main` Suggestion: check for spelling errors or missing imports.
julia> radius(x^2)
3.552713678800501e-15
julia> configure(pow = :slow)
ERROR: UndefVarError: `configure` not defined in `Main` Suggestion: check for spelling errors or missing imports.
julia> radius(x^2)
3.552713678800501e-15