Open
Description
When differentiating over a complex sqrt
x0 = 5
ForwardDiff.derivative(x -> sqrt(1im * x), x0)
a StackOverflowError is encountered.
StackOverflowError:
Stacktrace:
[1] sqrt(::Complex{ForwardDiff.Dual{ForwardDiff.Tag{##20#21,Int64},Float16,1}}) at ./complex.jl:416 (repeats 80000 times)
The stacktrace points to the following declaration
sqrt(z::Complex) = sqrt(float(z))
I have found similar issues #111 #196 #239, but I don't see how I can fix this problem.
Metadata
Metadata
Assignees
Labels
No labels