-
Notifications
You must be signed in to change notification settings - Fork 1
/
chebyshevt_test.go
58 lines (52 loc) · 1.97 KB
/
chebyshevt_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
47
48
49
50
51
52
53
54
55
56
57
58
// 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 casesChebyshevT = []struct {
Label string
In1 int
In2, Out float64
}{
{"", 10, nan, nan},
{"", 2, -inf, inf},
{"", 3, -inf, -inf},
{"", 0, 1e5, 1},
{"", 1, 2.32, 2.32},
{"", 2, 0, -1},
{"", 2, 1, 1},
{"", 3, 0, 0},
{"", 3, -1.4, -6.776},
{"", 3, -4.4, -327.536},
{"", 10, 1.5, 7563.5},
{"", 10, 2.5, 3.1878115e+06},
{"", -10, 2.5, 3.1878115e+06},
{"", 16, 1.99, 6.4547281837215034665541948954599646855168e+08},
{"", 16, 2.01, 7.7645467147944436800278539843101104570368e+08},
{"", 21, 1.99, 4.5397997222940012819233231892806517536441070434281062e+11},
{"", 21, 2.01, 5.7856114552320908000776537065472996521518573992122777e+11},
{"", 33, 1.1, 1.137797818669236239727592226862531608576e+06},
{"", 33, 11.1, 1.2573303347299275791374654815312863736714899871905607e+44},
{"", 45, 1.1, 2.33204023744382373329089820779559738469382871230447616e+08},
{"", 49, 0.8, 0.9933225511631933137689172339171888803034293075968},
{"", 50, 0.8, 0.72543585253527006118086083303004714053466679410688},
{"", 104, 1.01, 1.20554806345269569487292725745680604127300849997758017e+06},
{"", 104, 2.01, 2.7632467820681488252250407833556540138929819278563989e+59},
{"", 500, 0.99, -0.08380355257963498672175647692443430558653333875743719137},
{"", 500, 1.99, 2.5992231515700692225279870727691535302914749336133571e+284},
{"", 500, 2.01, 8.3615293546276484931403502395120260481233491510195613e+286},
{"", 500, -2.01, 8.3615293546276484931403502395120260481233491510195613e+286},
}
func TestChebyshevT(t *testing.T) { testutil.Test(t, tol, casesChebyshevT, ChebyshevT) }
/*
func BenchmarkChebyshevT(b *testing.B) {
GlobalF = bench(b, cChebyshevT, "",
func(x []float64) float64 {
return ChebyshevT(int(x[0]), x[1])
})
}
*/