function f = sismo_Stoneley_disp2(k,sigma,rhow,rhos,alphaw,alphas,h,betas)
%function f = sismo_Stoneley_disp2(k,sigma,g,rhow,rhos,alphaw,alphas,h,betas)
% this is the square of sismo_Stoneley_disp

l=sqrt(sigma.^2./alphaw.^2-k.^2);
m=sqrt(k.^2-sigma.^2./alphas.^2);
n=sqrt(k.^2-sigma.^2./betas.^2);

left=real(tan(l.*h));
right=real((rhos/rhow).*(l./m).*(4.*betas.^4.*k.^2.*(m.*n)-(sigma.^2-2.*k.^2.*betas.^2).^2)./(sigma.^4));
f=(left-right).^2;
end

