function F = KBfg(x)
%

F(1) = -1 + x(1) + x(2) - x(4)*x(2);
F(2) = -1 + x(1) + x(3) - x(5)*x(3);
F(3) = -1 + x(2) + x(3) - x(6)*x(3);
F(4) = -1 + x(1) + x(2) + x(3) - x(4)*x(2) - x(5)*x(3) - x(6)*x(3) + x(7)*x(6)*x(3);
F(5) = -0.5 + (x(1));
F(6) = -0.5 + (x(2));
F(7) = -0.5 + (x(3));
F(8) = -x(9) + 1 - x(4);
F(9) = -x(8) + (1-(x(1) + x(2) - x(4)*x(2)))/(1-x(2));
F(10) = -x(10) + 1 - x(8);
F(11) = -x(12) + 1 - x(5);
F(12) = -x(11) + (1-(x(1) + x(3) - x(5)*x(3)))/(1-x(3));
F(13) = -x(13) + 1 - x(11);
F(14) = -x(15) + 1 - x(6);
F(15) = -x(14) + (1-(x(2) + x(3) - x(6)*x(3)))/(1-x(3));
F(16) = -x(16) + 1 - x(14);
F(17) = x(18) - 1 + x(7);
F(18) = x(17)*(1-x(6)*x(3))-1+x(1)+x(6)*x(3)+x(7)*x(6)*x(3);
F(19) = x(19) - 1 + x(17);
