Question: Problem with minimal time computation !

I provide a code that I tried to optimize (minimize the calculation time) several times, finally I succeeded to:

######   Define global variables 
DGV:=proc() 
 global CI0P,CI1P,CK0P,CK1P,CK0G,CK1G; 

 CI0P:=Array([1,6.25,9.765625,6.781684,2.6490953,0.66227383,0.1149781,0.014665573,0.0014321849,0.11050809e-3,0.69067559e-5,0.35675392e-6,0.15484111e-7,0.57263725e-9,0.18260116e-10]); 
 CI1P:=Array([0.5,1.5625,1.6276042,0.8477105,0.26490953,0.055189486,0.82127211e-2,0.91659834e-3,0.79565828e-4,0.55254047e-5,0.31394345e-6,0.14864747e-7,0.59554274e-9,0.2045133e-10,0.60867054e-12]); 
 CK0P:=Array([-0.57721566,2.6424021,9.0115658,8.5185931,3.9898493,1.1299171,0.21532918,0.029560538,0.30657944e-2,0.24883689e-3,0.16242981e-4,0.87142913e-6,0.39112788e-7,0.14905278e-8,0.48833881e-10]); 
 CK1P:=Array([1,0.96519581,-26.280638,-44.329875,-29.269699,-10.636897,-2.468972,-0.39918196,-0.047620526,-0.43685559e-2,-0.31795287e-3,-0.18814687e-4,-0.92322279e-6,-0.38181087e-7,-0.13490886e-8]); 
 CK0G:=Array([1.2533141,-0.031332853,0.35249460e-2,-0.73436375e-3,0.2248989e-3,-0.91084054e-4,0.45921544e-4,-0.27716932e-4,0.19488468e-4,-0.15644909e-4,0.1411953e-4,-0.1415162e-4]); 
 CK1G:=Array([1.2533141,0.09399856,-0.587491e-2,0.10281093e-2,-0.28915573e-3,0.11132496e-3,-0.54270916e-4,0.31981075e-4,-0.2208693e-4,0.17485486e-4,-0.15605797e-4,0.15499393e-4]); 

end proc: 

DGV(); 

######   Generate the complex valued functions 
GBIKF012:=proc(XIn) 
 global CI0P,CI1P,CK0P,CK1P,CK0G,CK1G; 

 X11:=evalhf(XIn/2);XAbs:=evalhf(abs(XIn)); 
 XVal:=evalhf(XIn*XIn/25); 
 C11:=evalhf(ln(5/XAbs));C12:=ln(X11); 
 if XAbs<5 then 
  NST:=ceil(max(2,min(15,24.177/C11))); 
  FI0M:=evalhf(add(CI0P[i]*XVal^(i-1),i=2..NST)); 
  FI1M:=evalhf(XIn*add(CI1P[i]*XVal^(i-1),i=2..NST)); 
  FK0M:=evalhf(-FI0M*C12+add(CK0P[i]*XVal^(i-1),i=2..NST)); 
  FK0:=evalhf(FK0M-C12+CK0P[1]); 
  FK1M:=evalhf((FI1M*XIn*C12+add(CK1P[i]*XVal^(i-1),i=2..NST))/XIn+(CK0P[1]+0.5)*X11); 
  FK1:=evalhf(FK1M+1/XIn+XIn*(C12-CK0P[1]-0.5)/2); 
 else 
  C13:=evalhf(exp(-XIn)/sqrt(XIn)); 
  NST:=ceil(max(2,min(12,12.088/C11))); 
  FK0:=evalhf((CK0G[1]+add(CK0G[i]*XVal^(i-1),i=2..NST))*exp(-XIn)/sqrt(XIn)); 
  FK0M:=evalhf(FK0+ln(XIn/2)-CK0P[1]); 
  FK1:=evalhf((CK1G[1]+add(CK1G[i]*XVal^(i-1),i=2..NST))*C13); 
  FK1M:=evalhf(FK1-1/XIn-XIn*(C12-CK0P[1]-0.5)/2) fi; 

 FK2M:=evalhf(FK0M+FK1M*2/XIn);FK2:=evalhf(FK0+FK1*2/XIn); 
 return Array([FK0,FK1,FK2]); 
end proc:


The procedure I am talking about is GBIKF012 which uses  the previous defined global Arrays. When applied 250000 times the procedure takes at about 160 seconds, but the time should be less. I think the code could be optimized further but I don't know how...I'll be gratefull of some help.

P.S.: I noticed that the ln() takes a lot of time to be calculated when something else is stored in the memory, that's why I think it could be related to the way I store my data in the memory.

Please Wait...