function y = sineint(x)
% SINEINT (a.k.a. SININT)   Numerical Sine Integral
%	Used by FIRLS in the Signal Processing Toolbox.
%
%	See also SININT in the Symbolic Toolbox.

%	Copyright (c) 1984-94 by The MathWorks, Inc.
%       $Revision: 1.3 $  $Date: 1994/01/25 17:59:50 $

    y = zeros(size(x));
    ind = find(x);
    i = sqrt(-1);
    y(ind) = imag(expint(i*x(ind))) + pi/2;
    %  y(ind) = (1/(2*i))*(expint(i*x(ind)) - expint(-i*x(ind))) + pi/2;
