From c171633780923d6eb02d2bf63446797e7940f9d1 Mon Sep 17 00:00:00 2001 From: "Charles L. Dorian" Date: Sat, 5 Nov 2011 12:25:36 -0700 Subject: [PATCH] math: faster Gamma Having the compiler count the number of array elements speeds up Gamma from 63.7 to 56.6 ns/op. R=rsc, golang-dev, r CC=golang-dev https://golang.org/cl/5362043 --- src/pkg/math/gamma.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pkg/math/gamma.go b/src/pkg/math/gamma.go index 01365070ebe..e117158fee2 100644 --- a/src/pkg/math/gamma.go +++ b/src/pkg/math/gamma.go @@ -63,7 +63,7 @@ package math // Stephen L. Moshier // moshier@na-net.ornl.gov -var _P = []float64{ +var _P = [...]float64{ 1.60119522476751861407e-04, 1.19135147006586384913e-03, 1.04213797561761569935e-02, @@ -72,7 +72,7 @@ var _P = []float64{ 4.94214826801497100753e-01, 9.99999999999999996796e-01, } -var _Q = []float64{ +var _Q = [...]float64{ -2.31581873324120129819e-05, 5.39605580493303397842e-04, -4.45641913851797240494e-03, @@ -82,7 +82,7 @@ var _Q = []float64{ 7.14304917030273074085e-02, 1.00000000000000000320e+00, } -var _S = []float64{ +var _S = [...]float64{ 7.87311395793093628397e-04, -2.29549961613378126380e-04, -2.68132617805781232825e-03,