This commit is contained in:
Kent English
2017-02-22 23:18:01 -05:00
parent 895b77093e
commit a94452c8c8
6 changed files with 10 additions and 10 deletions

View File

@@ -15,7 +15,7 @@ https://lists.debian.org/debian-legal/2004/12/msg00295.html
*/
var (
badParamOutOfBounds = "cephes: parameter out of bounds"
paramOutOfBounds = "cephes: parameter out of bounds"
badParamUnderflow = "cephes: underflow error"
badParamFunctionSingularity = "cephes: function singularity"
)

View File

@@ -135,7 +135,7 @@ func Igam(a, x float64) float64 {
}
if x < 0 || a <= 0 {
panic(badParamOutOfBounds)
panic(paramOutOfBounds)
}
// Asymptotic regime where a ~ x; see [2].
@@ -155,7 +155,7 @@ func Igam(a, x float64) float64 {
// IgamC computes the complement of the incomplete Gamma integral
func IgamC(a, x float64) float64 {
if x < 0 || a <= 0 {
panic(badParamOutOfBounds)
panic(paramOutOfBounds)
} else if x == 0 {
return 1
} else if math.IsInf(x, 0) {

View File

@@ -78,7 +78,7 @@ func IgamI(a, y0 float64) float64 {
dithresh := 5.0 * machEp
if y0 < 0 || y0 > 1 || a <= 0 {
panic(badParamOutOfBounds)
panic(paramOutOfBounds)
}
if y0 == 0 {

View File

@@ -24,7 +24,7 @@ const (
// Incbet computes the regularized incomplete beta function.
func Incbet(aa, bb, xx float64) float64 {
if aa <= 0 || bb <= 0 {
panic(badParamOutOfBounds)
panic(paramOutOfBounds)
}
if xx <= 0 || xx >= 1 {
if xx == 0 {
@@ -33,7 +33,7 @@ func Incbet(aa, bb, xx float64) float64 {
if xx == 1 {
return 1
}
panic(badParamOutOfBounds)
panic(paramOutOfBounds)
}
var flag int

View File

@@ -108,13 +108,13 @@ func Ndtri(y0 float64) float64 {
if y0 <= 0.0 {
if y0 < 0 {
panic(badParamOutOfBounds)
panic(paramOutOfBounds)
}
return math.Inf(-1)
}
if y0 >= 1.0 {
if y0 > 1 {
panic(badParamOutOfBounds)
panic(paramOutOfBounds)
}
return math.Inf(1)
}

View File

@@ -82,7 +82,7 @@ func Zeta(x, q float64) float64 {
}
if x < 1 {
panic(badParamOutOfBounds)
panic(paramOutOfBounds)
}
if q <= 0 {
@@ -90,7 +90,7 @@ func Zeta(x, q float64) float64 {
panic(badParamFunctionSingularity)
}
if x != math.Floor(x) {
panic(badParamOutOfBounds) // because q^-x not defined
panic(paramOutOfBounds) // because q^-x not defined
}
}