-
Notifications
You must be signed in to change notification settings - Fork 1
/
li_test.go
46 lines (40 loc) · 1.05 KB
/
li_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright (c) 2018, Jack Parkinson. All rights reserved.
// Use of this source code is governed by the BSD 3-Clause
// license that can be found in the LICENSE file.
package special_test
import (
"testing"
. "scientificgo.org/special"
"scientificgo.org/testutil"
)
var casesLi = []struct {
Label string
In, Out float64
}{
{"", -1, nan},
{"", 1e-300, -1.4455586289196509e-303},
{"", 1e-100, -4.324245377202095e-103},
{"", 1e-50, -8.611722553713826e-53},
{"", 1e-25, -1.707997398334023e-27},
{"", 1e-15, -2.815944392958954e-17},
{"", 1e-14, -3.0113475954567504e-16},
{"", 1e-13, -3.2359176090698706e-15},
{"", 1e-12, -3.4967184067697225e-14},
{"", 1e-10, -4.168887750019648e-12},
{"", 1e-08, -5.161659103222967e-10},
{"", 1e-07, -5.859859508790472e-09},
{"", 1e-05, -8.036767291447334e-07},
{"", 2, 1.045163780117493},
{"", 1e+250, 1.740206254656917e+247},
}
func TestLi(t *testing.T) {
testutil.Test(t, tol, casesLi, Li)
}
/*
func BenchmarkLi(b *testing.B) {
GlobalF = bench(b, cLi, "",
func(x []float64) float64 {
return Li(x[0])
})
}
*/