-
Notifications
You must be signed in to change notification settings - Fork 1
/
ei_test.go
89 lines (83 loc) · 2.4 KB
/
ei_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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// 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 casesEi = []struct {
Label string
In, Out float64
}{
{"", nan, nan},
{"", 750, +inf},
{"", +inf, +inf},
{"", -inf, 0},
{"", 0, -inf},
{"", 1e-05, -10.935699800043695},
{"", 1e-10, -22.448635264938925},
{"", 0.01, -4.017929465426669},
{"", 1, 1.8951178163559368},
{"", 2, 4.95423435600189},
{"", 5, 40.18527535580318},
{"", 6, 85.9897621424392},
{"", 6.01, 86.66495316518093},
{"", 7.5, 289.3883982001446},
{"", 8, 440.37989953483816},
{"", 9, 1037.8782907170896},
{"", 10, 2492.2289762418777},
{"", 10.00001, 2492.251002806792},
{"", 15, 234955.8524907683},
{"", 20, 2.5615652664056588e+07},
{"", 25, 3.0059509065255485e+09},
{"", 27.5, 3.3153303643324104e+10},
{"", 29.99, 3.654282129023645e+11},
{"", 30, 3.689732094072742e+11},
{"", 35, 4.669055014466159e+13},
{"", 40, 6.039718263611242e+15},
{"", 45, 7.943916035704454e+17},
{"", 50, 1.058563689713169e+20},
{"", 100, 2.71555274485388e+41},
{"", 200, 3.6312352331593567e+84},
{"", 705, 2.138148975687854e+303},
{"", 716, 1.2605029106040893e+308},
{"", -1e-100, -229.68129363450305},
{"", -1e-10, -22.448635265138925},
{"", -1e-05, -10.935719800043696},
{"", -0.01, -4.037929576538114},
{"", -1, -0.21938393439552029},
{"", -2, -0.04890051070806112},
{"", -4, -0.0037793524098489067},
{"", -4.0000001, -0.0037793519519579615},
{"", -5, -0.0011482955912753257},
{"", -6, -0.0003600824521626587},
{"", -7, -0.00011548173161033822},
{"", -8, -3.76656228439249e-05},
{"", -9, -1.2447354178006272e-05},
{"", -10, -4.156968929685325e-06},
{"", -11, -1.4003003042474418e-06},
{"", -12, -4.7510818246724936e-07},
{"", -13, -1.6218662188014328e-07},
{"", -14, -5.5656311111451816e-08},
{"", -15, -1.918627892147867e-08},
{"", -20, -9.835525290649882e-11},
{"", -30, -3.0215520106888124e-15},
{"", -50, -3.783264029550459e-24},
{"", -100.5, -2.2232069135926296e-46},
{"", -105.5, -1.427644740730669e-48},
{"", -500, -1.4220767822536383e-220},
{"", -700, -1.406518766234033e-307},
}
func TestEi(t *testing.T) {
testutil.Test(t, tol, casesEi, Ei)
}
/*
func BenchmarkEi(b *testing.B) {
GlobalF = bench(b, cEi, "",
func(x []float64) float64 {
return Ei(x[0])
})
}
*/