source('utils.R') root_fn = function(x){ -1 + x + x^2 } root_fn_prime = function(x){ 1 + 2*x } nm_res = newtons_method(1, root_fn, root_fn_prime)