The following code is my attempt of employing the Broydens methodBroyden's method for root finding on the function $f(x,y)=(e^{xy}-y^2-2,\cos(x+y)+\frac{1}{2})$. Where the first Matrixmatrix is the Jacobian, then it gets updated using an estimate. So $k[l,k]$ computes the first 12 iterations. However, this program is extremely slow and I am not sure why. Could anyone point out why it is so slow and how I could improve it. If you are not familiar https://en.wikipedia.org/wiki/Broyden%27s_method described the Broyden Method nicely.?
EDIT: I found some optimizaitonoptimization to my code. I removed the redundant $N$ as per a suggestion in the comments. The optiumizationoptimization I found is to deal with numerical matriciesmatrices form the get go. The original code did everything for arbitrary $x,y$