% Newton's method using Horner's algorithm to evaluate a polynomial and its
% derivative efficiently
%
% Inputs
%   p 	   Vector of polynomial coefficients, from highest to lowest degree
%   z0     initial guess
%   tol    tolerance
%   maxit  maximum number of iterations
%
% Outputs
%   z      last iterate
%   k      number of iterations
function [z,k] = polynm(p,z0,tol,maxit)

% TO BE COMPLETED

% This function calls hornernm to compute value of polynomial and derivative
% at the current iterate.
