function [ d ] = DD3new ( x, y )
% DD3new Compute the divided difference for 3 points.
%   Input: x = vector of 3 data points, y = values at these points.

if length (x) ~= length (y)
    error ('Vectors have different lengths.');
elseif length (x) ~= 3
    error ('For 3 data points only.');
end

d = (DD2new (x (2:3),y (2:3)) - DD2new (x (1:2),y (1:2)) )/(x (3)-x (1));

end
