IntervalArithmetic.jl icon indicating copy to clipboard operation
IntervalArithmetic.jl copied to clipboard

Provide tool for checking if a function plays well with intervals

Open Kolaru opened this issue 2 years ago • 1 comments

There recently have been some discussions about what can be done in Julia to prevent composing various package in a way that leads to silent error or nonsensical result. A possible solution is better test infrastructure.

I thought about what it could mean for IA since we had quite serious silent bugs caused by IA being used with boolean operations.

It could be interesting to provide a function like

plays_well_with_IA(func, args...)

where args contains some interval arguments. Then func(args...) is computed as well as the values of func for a bunch of point inside the intervals (maybe the bounds and random points inside) and the values are checked to fall inside func(args...).

This would allow users to easily have a sanity check to see if everything seems fine and could be used in the package tests as well.

Kolaru avatar Jul 01 '22 13:07 Kolaru

Fully agree with the idea! Incidentally, the same function could be used inside our own tests to check consistency. In TaylorModels I implemented something like that, though certainly not so user friendly, which includes calculations using extended precision.

lbenet avatar Jul 01 '22 18:07 lbenet