Source File
gamma.go
Belonging Package
math
package math
var _gamP = [...]float64{
1.60119522476751861407e-04,
1.19135147006586384913e-03,
1.04213797561761569935e-02,
4.76367800457137231464e-02,
2.07448227648435975150e-01,
4.94214826801497100753e-01,
9.99999999999999996796e-01,
}
var _gamQ = [...]float64{
-2.31581873324120129819e-05,
5.39605580493303397842e-04,
-4.45641913851797240494e-03,
1.18139785222060435552e-02,
3.58236398605498653373e-02,
-2.34591795718243348568e-01,
7.14304917030273074085e-02,
1.00000000000000000320e+00,
}
var _gamS = [...]float64{
7.87311395793093628397e-04,
-2.29549961613378126380e-04,
-2.68132617805781232825e-03,
3.47222221605458667310e-03,
8.33333333333482257126e-02,
}
func ( float64) (float64, float64) {
if > 200 {
return Inf(1), 1
}
const (
= 2.506628274631000502417
= 143.01608
)
:= 1 /
= 1 + *((((_gamS[0]*+_gamS[1])*+_gamS[2])*+_gamS[3])*+_gamS[4])
:= Exp()
:= 1.0
if > { // avoid Pow() overflow
:= Pow(, 0.5*-0.25)
, = , /
} else {
= Pow(, -0.5) /
}
return , * *
}
:= 1.0
for >= 3 {
= - 1
= *
}
for < 0 {
if > -1e-09 {
goto
}
= /
= + 1
}
for < 2 {
if < 1e-09 {
goto
}
= /
= + 1
}
if == 2 {
return
}
= - 2
= (((((*_gamP[0]+_gamP[1])*+_gamP[2])*+_gamP[3])*+_gamP[4])*+_gamP[5])* + _gamP[6]
= ((((((*_gamQ[0]+_gamQ[1])*+_gamQ[2])*+_gamQ[3])*+_gamQ[4])*+_gamQ[5])*+_gamQ[6])* + _gamQ[7]
return * /
:
if == 0 {
return Inf(1)
}
return / ((1 + *) * )
}
func ( float64) bool {
if < 0 {
, := Modf()
return == 0
}
return false
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |