function tau = tau_fast(k,eta1,eta2,r1,r2,h1,d)
% TAU_FAST Matlab code for the fast mode of analytical expressions
%	approximated from chi22.
w22 = ...
(1/4).*eta2.^(-1).*((eta1+eta2).^2.*cosh(2.*d.*k)+(eta1+(-1) ...
  .*eta2).^2.*cosh(2.*(d+(-2).*h1).*k)+2.*(eta1.^2+eta2.^2+2.* ...
  d.^2.*eta1.^2.*k.^2+2.*d.^2.*eta2.^2.*k.^2+(-4).*d.* ...
  eta1.^2.*h1.*k.^2+8.*d.*eta1.*eta2.*h1.*k.^2+(-4).*d.* ...
  eta2.^2.*h1.*k.^2+4.*eta1.^2.*h1.^2.*k.^2+(-8).*eta1.*eta2.* ...
  h1.^2.*k.^2+4.*eta2.^2.*h1.^2.*k.^2+4.*d.^2.*eta1.^2.* ...
  h1.^2.*k.^4+(-8).*d.^2.*eta1.*eta2.*h1.^2.*k.^4+4.*d.^2.* ...
  eta2.^2.*h1.^2.*k.^4+(-8).*d.*eta1.^2.*h1.^3.*k.^4+16.*d.* ...
  eta1.*eta2.*h1.^3.*k.^4+(-8).*d.*eta2.^2.*h1.^3.*k.^4+4.* ...
  eta1.^2.*h1.^4.*k.^4+(-8).*eta1.*eta2.*h1.^4.*k.^4+4.* ...
  eta2.^2.*h1.^4.*k.^4+(eta1.^2+(-1).*eta2.^2).*(1+2.*h1.^2.* ...
  k.^2).*cosh(2.*(d+(-1).*h1).*k)+(eta1.^2+(-1).*eta2.^2).*(1+ ...
  2.*d.^2.*k.^2+(-4).*d.*h1.*k.^2+2.*h1.^2.*k.^2).*cosh(2.* ...
  h1.*k))).^(-1).*((-4).*d.*eta2.^2.*k.^2.*r1+(-4).*eta1.* ...
  eta2.*h1.*k.^2.*r1+4.*eta2.^2.*h1.*k.^2.*r1+(-8).*d.^2.* ...
  eta1.*eta2.*h1.*k.^4.*r1+16.*d.*eta1.*eta2.*h1.^2.*k.^4.*r1+ ...
  (-8).*d.*eta2.^2.*h1.^2.*k.^4.*r1+(-8).*eta1.*eta2.*h1.^3.* ...
  k.^4.*r1+8.*eta2.^2.*h1.^3.*k.^4.*r1+(-4).*d.*eta1.^2.* ...
  k.^2.*r2+(-4).*d.*eta2.^2.*k.^2.*r2+4.*eta1.^2.*h1.*k.^2.* ...
  r2+(-8).*eta1.*eta2.*h1.*k.^2.*r2+4.*eta2.^2.*h1.*k.^2.*r2+( ...
  -8).*d.*eta1.^2.*h1.^2.*k.^4.*r2+16.*d.*eta1.*eta2.*h1.^2.* ...
  k.^4.*r2+(-8).*d.*eta2.^2.*h1.^2.*k.^4.*r2+8.*eta1.^2.* ...
  h1.^3.*k.^4.*r2+(-16).*eta1.*eta2.*h1.^3.*k.^4.*r2+8.* ...
  eta2.^2.*h1.^3.*k.^4.*r2+(-4).*eta1.*eta2.*h1.*k.^2.*r1.* ...
  cosh(2.*(d+(-1).*h1).*k)+4.*d.*eta2.^2.*k.^2.*r1.*cosh(2.* ...
  h1.*k)+(-4).*eta2.^2.*h1.*k.^2.*r1.*cosh(2.*h1.*k)+(-4).*d.* ...
  eta1.^2.*k.^2.*r2.*cosh(2.*h1.*k)+4.*d.*eta2.^2.*k.^2.*r2.* ...
  cosh(2.*h1.*k)+4.*eta1.^2.*h1.*k.^2.*r2.*cosh(2.*h1.*k)+(-4) ...
  .*eta2.^2.*h1.*k.^2.*r2.*cosh(2.*h1.*k)+eta1.*eta2.*k.*r1.* ...
  sinh(2.*d.*k)+eta2.^2.*k.*r1.*sinh(2.*d.*k)+eta1.^2.*k.*r2.* ...
  sinh(2.*d.*k)+2.*eta1.*eta2.*k.*r2.*sinh(2.*d.*k)+eta2.^2.* ...
  k.*r2.*sinh(2.*d.*k)+(-1).*eta1.*eta2.*k.*r1.*sinh(2.*(d+( ...
  -2).*h1).*k)+eta2.^2.*k.*r1.*sinh(2.*(d+(-2).*h1).*k)+ ...
  eta1.^2.*k.*r2.*sinh(2.*(d+(-2).*h1).*k)+(-2).*eta1.*eta2.* ...
  k.*r2.*sinh(2.*(d+(-2).*h1).*k)+eta2.^2.*k.*r2.*sinh(2.*(d+( ...
  -2).*h1).*k)+(-2).*eta2.^2.*k.*r1.*sinh(2.*(d+(-1).*h1).*k)+ ...
  (-4).*eta2.^2.*h1.^2.*k.^3.*r1.*sinh(2.*(d+(-1).*h1).*k)+2.* ...
  eta1.^2.*k.*r2.*sinh(2.*(d+(-1).*h1).*k)+(-2).*eta2.^2.*k.* ...
  r2.*sinh(2.*(d+(-1).*h1).*k)+4.*eta1.^2.*h1.^2.*k.^3.*r2.* ...
  sinh(2.*(d+(-1).*h1).*k)+(-4).*eta2.^2.*h1.^2.*k.^3.*r2.* ...
  sinh(2.*(d+(-1).*h1).*k)+2.*eta1.*eta2.*k.*r1.*sinh(2.*h1.* ...
  k)+4.*d.^2.*eta1.*eta2.*k.^3.*r1.*sinh(2.*h1.*k)+(-8).*d.* ...
  eta1.*eta2.*h1.*k.^3.*r1.*sinh(2.*h1.*k)+4.*eta1.*eta2.* ...
  h1.^2.*k.^3.*r1.*sinh(2.*h1.*k)+sqrt(k.^2.*(((-4).*d.* ...
  eta2.^2.*k.*r1+(-4).*eta1.*eta2.*h1.*k.*r1+4.*eta2.^2.*h1.* ...
  k.*r1+(-8).*d.^2.*eta1.*eta2.*h1.*k.^3.*r1+16.*d.*eta1.* ...
  eta2.*h1.^2.*k.^3.*r1+(-8).*d.*eta2.^2.*h1.^2.*k.^3.*r1+(-8) ...
  .*eta1.*eta2.*h1.^3.*k.^3.*r1+8.*eta2.^2.*h1.^3.*k.^3.*r1+( ...
  -4).*d.*eta1.^2.*k.*r2+(-4).*d.*eta2.^2.*k.*r2+4.*eta1.^2.* ...
  h1.*k.*r2+(-8).*eta1.*eta2.*h1.*k.*r2+4.*eta2.^2.*h1.*k.*r2+ ...
  (-8).*d.*eta1.^2.*h1.^2.*k.^3.*r2+16.*d.*eta1.*eta2.*h1.^2.* ...
  k.^3.*r2+(-8).*d.*eta2.^2.*h1.^2.*k.^3.*r2+8.*eta1.^2.* ...
  h1.^3.*k.^3.*r2+(-16).*eta1.*eta2.*h1.^3.*k.^3.*r2+8.* ...
  eta2.^2.*h1.^3.*k.^3.*r2+(-4).*eta1.*eta2.*h1.*k.*r1.*cosh( ...
  2.*(d+(-1).*h1).*k)+4.*(d+(-1).*h1).*k.*((-1).*eta1.^2.*r2+ ...
  eta2.^2.*(r1+r2)).*cosh(2.*h1.*k)+eta1.*eta2.*r1.*sinh(2.* ...
  d.*k)+eta2.^2.*r1.*sinh(2.*d.*k)+eta1.^2.*r2.*sinh(2.*d.*k)+ ...
  2.*eta1.*eta2.*r2.*sinh(2.*d.*k)+eta2.^2.*r2.*sinh(2.*d.*k)+ ...
  (-1).*eta1.*eta2.*r1.*sinh(2.*(d+(-2).*h1).*k)+eta2.^2.*r1.* ...
  sinh(2.*(d+(-2).*h1).*k)+eta1.^2.*r2.*sinh(2.*(d+(-2).*h1).* ...
  k)+(-2).*eta1.*eta2.*r2.*sinh(2.*(d+(-2).*h1).*k)+eta2.^2.* ...
  r2.*sinh(2.*(d+(-2).*h1).*k)+(-2).*eta2.^2.*r1.*sinh(2.*(d+( ...
  -1).*h1).*k)+(-4).*eta2.^2.*h1.^2.*k.^2.*r1.*sinh(2.*(d+(-1) ...
  .*h1).*k)+2.*eta1.^2.*r2.*sinh(2.*(d+(-1).*h1).*k)+(-2).* ...
  eta2.^2.*r2.*sinh(2.*(d+(-1).*h1).*k)+4.*eta1.^2.*h1.^2.* ...
  k.^2.*r2.*sinh(2.*(d+(-1).*h1).*k)+(-4).*eta2.^2.*h1.^2.* ...
  k.^2.*r2.*sinh(2.*(d+(-1).*h1).*k)+2.*eta1.*eta2.*r1.*sinh( ...
  2.*h1.*k)+4.*d.^2.*eta1.*eta2.*k.^2.*r1.*sinh(2.*h1.*k)+(-8) ...
  .*d.*eta1.*eta2.*h1.*k.^2.*r1.*sinh(2.*h1.*k)+4.*eta1.* ...
  eta2.*h1.^2.*k.^2.*r1.*sinh(2.*h1.*k)).^2+4.*eta2.*r1.*r2.*( ...
  (eta1+eta2).^2.*cosh(2.*d.*k)+(eta1+(-1).*eta2).^2.*cosh(2.* ...
  (d+(-2).*h1).*k)+2.*(eta1.^2+eta2.^2+2.*d.^2.*eta1.^2.*k.^2+ ...
  2.*d.^2.*eta2.^2.*k.^2+(-4).*d.*eta1.^2.*h1.*k.^2+8.*d.* ...
  eta1.*eta2.*h1.*k.^2+(-4).*d.*eta2.^2.*h1.*k.^2+4.*eta1.^2.* ...
  h1.^2.*k.^2+(-8).*eta1.*eta2.*h1.^2.*k.^2+4.*eta2.^2.* ...
  h1.^2.*k.^2+4.*d.^2.*eta1.^2.*h1.^2.*k.^4+(-8).*d.^2.*eta1.* ...
  eta2.*h1.^2.*k.^4+4.*d.^2.*eta2.^2.*h1.^2.*k.^4+(-8).*d.* ...
  eta1.^2.*h1.^3.*k.^4+16.*d.*eta1.*eta2.*h1.^3.*k.^4+(-8).* ...
  d.*eta2.^2.*h1.^3.*k.^4+4.*eta1.^2.*h1.^4.*k.^4+(-8).*eta1.* ...
  eta2.*h1.^4.*k.^4+4.*eta2.^2.*h1.^4.*k.^4+(eta1.^2+(-1).* ...
  eta2.^2).*(1+2.*h1.^2.*k.^2).*cosh(2.*(d+(-1).*h1).*k)+( ...
  eta1.^2+(-1).*eta2.^2).*(1+2.*d.^2.*k.^2+(-4).*d.*h1.*k.^2+ ...
  2.*h1.^2.*k.^2).*cosh(2.*h1.*k))).*(((-1).*eta1+(-1).*eta2) ...
  .*cosh(2.*d.*k)+(eta1+(-1).*eta2).*cosh(2.*(d+(-2).*h1).*k)+ ...
  2.*((-1).*eta2+(-4).*d.*eta1.*h1.*k.^2+4.*eta1.*h1.^2.*k.^2+ ...
  (-2).*eta2.*h1.^2.*k.^2+eta2.*(1+2.*h1.^2.*k.^2).*cosh(2.*( ...
  d+(-1).*h1).*k)+eta2.*cosh(2.*h1.*k)+2.*eta1.*h1.*k.*sinh( ...
  2.*(d+(-1).*h1).*k)+2.*d.*eta1.*k.*sinh(2.*h1.*k)+(-2).* ...
  eta1.*h1.*k.*sinh(2.*h1.*k))))));

tau = real(1./w22);