Open smkatz12 opened 2 months ago
Thx for opening an issue.
What version of IntervalArithmetic are you using? On 0.22.11 the example you gave returns an error, as it should since no one implemented the functions you describe.
That being said, it would be nice it improve support for ForwardDiff. Then we must also address the question of decorations.
Thanks for the quick reply! I was using an old version of IntervalArithmetic. I updated and confirmed that I now get an error when running that code. In terms of adding support for these functions, do you want us to submit a pull request? What are your recommendations for decorations?
A PR would be great :)
We'll review the PR in more details, but there is a bunch of subtleties to take into account:
:com
(the functions are continuous and well defined[1]).false
(in particular we need to be careful when creating an interval "by hand" from floating point numbers).clamp
at all currently, would be nice to add it.min(1..2, 0.5..3)
, derived with respect to any argument...
has been moved to a submodule (IntervalArithmetic.Symbols
), internally we currently prefer the interval
constructor.I hope this is not overwhelming, please let us know if you need help or advice about anything.
Hi! We are working on a textbook chapter on reachability analysis and are interested in support for intervals when using ForwardDiff.jl to compute gradients and hessians of functions that use the
min
,max
, andclamp
. The current behavior with these functions does not cause an error but is incorrect. We have written the functions below to correct for this. These functions could be added toIntervalArithmeticForwardDiffExt.jl
.Example:
Current output:
Correct output using code above: