-
Notifications
You must be signed in to change notification settings - Fork 154
Open
Description
Hi ForwardDiff team,
I observe an error when updating from ForwardDiff v0.10 to v1.x. The error occurs when differentiating through quadgk integration.
A MWE to reproduce the error is as follows:
using ForwardDiff
using QuadGK
delta = [ 1.0, 10.0 ]
chi = [ 0.03, 0.30 ]
S = inv([ exp(-chi_ * delta_) for delta_ in delta, chi_ in chi ])
g(x) = quadgk(t -> S*x, 0.0, 1.0)[1]
ForwardDiff.jacobian(g, zeros(2))
With ForwardDiff 1.3, I get the following error:
ERROR: LoadError: DomainError with 0.5:
integrand produced Dual{ForwardDiff.Tag{typeof(g), Float64}}(NaN,NaN,NaN) in the interval (0.0, 1.0)
Note that the code does not throw with ForwardDiff v0.10.39.
Also note that when changing the matrx S, e.g. adding a line S .+= 0.5 then above code also works with v1.3.
Would be great if you could have a look.
Metadata
Metadata
Assignees
Labels
No labels