pkg load symbolic

a = 1;
b = 100;
N = 100;

xs = linspace(sym(a),sym(b), N);
x = linspace(a, b, N);

tic
A = expint(1i*xs);
toc

tic
A = double(A);
toc

tic
B = expint(1i*x);
toc

figure(1); clf
semilogy(x, abs(A - B))
ylabel('error')
xlabel('imag(x)')
