def newtons_method_2(f, grad_f, hessian_f, x_y, num_iterations=100):
for iteration in range(num_iterations):
x_y = x_y - np.matmul(np.linalg.inv(hessian_f(x_y[0,0], x_y[1,0])), grad_f(x_y[0,0], x_y[1,0]))
print(x_y.T)
return x_y
In the above code the function has been defined to take “f” as a parameter.
But it does not make use of it in the code.
Why?