function f = myf(x,X,Y) G=normcdf(X*x); F=normpdf(X*x); f=X'*(((Y.*F)./G)-(((1-Y).*F)./(1-G)));