JuliaDiff / TaylorDiff.jl

Taylor-mode automatic differentiation for higher-order derivatives
https://juliadiff.org/TaylorDiff.jl/
MIT License
73 stars 8 forks source link

Derivative of x^2 = NaN at x = 0 #41

Closed arthur-bizzi closed 1 year ago

arthur-bizzi commented 1 year ago

Using version 0.2.1. Seems to work fine at every other point.

using TaylorDiff, ForwardDiff

hmm(x) = x^2

ForwardDiff.derivative(hmm, 0.) #0.0
TaylorDiff.derivative(hmm, 0., 1) #NaN

ForwardDiff.derivative(hmm, 1.) #2.0
TaylorDiff.derivative(hmm, 1., 1) #2.0
tansongchen commented 1 year ago

Duplicate with #33 . Thanks for pointing out and will fix soon!