Differentiable error

Hi!

Can someone explain to me why this doesn't work and what the error message is about?

import _Differentiation
func f(x: Double) -> Double { return x * x }
print(gradient(at: 4.0, of: f))
                            `- error: a '@differentiable' function can only be formed from a reference to a 'func' or 'init' or a literal closure

Thanks