// Tanh - Vector Trigonometric TANH
507093
func Tanh(inReal []float64) []float64 {
	outReal := make([]float64, len(inReal))
	for i := 0; i < len(inReal); i++ {
		outReal[i] = math.Tanh(inReal[i])
	}
	return outReal
}
712436
func Sin(inReal []float64) []float64 {
	outReal := make([]float64, len(inReal))
	for i := 0; i < len(inReal); i++ {
		outReal[i] = math.Sin(inReal[i])
	}
	return outReal
}
467221
func (v Vector) String() string {
	return fmt.Sprintf("<%f, %f>", v.x, v.y)
}
1198157
func (c C) Sin() Input {
	return C(float32(math.Sin(float64(c))))
}
834942
func rho(x uint64) (z uint8) {
	for bit := uint64(1 << 63); bit&x == 0 && bit > 0; bit >>= 1 {
		z++
	}
	return z + 1
}
424670
func (v Vector) Dot(u Vector) float32 {
	return blas.Sdot(len(v), u, 1, v, 1)
}
248048
func (u *Ugen) Tan() Input {
	return unaryOpTan(u.Rate, u, u.NumOutputs)
}
444787
func (u Vec) Angle() float64 {
	return math.Atan2(u.Y, u.X)
}
1062328
func cosDistance(x, y Point) (cos, err float64) {
	cos = x.Dot(y.Vector)
	return cos, 9.5*dblError*math.Abs(cos) + 1.5*dblError
}
161830
func (r *Row) tagsHash() uint64 {
	h := NewInlineFNV64a()
	keys := r.tagsKeys()
	for _, k := range keys {
		h.Write([]byte(k))
		h.Write([]byte(r.Tags[k]))
	}
	return h.Sum64()
}
906769
func (quat *T) AxisAngle() (axis vec3.T, angle float64) {
	cos := quat[3]
	sin := math.Sqrt(1 - cos*cos)
	angle = math.Acos(cos)

	var ooSin float64
	if math.Abs(sin) < 0.0005 {
		ooSin = 1
	} else {
		ooSin = 1 / sin
	}
	axis[0] = quat[0] * ooSin
	axis[1] = quat[1] * ooSin
	axis[2] = quat[2] * ooSin

	return axis, angle
}
169343
func newTHS(s BaseSentence) (THS, error) {
	p := newParser(s)
	p.AssertType(TypeTHS)
	m := THS{
		BaseSentence: s,
		Heading:      p.Float64(0, "heading"),
		Status:       p.EnumString(1, "status", AutonomousTHS, EstimatedTHS, ManualTHS, SimulatorTHS, InvalidTHS),
	}
	return m, p.Err()
}
567884
func (c *Cosine) Dot(vectorX *mat.Dense, vectorY *mat.Dense) float64 {
	subVector := new(mat.Dense)
	subVector.MulElem(vectorX, vectorY)
	result := mat.Sum(subVector)

	return result
}
843772
func CylindricalToCartesian(rho, phi, z float32) Vec3 {
	s, c := math.Sincos(float64(phi))

	return Vec3{rho * float32(c), rho * float32(s), z}
}
817046
func varsForDepth(depth int) (index, local string) {
	if depth > len(indexVariables) {
		index = fmt.Sprintf("i%d", depth)
	} else {
		index = indexVariables[depth : depth+1]
	}
	if depth > len(localVariables) {
		local = fmt.Sprintf("local%d", depth)
	} else {
		local = localVariables[depth : depth+1]
	}
	return
}
543161
func (vec *T) Rotated(angle float64) T {
	sinus := math.Sin(angle)
	cosinus := math.Cos(angle)
	return T{
		vec[0]*cosinus - vec[1]*sinus,
		vec[0]*sinus + vec[1]*cosinus,
	}
}
548249
func (vec *T) Normalize() *T {
	sl := vec.LengthSqr()
	if sl == 0 || sl == 1 {
		return vec
	}
	return vec.Scale(1 / math.Sqrt(sl))
}