function y=spchebev(B,X)
%SPCHEBEV	SPEM modified Chebyshev polynomial evaluation
%	Y = SPCHEBEV(B,X) evaluates at point X the SPEM modified 
%	Chebyshev polynomial having the polynomial coefficients given 
%	by vector B.
%
%	Uses inverse cosines so its kinf of slow
%
%	John Wilkin
%	21 October 92

N = length(B)-1;

arg = -acos(X);

P(1) = 1;

for k=1:N
  P(k+1)= cos(k*arg);
end

for k=2:2:N
  P(k+1) = P(k+1) + 1/(k^2-1);
end

y = P*B;

