Two Sigma Interview Question

Newton method in C++