function [o,v,b]=opt
u=rand(1,10000);
FN=fn(u);
ANest=0.5*fn(u)+0.5*fn(1-u);
STRest=0.5*fn(u.*0.5)+0.5*fn(0.5+u.*0.5);
CN=u;
intg=0.5;
CVest=FN-CN+intg;
IM=sqrt(u);
IMdens=2*IM;
IMest=fn(IM)./IMdens;
Crude=mean(FN)
Crudevar=var(FN)
AN=mean(ANest)
ANvar=var(ANest)
STR=mean(STRest)
STRvar=var(STRest)
IM=mean(IMest)
IMvar=var(IMest)
CV=mean(CVest)
CVvar=var(CVest)
X=[ANest',STRest',CVest',IMest'];
%mean(X);
V=cov(X);
Z=ones(4,1);
V1=inv(V);
b=V1*Z/(Z'*V1*Z)
o=mean(X*b)
v=1/(Z'*V1*Z)
Efficiency=Crudevar/v
%Efficiency =
%  2.6162e+004
