DataInterpolations.jl
DataInterpolations.jl copied to clipboard
CompatHelper: bump compat for "ForwardDiff" to "1.0"
This pull request changes the compat entry for the ForwardDiff package from 0.10.36 to 0.10.36, 1.0.
This keeps the compat entries for earlier versions.
Note: I have not tested your package with this new compat entry. It is your responsibility to make sure that your package tests pass before you merge this pull request.
It looks like something really did happen to Akima derivatives?
I'll check it out.
Specifically the thing happening is that ForwardDiff.derivative has changed which branch of the derivative we take. MWE:
u = [0.0, 2.0, 1.0, 3.0, 2.0, 6.0, 5.5, 5.5, 2.7, 5.1, 3.0]
t = collect(0.0:10.0)
func = AkimaInterpolation(u, t)
julia> derivative(func, 1.0, 2)
-9.0
julia> derivative(func, prevfloat(1.0), 2)
-3.0
julia> derivative(func, nextfloat(1.0), 2)
-8.999999999999996
which reduces to
julia> searchsortedfirst([0.0, 1.0, 2.0, 3.0], 1.0)
2
julia> searchsortedfirst([0.0, 1.0, 2.0, 3.0], ForwardDiff.Dual(1.0, (1.0,)))
3
This is necessary for bumping MTK's ForwardDiff compat