Why my gradient descent seems to diverge "pair-wise"?
I've checked the algorithms and they work for golden section line search and "small step parameter".
However, when trying to get the algo to diverge, I notice that the results indicate that the divergence occurs "pair-wise". The components flip on every iteration (although they're not entirely the same, they show slow improvement).
Function is:
$$f(x,y)=x^2+y^2+x+2y$$
Does this have some symmetry that'd explain this?
Reproducing code:

(-df(an))flips its sign every round. I removed that - and not it diverges like the others, no pair-wise phenomenon. However, in the formulation of gradient descent, it's supposed to have a minus. – mavavilj Jan 22 '19 at 19:54