// Abs sets z to the absolute value of x and returns z.
511434
func (z *Big) Abs(x *Big) *Big {
	if debug {
		x.validate()
	}
	if !z.invalidContext(z.Context) && !z.checkNaNs(x, x, absvalue) {
		z.Context.round(z.copyAbs(x))
	}
	return z
}
1116577
func (m Mat3x2) Abs() Mat3x2 {
	return Mat3x2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5])}
}
49981
func (m Mat4x2) Abs() Mat4x2 {
	return Mat4x2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7])}
}
729665
func (m Mat2x3) Abs() Mat2x3 {
	return Mat2x3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5])}
}
955425
func (m Mat2) Abs() Mat2 {
	return Mat2{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3])}
}
1010305
func (as ArraySpec) Absdif(val Input) Input {
	return as.proc(func(i Input) Input {
		return i.Absdif(val)
	})
}
580750
func absPath(configPath string, defaultPathFn func() (string, error)) (o string, err error) {
	if len(configPath) > 0 {
		if o, err = filepath.Abs(configPath); err != nil {
			err = errors.Wrapf(err, "filepath.Abs of %s failed", configPath)
			return
		}
	} else if defaultPathFn != nil {
		if o, err = defaultPathFn(); err != nil {
			err = errors.Wrapf(err, "default path function to compute absPath of %s failed", configPath)
			return
		}
	}
	return
}
805182
func (m Mat3) Abs() Mat3 {
	return Mat3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8])}
}
278541
func CopyAbs(z, x *decimal.Big) *decimal.Big {
	return z.CopySign(x, pos)
}
42197
func is_breakz(b []byte, i int) bool {
	//return is_break(b, i) || is_z(b, i)
	return (        // is_break:
	b[i] == '\r' || // CR (#xD)
		b[i] == '\n' || // LF (#xA)
		b[i] == 0xC2 && b[i+1] == 0x85 || // NEL (#x85)
		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA8 || // LS (#x2028)
		b[i] == 0xE2 && b[i+1] == 0x80 && b[i+2] == 0xA9 || // PS (#x2029)
		// is_z:
		b[i] == 0)
}
56121
func abs(a, b uint64) uint64 {
	if a > b {
		return a - b
	}
	return b - a
}
332923
func (m Mat4x3) Abs() Mat4x3 {
	return Mat4x3{Abs(m[0]), Abs(m[1]), Abs(m[2]), Abs(m[3]), Abs(m[4]), Abs(m[5]), Abs(m[6]), Abs(m[7]), Abs(m[8]), Abs(m[9]), Abs(m[10]), Abs(m[11])}
}
1080731
func (p *Paths) AbsPathify(inPath string) string {
	return AbsPathify(p.WorkingDir, inPath)
}
250069
func (r ResourceInstance) Absolute(module ModuleInstance) AbsResourceInstance {
	return AbsResourceInstance{
		Module:   module,
		Resource: r,
	}
}
107430
func Cos(z, x *decimal.Big) *decimal.Big {
	if z.CheckNaNs(x, nil) {
		return z
	}

	if x.IsInf(0) {
		z.Context.Conditions |= decimal.InvalidOperation
		return z.SetNaN(false)
	}

	ctx := decimal.Context{Precision: precision(z) + defaultExtraPrecision}

	negXSq, halved, ok := prepCosine(z, x, ctx)
	if !ok {
		z.Context.Conditions |= decimal.InvalidOperation
		return z.SetNaN(false)
	}

	ctx.Precision += halved
	z.Copy(BinarySplitDynamic(ctx,
		func(_ uint64) *decimal.Big { return one },
		getCosineP(negXSq),
		func(_ uint64) *decimal.Big { return one },
		getCosineQ(ctx),
	))

	// now undo the half angle bit
	for i := 0; i < halved; i++ {
		ctx.Mul(z, z, z)
		ctx.Mul(z, z, two)
		ctx.Sub(z, z, one)
	}
	ctx.Precision -= defaultExtraPrecision + halved
	return ctx.Round(z)
}
171362
func Sin(z, x *decimal.Big) *decimal.Big {
	if z.CheckNaNs(x, nil) {
		return z
	}
	if x.IsInf(0) {
		z.Context.Conditions |= decimal.InvalidOperation
		return z.SetNaN(false)
	}

	// Sin(x) = Cos(pi/2 - x)
	ctx := decimal.Context{Precision: precision(z) + defaultExtraPrecision}
	Cos(z, ctx.Sub(z, pi2(alias(z, x), ctx), x))
	ctx.Precision -= defaultExtraPrecision
	return ctx.Round(z)
}
1112947
func (ins Inputs) Abs() Input {
	ia := make([]Input, len(ins))
	for i, in := range ins {
		ia[i] = in.Abs()
	}
	return Inputs(ia)
}