Skip to content

Commit 3a29e99

Browse files
committed
feat: prettier minoration
1 parent 2846c73 commit 3a29e99

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/mutate/mutate.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package mutate
22

33
import (
44
"fmt"
5+
"math"
56
"math/rand"
67
"path/filepath"
78
"regexp"
@@ -672,12 +673,11 @@ func isDeclarationLine(line string) bool {
672673
return false
673674
}
674675

676+
var max_snippets float64 = 20
677+
675678
func Gx() float32 {
676-
x := rand.Float32()
677-
return max(
678-
(1-x)*(1-x)*(1-x),
679-
0.1,
680-
) // to avoid injecting more than 10 snippets for the time being
679+
x := rand.Float64()
680+
return float32(math.Pow((1-1/max_snippets)-x, 3) + 1/max_snippets)
681681
}
682682

683683
var target float32 = 0.75

0 commit comments

Comments
 (0)