function gradf = uvwd(xy);
%
% uvwd
% Gradient of objective function uvw.
% Vectorized to handle a  2 x n  input matrix xy,
% whose columns give the evaluation points in the plane.
% Returns an  n x 2  matrix of gradient values.
%
% Philip D. Loewen
% 25 Feb 98

x  = xy(1,:);
y  = xy(2,:);
y2 = y.*y;

one = ones(size(x));

u = x .* (y-one)      + 1.500*one;
v = x .* (y2-one)   + 2.250*one;
w = x .* (y2.*y-one)+ 2.625*one;

gradu = [y-one; x]';
gradv = [y2-one; 2*x.*y]';
gradw = [y2.*y-one; 3*x.*y2]';

gradf = (u' * [1 1]).*gradu + (v' * [1 1]).*gradv + (w' * [1 1]).*gradw;

return;
