simon-git: spigot (master): Simon Tatham

Commits to Tartarus CVS repository. tartarus-commits at lists.tartarus.org
Fri Apr 24 19:43:23 BST 2015


TL;DR:
  cc5aa2c Stop calling the wrong versions of gamma and lgamma.

Repository:     git://git.tartarus.org/simon/spigot.git
On the web:     http://tartarus.org/~simon-git/gitweb/?p=spigot.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2015-04-24 19:43:23

commit cc5aa2c86b98121d2b6f89469ceca2fdd83cbd63
web diff http://tartarus.org/~simon-git/gitweb/?p=spigot.git;a=commitdiff;h=cc5aa2c86b98121d2b6f89469ceca2fdd83cbd63;hp=b8d8ff2f65d92aed4c3d6ce6774fc83d4e93ec60
Author: Simon Tatham <anakin at pobox.com>
Date:   Fri Apr 24 19:39:52 2015 +0100

    Stop calling the wrong versions of gamma and lgamma.
    
    When I introduced the new continued-fraction approach to the gamma
    function recently, I turned gamma.cpp into a hybrid of the old version
    and my experimental rewritten version, containing both algorithms and
    a wrapper layer to handle special cases and distinguish between them;
    the functions called spigot_gamma and spigot_lgamma in each of the
    input source files are now called things like spigot_gamma_by_foo.
    
    Unfortunately, I forgot to redirect the _calls_ to those functions as
    well. So the continued fraction version of spigot_lgamma calls the
    full externally-visible spigot_gamma function rather than the internal
    continued-fraction one, and similarly, the Stirling version of
    spigot_gamma calls the full spigot_lgamma rather than _its_ internal
    companion function.
    
    That was probably harmless: each wrapper function would surely have
    come back to the function I actually meant to call in any case that
    exercised this code path, and even if not, the happy accident that one
    of the strategies treats gamma as the primitive and lgamma as the
    derived function and the other vice versa would have prevented any
    uncontrolled recursion. But it wasn't what I meant to do! Fixed it.

 gamma.cpp |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



More information about the tartarus-commits mailing list