% test Hankel recurrence relations... Barnett 11/7/12

if 0 % first, Hankels are slow!
tic; for n=0:99, besselh(n,1e3*rand(1e4,1)); end, toc % up to 3 us
tic; for n=0:1, besselh(n,1e3*rand(1e6,1)); end, toc % 2 us
tic; for n=0:99, exp(1i*n*1e2*rand(1e5,1)); end, toc % cexp = 40 ns
end

z = .01; mmax = 30;
h = besselh([0 1]', z);
for n=1:mmax-1
  h(n+2) = 2*n/z*h(n+1) - h(n);
end
hex = besselh((0:mmax)',z);
abs((h - hex)./hex)
