function A=Instability_Bessel_recursion

% instability of the Bessel recursion

n=input('number of steps: ');



% recursion for v(j)=u_{j-3/2}(2 pi)

v(1)=1/pi; v(2)=0;
for j=2:n+1
    v(j+1)=((2*j-3)/(2*pi))*v(j)-v(j-1);
end;

% backward recursion

w(n+2)=v(n+2);
w(n+1)=v(n+1);
for j=n+1:-1:2
    w(j-1)=((2*j-3)/(2*pi))*w(j)-w(j+1);
end;

% exact values

u=besselj(-1/2:1/2+n,2*pi);

A=[u',v',w'];
