# ForwardDiff: Using on functions that are defined on floats64

**URL:** https://discourse.julialang.org/t/forwarddiff-using-on-functions-that-are-defined-on-floats64/18226
**Category:** General Usage
**Created:** [December 2, 2018, 8:44pm UTC](https://discourse.julialang.org/t/forwarddiff-using-on-functions-that-are-defined-on-floats64/18226 "2018-12-02T20:44:39Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![IljaK91](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iljak91/32/44301_2.png) [@IljaK91](https://discourse.julialang.org/u/IljaK91)
#### Post date: [December 2, 2018, 9:26pm UTC](https://discourse.julialang.org/t/forwarddiff-using-on-functions-that-are-defined-on-floats64/18226/3 "2018-12-02T21:26:38Z")

</div>

Wouldn’t specifying types already avoid situations in which functions become not type-stable.

For example, if I have

```julia
f(x,y) = x*y

```

and both variables are not restricted to be of the same type, this might actually cause the code to slow down. In my case I only work with Floats, so it seemed appropiate to restrict all functions to handle Floats only.

Zygote looks interesting indeed! Thanks for the link 🙂

---

_[View the full topic](https://discourse.julialang.org/t/forwarddiff-using-on-functions-that-are-defined-on-floats64/18226)._
