function GSRR = GradientSearchRule(ro11,Best_XX,Worst_XX,XX,Xr11,DMM,epss,Xmm, Flagg1)
 
 DD=length(Best_XX);
 Delta=zeros(1,DD);
 Step=zeros(1,DD);
 DelX=zeros(1,DD);
 GSRR=zeros(1,DD);
 Xs=zeros(1,DD);
 yp=zeros(1,DD);
 yq=zeros(1,DD);
     
     Delta=2.0.*rand.*abs(Xmm-XX);
     Step=(Best_XX-Xr11+Delta)./2.0;
     DelX=rand.*abs(Step);
     GSRR=(randn.*ro11.*(2.*DelX.*XX))./(Best_XX-Worst_XX+epss); 
     if (Flagg1 == 1)
       Xs=XX-GSRR+DMM;
     elseif (Flagg1 == 0)
       Xs=Best_XX-GSRR+DMM;
     end
     
     yp=rand.*((Xs+XX)*0.5+(rand.*DelX));
     yq=rand.*((Xs+XX).*0.5-(rand.*DelX));
     GSRR =(randn.*ro11.*(2.*DelX.*XX))./(yp-yq+epss); 
      
endfunction 

