Please read: Please read: make it easier to help you, particularly about including a minimum working example.
For your error, see ForwardDiff: Using on functions that are defined on floats64
Basically, you need things typed as Real
instead of Float64
.