The procedure minimizes the square of the given function, not the function itself.
Some functions (in the example, the square root of f) leads to a type conversion error
Putting f and x in lists removes the error but it does not help to solve the minimization task.