The error

advertisement
The error
Figure 1 |Difference| between 19 points and 20 points divided by value.
For values of z < -2.6, Gauss Laguerre integration is accurate to machine precision. Above this value Gauss
Legendre is probably better.
Codes
aiglz.wpj is set up to produce
03/06/2006 06:39a
37,000 BRACK.OUT
03/06/2006 06:39a
37,000 AIGAUSS.OUT
03/06/2006 06:39a
16,000 ERR.OUT – plotted above.
TGLAGU.FOR is set up to test Gauss Laguerre integration on an analytic function. – obsolete – will need revision to
be used.
The code BRGLAGU.FOR is set up to return Brack(z,ert) where ert is the error in brack.

 t2  
2
Ln( AiGau ( z ))   z  ln(2 z )  ln( ) / 2  ln   exp  t  exp   2 dt 
 4z  
0
I am removed the logarithm and the exp(-z2) in view of the fact that these limit the accuracy, to find
AiGauss( z )  exp   z 2  Brack  z 

 t2  
  exp  t  exp   2 dt 
 4z  
Brack  z    0


2z 




Gauss Laguerre
Change variables to t’=t-z
0
1
1
2
AiGauss  z  
 exp   t  z  dt ' 

Or
AiGauss  z  

exp   z 2 

For z = 0, AiGauss  0  



0
 exp  t
2
 2tz  z 2 dt

0
 exp  2tz  t dt
2

1

0
 exp  t dt  2
2
1

For z not equal to zero, change variables again to t’=-2tz, so that dt=-dt’/2z
exp   z 2  0

t '2 
AiGauss  z  
 exp  t ' 4 z 2 dt
2 z  
Now let t = - t’
exp   z 2  
 t2 
AiGauss  z  
exp

t
exp


  2 dt
2 z  0
 4z 
Be sure to note that exp(-t) is absorbed into the definition of Gauss Laguerre integration, that is

N
0
i 1
 exp  t  f  t  dt   Ai f  xi 
For small values of z, the integrand becomes a delta function, which is hard to evaluate numerically.
AiGlz.for returns answers to double precision accuracy for z < -2.6. .
Download