# [Maxima] gamma function test suite failures

Dieter Kaiser drdieterkaiser at web.de
Sun Oct 12 11:31:33 CDT 2008

```Hallo Barton,

Here are the results on my system with GCL 2.6.8.

********************** Problem 140 ***************
Input:
1
closeto(gamma(-) - 2.678938534707748, 2.0000000000000002E-15)
3

Result:
true

... Which was correct.
**********************
I think this problem fails on your system because of a a little change in the
algorithm of gamma-lanczos. At one place in the code a Logarithm is calculated
to prevend overflow. So the accuracy of gamma-lanczos is somewhat influenced. As
reported on this mailing list then mean value of the precision of gamma-lanczos
is about 9e-15 for values between 1/2 and 75. So a precsion of 2.0e-15 can not
be expected.
********************** Problem 302 ***************
Input:
relerror(gamma_incomplete(2.5 %i + 5.0, 2.5 %i + 5.0),
- 3.843825405733108837026233752472379492036b0 %i
- 3.966094476128530812031476427059327525924b0, 1.0E-14)

Result:
true

... Which was correct.
**********************
In this problem we need the values of gamma-lanczos too. Here we lost precision
due to the algorithm of the Gamma Incomplete function for complex float
calculations.

I think it is the best do adjust the expected precision of the two problems a
bit. What is reported on your system as a result for the tests?

Dieter Kaiser

-----Ursprüngliche Nachricht-----
Von: willisb at unk.edu [mailto:willisb at unk.edu]
Gesendet: Sonntag, 12. Oktober 2008 17:58
An: Dieter Kaiser
Cc: maxima at math.utexas.edu
Betreff: gamma function test suite failures

Incidentally, using SBCL 1.0.19 + i686-pc-mingw32 + CVS Maxima, I get test
suite errors for rtest14 #140 and rtest_gamma #302. Both of these tests
seem to be related to the gamma function.

Thanks for all the work you've done on the gamma function.

Barton

```