Newton-Raphson method for debt-loan calculation