function [value] = hw6afn(a,b,m,z)

   h = (b-a)/(m-1);
   i = floor((z-a)/h+1);
% or, instead of using floor:
%   i = 1;
%   while i < (z-a)/h+1
%      i = i+1;
%   end
%   i = i-1;
   xi = a+(i-1)*h;
   for i = 1:4
      x(i) = xi+(i-2)*h;
      y(i) = hw6f(x(i));
   end
   value = hw5afn(4,x,y,z);
% or, instead of calling hw4afn, can write out Lagrange or Newton form for the cubic 
% polynomial

end
