Subject: Extra digits to fpprec for calculation of Gamma
From: Raymond Toy
Date: Tue, 14 Oct 2008 18:24:08 -0400
Dieter Kaiser wrote:
> Hello,
[interesting precision results deleted]
> Actually the precsion of bffac is controlled by the forumla
>
> k:2*(entier(0.41*fpprec)+1)
>
> The +5 extra digits contribute with 4 extra terms in the loop to calculate
> Gamma. If we would optimize the speed e.g. for fpprec:16 up to 500 only +3 extra
> digits are needed and 2 extra terms have to be added in the loop.
>
> At first we could do something like:
>
> (defvar $gamma_incfpprec 5
> "Extra digits in call to bffac to achive full precision of gamma")
>
> ...
> bffac(z,$fpprec+$gamma_incfpprec)
> ...
>
> This should be documented for the user. Perhaps it is possible to find a more
> general formula for the value of k, so we do not need an extra flag.
While we should try produce accurate values for bigfloat computations, I
don't think we really need to make things more complicated. If the user
is concerned, it's easy enough for the user to increase fpprec. (Not so
with native floats, so we should try hard to be as accurate as
reasonably possible.)
I would be happy to either leave things as they are, or just always add
3 (or 5 or whatever).
Ray