-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherf32.go
More file actions
49 lines (44 loc) · 1 KB
/
Copy patherf32.go
File metadata and controls
49 lines (44 loc) · 1 KB
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
package floats
import "math"
// Erf returns the error function of a.
//
// Special cases are:
//
// +Inf.Erf() = 1
// -Inf.Erf() = -1
// NaN.Erf() = NaN
func (a Float32) Erf() Float32 {
return NewFloat32(math.Erf(a.Float64().BuiltIn()))
}
// Erfc returns the complementary error function of x.
//
// Special cases are:
//
// +Inf.Erfc() = 0
// -Inf.Erfc() = 2
// NaN.Erfc() = NaN
func (a Float32) Erfc() Float32 {
return NewFloat32(math.Erfc(a.Float64().BuiltIn()))
}
// Erfinv returns the inverse error function of a.
//
// Special cases are:
//
// 1.Erfinv() = +Inf
// -1.Erfinv() = -Inf
// x.Erfinv() = NaN if x < -1 or x > 1
// NaN.Erfinv() = NaN
func (a Float32) Erfinv() Float32 {
return NewFloat32(math.Erfinv(a.Float64().BuiltIn()))
}
// Erfcinv returns the inverse of [Erfc](a).
//
// Special cases are:
//
// 0.Erfcinv() = +Inf
// 2.Erfcinv() = -Inf
// x.Erfcinv() = NaN if x < 0 or x > 2
// NaN.Erfcinv() = NaN
func (a Float32) Erfcinv() Float32 {
return NewFloat32(math.Erfcinv(a.Float64().BuiltIn()))
}