// Mul3 multiplies three quaternions.
495668
func Mul3(a, b, c *T) T {
	q := Mul(a, b)
	return Mul(&q, c)
}
143439
func (m1 Mat3x4) Mul4x1(m2 Vec4) Vec3 {
	return Vec3{
		m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3],
		m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3],
		m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3],
	}
}
1167509
func (m1 Mat3x4) Mul4(m2 Mat4) Mat3x4 {
	return Mat3x4{
		m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3],
		m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3],
		m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3],
		m1[0]*m2[4] + m1[3]*m2[5] + m1[6]*m2[6] + m1[9]*m2[7],
		m1[1]*m2[4] + m1[4]*m2[5] + m1[7]*m2[6] + m1[10]*m2[7],
		m1[2]*m2[4] + m1[5]*m2[5] + m1[8]*m2[6] + m1[11]*m2[7],
		m1[0]*m2[8] + m1[3]*m2[9] + m1[6]*m2[10] + m1[9]*m2[11],
		m1[1]*m2[8] + m1[4]*m2[9] + m1[7]*m2[10] + m1[10]*m2[11],
		m1[2]*m2[8] + m1[5]*m2[9] + m1[8]*m2[10] + m1[11]*m2[11],
		m1[0]*m2[12] + m1[3]*m2[13] + m1[6]*m2[14] + m1[9]*m2[15],
		m1[1]*m2[12] + m1[4]*m2[13] + m1[7]*m2[14] + m1[10]*m2[15],
		m1[2]*m2[12] + m1[5]*m2[13] + m1[8]*m2[14] + m1[11]*m2[15],
	}
}
374772
func (m1 Mat3) Mul(c float32) Mat3 {
	return Mat3{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c, m1[6] * c, m1[7] * c, m1[8] * c}
}
616441
func (u *Ugen) Mul(val Input) Input {
	return binOpMul(u.Rate, u, val, u.NumOutputs)
}
403919
func (m1 Mat2x3) Mul3x4(m2 Mat3x4) Mat2x4 {
	return Mat2x4{
		m1[0]*m2[0] + m1[2]*m2[1] + m1[4]*m2[2],
		m1[1]*m2[0] + m1[3]*m2[1] + m1[5]*m2[2],
		m1[0]*m2[3] + m1[2]*m2[4] + m1[4]*m2[5],
		m1[1]*m2[3] + m1[3]*m2[4] + m1[5]*m2[5],
		m1[0]*m2[6] + m1[2]*m2[7] + m1[4]*m2[8],
		m1[1]*m2[6] + m1[3]*m2[7] + m1[5]*m2[8],
		m1[0]*m2[9] + m1[2]*m2[10] + m1[4]*m2[11],
		m1[1]*m2[9] + m1[3]*m2[10] + m1[5]*m2[11],
	}
}
616435
func (c RGBA) Mul(d RGBA) RGBA {
	return RGBA{
		R: c.R * d.R,
		G: c.G * d.G,
		B: c.B * d.B,
		A: c.A * d.A,
	}
}
1102908
func (m1 Mat3x2) Mul2(m2 Mat2) Mat3x2 {
	return Mat3x2{
		m1[0]*m2[0] + m1[3]*m2[1],
		m1[1]*m2[0] + m1[4]*m2[1],
		m1[2]*m2[0] + m1[5]*m2[1],
		m1[0]*m2[2] + m1[3]*m2[3],
		m1[1]*m2[2] + m1[4]*m2[3],
		m1[2]*m2[2] + m1[5]*m2[3],
	}
}
363209
func (v1 Vec2) Mul(c float64) Vec2 {
	return Vec2{v1[0] * c, v1[1] * c}
}
61882
func (m1 Mat3x2) Mul2x1(m2 Vec2) Vec3 {
	return Vec3{
		m1[0]*m2[0] + m1[3]*m2[1],
		m1[1]*m2[0] + m1[4]*m2[1],
		m1[2]*m2[0] + m1[5]*m2[1],
	}
}
1331183
func (m1 Mat4x3) Mul3x4(m2 Mat3x4) Mat4 {
	return Mat4{
		m1[0]*m2[0] + m1[4]*m2[1] + m1[8]*m2[2],
		m1[1]*m2[0] + m1[5]*m2[1] + m1[9]*m2[2],
		m1[2]*m2[0] + m1[6]*m2[1] + m1[10]*m2[2],
		m1[3]*m2[0] + m1[7]*m2[1] + m1[11]*m2[2],
		m1[0]*m2[3] + m1[4]*m2[4] + m1[8]*m2[5],
		m1[1]*m2[3] + m1[5]*m2[4] + m1[9]*m2[5],
		m1[2]*m2[3] + m1[6]*m2[4] + m1[10]*m2[5],
		m1[3]*m2[3] + m1[7]*m2[4] + m1[11]*m2[5],
		m1[0]*m2[6] + m1[4]*m2[7] + m1[8]*m2[8],
		m1[1]*m2[6] + m1[5]*m2[7] + m1[9]*m2[8],
		m1[2]*m2[6] + m1[6]*m2[7] + m1[10]*m2[8],
		m1[3]*m2[6] + m1[7]*m2[7] + m1[11]*m2[8],
		m1[0]*m2[9] + m1[4]*m2[10] + m1[8]*m2[11],
		m1[1]*m2[9] + m1[5]*m2[10] + m1[9]*m2[11],
		m1[2]*m2[9] + m1[6]*m2[10] + m1[10]*m2[11],
		m1[3]*m2[9] + m1[7]*m2[10] + m1[11]*m2[11],
	}
}
235674
func mul(vec []float64, factor float64) []float64 {
	ret := make([]float64, len(vec))
	for i := range vec {
		ret[i] = vec[i] * factor
	}
	return ret
}
670935
func (m1 Mat3x4) Mul4x3(m2 Mat4x3) Mat3 {
	return Mat3{
		m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2] + m1[9]*m2[3],
		m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2] + m1[10]*m2[3],
		m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2] + m1[11]*m2[3],
		m1[0]*m2[4] + m1[3]*m2[5] + m1[6]*m2[6] + m1[9]*m2[7],
		m1[1]*m2[4] + m1[4]*m2[5] + m1[7]*m2[6] + m1[10]*m2[7],
		m1[2]*m2[4] + m1[5]*m2[5] + m1[8]*m2[6] + m1[11]*m2[7],
		m1[0]*m2[8] + m1[3]*m2[9] + m1[6]*m2[10] + m1[9]*m2[11],
		m1[1]*m2[8] + m1[4]*m2[9] + m1[7]*m2[10] + m1[10]*m2[11],
		m1[2]*m2[8] + m1[5]*m2[9] + m1[8]*m2[10] + m1[11]*m2[11],
	}
}
890176
func (m1 Mat2x3) Mul(c float32) Mat2x3 {
	return Mat2x3{m1[0] * c, m1[1] * c, m1[2] * c, m1[3] * c, m1[4] * c, m1[5] * c}
}
647795
func (m1 Mat3) Mul3(m2 Mat3) Mat3 {
	return Mat3{
		m1[0]*m2[0] + m1[3]*m2[1] + m1[6]*m2[2],
		m1[1]*m2[0] + m1[4]*m2[1] + m1[7]*m2[2],
		m1[2]*m2[0] + m1[5]*m2[1] + m1[8]*m2[2],
		m1[0]*m2[3] + m1[3]*m2[4] + m1[6]*m2[5],
		m1[1]*m2[3] + m1[4]*m2[4] + m1[7]*m2[5],
		m1[2]*m2[3] + m1[5]*m2[4] + m1[8]*m2[5],
		m1[0]*m2[6] + m1[3]*m2[7] + m1[6]*m2[8],
		m1[1]*m2[6] + m1[4]*m2[7] + m1[7]*m2[8],
		m1[2]*m2[6] + m1[5]*m2[7] + m1[8]*m2[8],
	}
}
702240
func (p *poly) Mul(q *poly) poly {
	// extra=2 because:
	// * some power of 2 is a K-th root of unity when n is a multiple of K/2.
	// * 2 itself is a square (see fermat.ShiftHalf)
	n := valueSize(p.k, p.m, 2)

	pv, qv := p.Transform(n), q.Transform(n)
	rv := pv.Mul(&qv)
	r := rv.InvTransform()
	r.m = p.m
	return r
}
786228
func (v1 Vec2) Mul(c float32) Vec2 {
	return Vec2{v1[0] * c, v1[1] * c}
}