Please read the documentation: Nonlinear Modeling · JuMP
You need to write generic code that is not restricted to Float64.
Float64