% SEPSALG Symbolic counterpart of epsalg.m
%
function E=sepsalg(dig,n,s)
digits(dig)
if n<2, error('n too small'), end
if size(s,1)~=n, error('s and n incompatible'), end
E=zeros(n,n+1);
E=vpa(E);
ss=vpa(s);
E(:,2)=ss;
for k=3:n+1
  for m=1:n+2-k
%    if E(m+1,k-1)==E(m,k-1), break, end
    E(m,k)=vpa(E(m+1,k-2)+1/(E(m+1,k-1)-E(m,k-1)));
  end
end
