// Argmin returns the index of the min in a slice
342662
func Argmin(a []float64) int {
	var f float64
	var min int
	var set bool
	for i, v := range a {
		if !set {
			f = v
			min = i
			set = true

			continue
		}

		// TODO: Maybe error instead of this?
		if math.IsNaN(v) || math.IsInf(v, -1) {
			min = i
			f = v
			break
		}

		if v < f {
			min = i
			f = v
		}
	}
	return min
}
312102
func (c C) Asin() Input {
	return C(float32(math.Asin(float64(c))))
}
490636
func (t *IntTree) Min() IntInterface {
	if t.Root == nil {
		return nil
	}
	return t.Root.min().Elem
}
557252
func (ic *IntegerConstraint) Minimum(n float64) *IntegerConstraint {
	ic.applyMinimum = true
	ic.minimum = n
	return ic
}
247121
func builtin_min(args ...Value) (Value, error) {
	if len(args) == 0 {
		return nilValue, fmt.Errorf("missing arguments for function `min`")
	}
	x := args[0]
	for i, size := 1, len(args); i < size; i++ {
		lt, err := args[i].Lt(x)
		if err != nil {
			return Zero(), err
		}
		if lt.Bool() {
			x = args[i]
		}
	}
	return x, nil
}
851587
func MinOf(a []float32) (retVal float32) {
	if len(a) < 1 {
		panic("Cannot find the min of an empty slice")
	}
	return Reduce(min, a[0], a[1:]...)
}
1207544
func MinIntN(v ...int) int {
	switch len(v) {
	case 0:
		return 0
	case 1:
		return v[0]
	case 2:
		return MinInt(v[0], v[1])
	default:
		l := len(v) / 2
		return MinIntN(MinIntN(v[:l]...), MinIntN(v[l:]...))
	}
}
881215
func ByteIn(b byte, bs ...byte) int {
	for index, c := range bs {
		if b == c {
			return index
		}
	}

	return -1
}
1364021
func Min(v1, v2, v3, v4 float64) float64 {
	min := v1
	if v2 < min {
		min = v2
	}
	if v3 < min {
		min = v3
	}
	if v4 < min {
		min = v4
	}
	return min
}
771969
func asin(a float64) float64 {
	var negateResult bool
	if a < 0 {
		a = -a
		negateResult = true
	}
	if a <= asinMaxValueForTabs {
		index := int(a*asinIndexer + 0.5)
		delta := a - float64(index)*asinDelta
		result := asinTab[index] + delta*(asinDer1DivF1Tab[index]+delta*(asinDer2DivF2Tab[index]+delta*(asinDer3DivF3Tab[index]+delta*asinDer4DivF4Tab[index])))
		if negateResult {
			return -result
		}
		return result
	}
	// value > ASIN_MAX_VALUE_FOR_TABS, or value is NaN
	// This part is derived from fdlibm.
	if a < 1 {
		t := (1.0 - a) * 0.5
		p := t * (asinPs0 + t*(asinPs1+t*(asinPs2+t*(asinPs3+t*(asinPs4+t+asinPs5)))))
		q := 1.0 + t*(asinQs1+t*(asinQs2+t*(asinQs3+t*asinQs4)))
		s := math.Sqrt(t)
		z := s + s*(p/q)
		result := asinPio2Hi - ((z + z) - asinPio2Lo)
		if negateResult {
			return -result
		}
		return result
	}
	// value >= 1.0, or value is NaN
	if a == 1.0 {
		if negateResult {
			return -math.Pi / 2
		}
		return math.Pi / 2
	}
	return math.NaN()
}
370352
func (sf64 *SliceFloat64) Min() (float64, error) {
	if len(sf64.Elements) == 0 {
		return 0, errors.New("List is empty")
	}
	if !sort.Float64sAreSorted(sf64.Elements) {
		sort.Float64s(sf64.Elements)
	}
	return sf64.Elements[0], nil
}
1318270
func Min(first int, rest ...int) int {
	m := first
	for _, value := range rest {
		if value < m {
			m = value
		}
	}
	return m
}
768549
func RuneIn(ru rune, rs ...rune) int {
	for index, r := range rs {
		if r == ru {
			return index
		}
	}

	return -1
}
923386
func (s *Statistics) Minimum() float64 {
	s.RLock()
	defer s.RUnlock()
	return s.minimum
}
707716
func Min(x, y float32) float32 {
	return float32(math.Min(float64(x), float64(y)))
}
114412
func minimum(integers []int) (minVal int) {
	minVal = math.MaxInt32
	for _, v := range integers {
		if v < minVal {
			minVal = v
		}
	}
	return
}
928129
func GetArgsN(line string, n int, options ...GetArgsOption) []string {
	scanner := getScanner(line, options...)
	if n > 0 {
		n = n - 1
	}
	args, rest, _ := scanner.GetTokensN(n)
	if rest != "" {
		args = append(args, rest)
	}
	return args
}