Commit c1716337 authored by Charles L. Dorian's avatar Charles L. Dorian Committed by Rob Pike

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
parent c29cd8ab
...@@ -63,7 +63,7 @@ package math ...@@ -63,7 +63,7 @@ package math
// Stephen L. Moshier // Stephen L. Moshier
// moshier@na-net.ornl.gov // moshier@na-net.ornl.gov
var _P = []float64{ var _P = [...]float64{
1.60119522476751861407e-04, 1.60119522476751861407e-04,
1.19135147006586384913e-03, 1.19135147006586384913e-03,
1.04213797561761569935e-02, 1.04213797561761569935e-02,
...@@ -72,7 +72,7 @@ var _P = []float64{ ...@@ -72,7 +72,7 @@ var _P = []float64{
4.94214826801497100753e-01, 4.94214826801497100753e-01,
9.99999999999999996796e-01, 9.99999999999999996796e-01,
} }
var _Q = []float64{ var _Q = [...]float64{
-2.31581873324120129819e-05, -2.31581873324120129819e-05,
5.39605580493303397842e-04, 5.39605580493303397842e-04,
-4.45641913851797240494e-03, -4.45641913851797240494e-03,
...@@ -82,7 +82,7 @@ var _Q = []float64{ ...@@ -82,7 +82,7 @@ var _Q = []float64{
7.14304917030273074085e-02, 7.14304917030273074085e-02,
1.00000000000000000320e+00, 1.00000000000000000320e+00,
} }
var _S = []float64{ var _S = [...]float64{
7.87311395793093628397e-04, 7.87311395793093628397e-04,
-2.29549961613378126380e-04, -2.29549961613378126380e-04,
-2.68132617805781232825e-03, -2.68132617805781232825e-03,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment