You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Domain check rejects ForwardDiff 1.x Duals at the interval bounds #42
Since ForwardDiff 1.0, comparisons on Dual numbers break ties in value using the partials (JuliaDiff/ForwardDiff.jl#481). The domain check in (::ChebPoly)(x), chebgradient and chebjacobian, all(lb .≤ x .≤ ub), therefore throws when x sits exactly on a bound and its derivative points outward. It worked with ForwardDiff 0.10.
using FastChebInterp, ForwardDiff
c =chebinterp(chebpoints(8, 0, 1).^2, 0, 1) # interpolate x² on [0,1]
ForwardDiff.derivative(c, 0.5) # 1.0
ForwardDiff.derivative(c, 1.0) # 2.0 on ForwardDiff 0.10.39 / FastChebInterp 1.2.0# ForwardDiff 1.4.8 / FastChebInterp 1.3.1:# ArgumentError: Dual{…}[Dual{…}(1.0,1.0)] not in domain [0] to [1]
For a gradient, the tie is decided by the first non-zero partial in lexicographic order. That can be pure round-off. In our case (a 3D table in spherical coordinates), a point on the upper bound of one coordinate was rejected because of a ∂/∂y partial of 1.9e-16.
do the domain check on values only, e.g. through a ForwardDiff package extension that defines a _value(x::Dual) = ForwardDiff.value(x) used by the check; or
expose an unchecked evaluation (e.g. c(x; check=false)) for callers that already guarantee x is in the domain.
We currently work around it by calling the internal FastChebInterp.evaluate directly.
Activity