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

Perturbation Confusion issue

Open MikeInnes opened this issue 5 years ago • 0 comments

D(f, x) = ForwardDiff.derivative(f, x)

D(1) do x
  f(y) = (x = x*y)
  D(f, 1)
  D(f, 1)
end # => 2

The correct answer is 1. This is essentially the same as https://github.com/YingboMa/ForwardDiff2.jl/issues/37.

MikeInnes avatar Jan 23 '20 12:01 MikeInnes