% Written by Min-Hua Huang
% June 9, 2011
% Table 2 of "Indefinite Integration of the Gamma Integral".
% Simulation Results of Numerical Precision by Varying $C$ and $t$.
clear; clc; format long; correct=ones(3,1); x=0.5;
fprintf('Numerical Precision by Varying C and t.\n');
fprintf('Target of analysis: En(0.5), n=1,5,10; C=5,10,15,20.\n');
correct(1,1)=x^(1-1)*quadv('f1expo',x,10000,1e-15);
correct(2,1)=x^(5-1)*quadv('f5expo',x,10000,1e-15);
correct(3,1)=x^(10-1)*quadv('f10expo',x,10000,1e-15);   
result=ones(12,4)*-999; kk=1;
for c=5:5:20
kkk=1;    
    for i=3:1:6
        n=10^i; 
        result(kkk,kk)=(x/c)^(1-1)*exp(-c)*h(-1,-c,n)-exp(-x)*h(-1,-x,n)-correct(1,1);
        result(4+kkk,kk)=(x/c)^(5-1)*exp(-c)*h(-5,-c,n)-exp(-x)*h(-5,-x,n)-correct(2,1);
        result(8+kkk,kk)=(x/c)^(10-1)*exp(-c)*h(-10,-c,n)-exp(-x)*h(-10,-x,n)-correct(3,1);
        kkk=kkk+1;
    end
kk=kk+1;
end
for i=1:1:12
    g=mod(i,4);
    if g==0;
       g=4;
    end   
    if i<=4
        fprintf('\nE1(0.5) ,t=10^%1u,significant digits:',g+2);
    end
    if i>4 && i<=8
        fprintf('\nE5(0.5) ,t=10^%1u,significant digits:',g+2);       
    end
    if i>8 && i<=12
        fprintf('\nE10(0.5),t=10^%1u,significant digits:',g+2);       
    end    
        for j=1:1:4
            sdp=floor(-log10(abs(result(i,j))));
            fprintf('%2u(C=%2u)',sdp,j*5); 
        end    
end
fprintf('\n\n');       
