# Dual{::ForwardDiff...} type error when JuMP tries autodiff User-defined Function

**URL:** <https://discourse.julialang.org/t/dual-forwarddiff-type-error-when-jump-tries-autodiff-user-defined-function/25639>\
**Category:** Optimization (Mathematical)\
**Created:** [June 25, 2019, 6:20am UTC](https://discourse.julialang.org/t/dual-forwarddiff-type-error-when-jump-tries-autodiff-user-defined-function/25639 "2019-06-25T06:20:46Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![odow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/odow/32/28685_2.png) [@odow](https://discourse.julialang.org/u/odow)\
**Post date:** [June 25, 2019, 1:45pm UTC](https://discourse.julialang.org/t/dual-forwarddiff-type-error-when-jump-tries-autodiff-user-defined-function/25639/2 "2019-06-25T13:45:19Z")

</div>

Please read: [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757), particularly about including a minimum working example.

For your error, see [ForwardDiff: Using on functions that are defined on floats64](https://discourse.julialang.org/t/forwarddiff-using-on-functions-that-are-defined-on-floats64/18226)

Basically, you need things typed as `Real` instead of `Float64`.

---

_[View the full topic](https://discourse.julialang.org/t/dual-forwarddiff-type-error-when-jump-tries-autodiff-user-defined-function/25639)._
