function [Fp,dFp,fcon,fval]=fun3(x,Q,pp,bp,m,n)
% Fp denotes the smoothing function reformulated by us and dFp denotes the gradient of smooth function
% fcon stands for the original objective function 
%The data of Q are generated by the subroutine data.
f=zeros(n,1);
h=zeros(n,1);
g=zeros(n,1);
e=ones(n,1);
for i=1:n
const=sqrt([2*x(i)^2+2]);
f(i)=const-2;
g(i)=2*x(i)/const;
h(i)=f(i)*g(i);
end
fval=-(1/4)*(x'*Q*x)-0.5*(e'*Q*x)-(e'*Q*e)/4;
Fp=fval-bp*sum(log(1-x)+log(1+x))+(pp/2)*sum(f.^2);
dFp=-0.5*Q*x-0.5*Q*e-bp*(1./(1+x)-1./(1-x))+pp*h;
fcon=f;



