• Mohit Agarwal's avatar
    math: speed up Gamma(+Inf) · 7eed848a
    Mohit Agarwal authored
    Add special case for Gamma(+∞) which speeds it up:
    
    benchmark            old ns/op     new ns/op     delta
    BenchmarkGamma-4     14.5          7.44          -48.69%
    
    The documentation for math.Gamma already specifies it as a special
    case:
    
            Gamma(+Inf) = +Inf
    
    The original C code that has been used as the reference implementation
    (as mentioned in the comments in gamma.go) also treats Gamma(+∞) as a
    special case:
    
    if( x == INFINITY )
            return(x);
    
    Change-Id: Idac36e19192b440475aec0796faa2d2c7f8abe0b
    Reviewed-on: https://go-review.googlesource.com/31370Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    7eed848a
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...