function wyn = gmpe_fcc_S(X,e,w,ipsylon_rp)
%Calculatet S value of FCC
    eN = size(e,2) ;
    v = tanh(X*w) ;
    v_sr = mean(v,1) ;
    e_sr =  mean(e,1) ;
    wyn = 0 ;
    for i = 1:eN
        wyn = wyn - abs(sum( (v(:,i)-v_sr(i)) .* (e(:,i)-e_sr(i)) ));
    end
    wyn = (1-ipsylon_rp) * wyn + ipsylon_rp * sum(w .* w) ;
end

