SF [2159499] Full bigfloat precision for Gamma after the second call



As reported on Sourceforge.net I have studied the subtle bug that we do not get
the full precision of the Gamma function in the first call. I can reproduce the
bug with GCL 2.6.8 and CLISP 2.44.

I have studied the effect in more detail and detected that we have the
problem only for a negative argument to bffac. That is true for
gamma(0.5b0).

The reflection formula calculates:

bfloat(%pi*z/sin(%pi*z))/bffac(-z,fpprec)

If we add an additional bfloat to be sure that the argument of the sin
function has the correct precision the described effect that we need a
second call to get the full precision vanish. The modified line of code is

bfloat(%pi*z/sin(bfloat(%pi*z)))/bffac(-z,fpprec)

I have not really understand the effect, but it seems to me that the additional
bfloat works. Perhaps there is a problem with the sin function.

In the code of cbffac we have the same line of code. Therefore I expect the same
bug for the complex routine. I have not tested it.

I have first observed this problem testing the Incomplete Gamma function. Here I
did not understand why I do not get the desired precision for
gamma_incomplete(0.25b0,0.50b0) in the testsuite, but working on the console
(surely I have done more than one call to the function on the console).

Any comment? Has someone an idea what alternatively could be done to correct the
function?

Dieter Kaiser