Skip to content

Commit

Permalink
Add test of second-order derivative of t -> abs(t)^2 (#650)
Browse files Browse the repository at this point in the history
  • Loading branch information
devmotion committed Jun 9, 2023
1 parent 50ec9a1 commit e3670ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/MiscTest.jl
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,7 @@ end
@test ForwardDiff.derivative(x -> rem2pi(x, RoundUp), rand()) == 1
@test ForwardDiff.derivative(x -> rem2pi(x, RoundDown), rand()) == 1

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

end # module

0 comments on commit e3670ce

Please sign in to comment.