github.com/jgbaldwinbrown/perf@v0.1.1/pkg/stats/beta_test.go (about) 1 // Copyright 2015 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package stats 6 7 import ( 8 "testing" 9 ) 10 11 func TestBetaInc(t *testing.T) { 12 // Example values from MATLAB betainc documentation. 13 testFunc(t, "I_0.5(%v, 3)", 14 func(a float64) float64 { return mathBetaInc(0.5, a, 3) }, 15 map[float64]float64{ 16 0: 1.00000000000000, 17 1: 0.87500000000000, 18 2: 0.68750000000000, 19 3: 0.50000000000000, 20 4: 0.34375000000000, 21 5: 0.22656250000000, 22 6: 0.14453125000000, 23 7: 0.08984375000000, 24 8: 0.05468750000000, 25 9: 0.03271484375000, 26 10: 0.01928710937500, 27 }) 28 }