More data concerning the precision of bigfloat calculation of gamma



Yes, we can add some digits. I have tested to add some more digits in the call
of bffac.

That is the modified function call in the routine simpgamma:

(($bfloatp j) (mfuncall '$bffac (m+ j -1) (+ $fpprec 3)))

Adding 3 digits we get significant digits up to a precsion of about fpprec :
512. With increasing precision more extra digits are needed. Therefore it might
be much better to modify directly the function bbfac. The code which controls
the precision of bffac is:
 
k:2*(entier(0.41*fpprec)+1)

Here the results with extra digits in the call to bffac:

...................................................
Test of precision with fpprec : 16
          
        fpprec    fpprec+1  fpprec+2  fpprec+3
meanerr 2.05b-15  3.01b-16  3.57b-17  3.87b-18
maxerr  9.16b-15  1.31b-15  2.43b-16  2.72b-17

...................................................
Test of precision with fpprec : 32
        
        fpprec    fpprec+1  fpprec+2  fpprec+3
meanerr 3.37b-31  6.51b-32  6.49b-33  5.75b-34
maxerr  1.39b-30  2.77b-31  2.70b-32  3.18b-33

...................................................
Test of precision with fpprec : 64
          
        fpprec    fpprec+1  fpprec+2  fpprec+3
meanerr 1.45b-62  1.74b-63  1.26b-64  1.65b-65
maxerr  4.85b-62  6.40b-63  4.27b-64  6.06b-65

...................................................
Test of precision with fpprec : 128

        fpprec     fpprec+1   fpprec+2   fpprec+3
meanerr 2.95b-126  3.56b-127  3.48b-128  3.00b-129
maxerr  7.67b-126  8.82b-127  9.76b-128  7.87b-129

...................................................
Test of precision with fpprec : 256
          
        fpprec     fpprec+1   fpprec+2   fpprec+3
meanerr 9.67b-254  1.12b-254  7.72b-256  8.46b-257
maxerr  1.92b-253  2.60b-254  1.78b-255  2.27b-256

...................................................
Test of precision with fpprec : 512
          
        fpprec     fpprec+1   fpprec+2   fpprec+3
meanerr 9.69b-510  5.22b-511  3.89b-512  1.02b-512
maxerr  2.53b-509  1.45b-510  1.49b-511  2.20b-512

...................................................
Test of precision with fpprec : 1024

        fpprec      fpprec+1    fpprec+2    fpprec+3
meanerr 2.64b-1020  3.15b-1021  2.02b-1022  2.55b-1023
maxerr  3.21b-1020  3.94b-1021  2.45b-1022  3.19b-1023

...................................................
Dieter Kaiser

-----Urspr?ngliche Nachricht-----
Von: fateman at cs.berkeley.edu [mailto:fateman at cs.berkeley.edu] 
Gesendet: Samstag, 11. Oktober 2008 18:24
An: 'Dieter Kaiser'
Cc: 'Maxima List'
Betreff: RE: [Maxima] More data concerning the precision of bigfloat calculation
of gamma

If you feel that the accuracy is not full precision, you know that you can
increase fpprec during the calculation to get more correct digits. 
This is what (for example) Mathematica does.

If time is not important, you can compute the result in precision n+5 and
n+10.  If they agree to n digits,
then they are (very probably) correct digits.

Testing at random inputs is usually not very effective in determining the
"worst case" errors.
Knowing what the algorithm does, and testing at critical points, helps.

RJF