// Sub performs element-wise subtraction between two vectors. It is equivalent to iterating
// over every element of v1 and subtracting the corresponding element of v2 from it.
19958
func (v1 Vec4) Sub(v2 Vec4) Vec4 {
	return Vec4{v1[0] - v2[0], v1[1] - v2[1], v1[2] - v2[2], v1[3] - v2[3]}
}
370167
func Sub(z, x *big.Int, y uint64) *big.Int {
	zw := z.Bits()
	switch xw := x.Bits(); {
	default:
		zw = sub(zw, xw, big.Word(y))
	case y == 0:
		zw = set(zw, xw)
	case len(xw) == 0:
		panic("underflow")
	}
	return z.SetBits(zw)
}
273729
func (p *Point) Subtract(p2 Point) *Point {
	p.X -= p2.X
	p.Y -= p2.Y
	return p
}
680355
func (s MeasurementStats) Sub(other MeasurementStats) {
	for name, v := range other {
		s[name] -= v
	}
}
1123386
func (l *Logger) Sub(app byte) *Logger {
	l.mu.RLock()
	defer l.mu.RUnlock()
	return &Logger{
		parent: l,
		app:    app,
	}
}
960922
func Sub(a, b []float32) {
	if len(a) != len(b) {
		panic("vectors must be the same length")
	}
	subAsm(a, b)
}
877449
func (x Vector) Diff() Vector {
	n := len(x)

	if n < 2 {
		return Vector{NA}
	} else {
		d := make(Vector, n-1)

		i := 1
		for i < n {
			d[i-1] = x[i] - x[i-1]
			i++
		}
		return d
	}
}
725329
func (o Timestamp) Sub(duration time.Duration) Timestamp {
	return o - Timestamp(duration/100)
}
995292
func Min(v1, v2 Vect) (out Vect) {
	if v1.X < v2.X {
		out.X = v1.X
	} else {
		out.X = v2.X
	}

	if v1.Y < v2.Y {
		out.Y = v1.Y
	} else {
		out.Y = v2.Y
	}
	return
}
78622
func (x Vector) Min() float64 {
	min := x[0]
	for _, v := range x {
		if v < min {
			min = v
		}
	}
	return min
}
128316
func (c ChordAngle) Sub(other ChordAngle) ChordAngle {
	if other == 0 {
		return c
	}
	if c <= other {
		return 0
	}
	x := float64(c * (1 - 0.25*other))
	y := float64(other * (1 - 0.25*c))
	return ChordAngle(math.Max(0.0, x+y-2*math.Sqrt(x*y)))
}
729929
func (s0 Span) Sub(s1 Span) Span {
	return toIntern(toExtern(s0).Sub(toExtern(s1)))
}
595869
func sub(z, x []big.Word, y big.Word) []big.Word {
	m := len(x)
	const n = 1

	// m > 0 && y > 0

	z = makeWord(z, m)
	// subVV(z[0:m], x, y) but WW since len(y) == 1
	var c big.Word
	c, z[0] = subWW(x[0], y, 0)
	if m > n {
		c = subVW(z[n:], x[n:], c)
	}
	if c != 0 {
		panic("underflow")
	}
	return norm(z)
}
294475
func (m1 Mat2x3) Sub(m2 Mat2x3) Mat2x3 {
	return Mat2x3{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5]}
}
45964
func (g *Graph) Substitute(s string, v interface{}) {
	if g == nil || g.Out == nil {
		return
	}
	for _, n := range g.Out {
		if _string(n.This) == s {
			n.This = v
		}
		n.Substitute(s, v)
	}

}
1094086
func (m1 Mat3x2) Sub(m2 Mat3x2) Mat3x2 {
	return Mat3x2{m1[0] - m2[0], m1[1] - m2[1], m1[2] - m2[2], m1[3] - m2[3], m1[4] - m2[4], m1[5] - m2[5]}
}
458086
func (z fermat) Sub(x, y fermat) fermat {
	if len(z) != len(x) {
		panic("Add: len(z) != len(x)")
	}
	n := len(y) - 1
	b := subVV(z[:n], x[:n], y[:n])
	b += y[n]
	// If b > 0, we need to subtract b<<n, which is the same as adding b.
	z[n] = x[n]
	if z[0] <= ^big.Word(0)-b {
		z[0] += b
	} else {
		addVW(z, z, b)
	}
	z.norm()
	return z
}