Unsuccesfull implementation of BFGS (quasi-newtonian optimization method)