function  out=Pathology(X)

n=size(X,2)-1;
r=[];
for i=1:n
r=[(sin(   sqrt(X(:,i+1).^2+100*X(:,i).^2)       ).^2-0.5)./ ( 0.001*( X(:,i+1).^2-2*X(:,i+1).*X(:,i)+X(:,i).^2).^2 +1  ),r];
end

out=sum(r,2)+0.5*n;


    