Implement differentiable function

  roboptim-core implementation does not allow to define functions with
  size of derivative different from size of parameter.