Skip to content

Commit e3670ce

Browse files
authored
Add test of second-order derivative of t -> abs(t)^2 (#650)
1 parent 50ec9a1 commit e3670ce

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/MiscTest.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,4 +158,7 @@ end
158158
@test ForwardDiff.derivative(x -> rem2pi(x, RoundUp), rand()) == 1
159159
@test ForwardDiff.derivative(x -> rem2pi(x, RoundDown), rand()) == 1
160160

161+
# example from https://github.com/JuliaDiff/DiffRules.jl/pull/98#issuecomment-1574420052
162+
@test only(ForwardDiff.hessian(t -> abs(t[1])^2, [0.0])) == 2
163+
161164
end # module

0 commit comments

Comments
 (0)