function z=qd3(x)
% used in the function quaddesign3;  x is vector of length 3
z=x2fx(x,'quadratic');
z([5 6 7])=2*z([5 6 7]);
z=[z;[zeros(3,1) eye(3) 2*[[x(2) x(3) 0];[x(1) 0 x(3)];[0 x(1) x(2)]] 2*diag(x)]];


