// Pow returns the logarithm of a given number in a given base.
489485
func Pow(num, power cty.Value) (cty.Value, error) {
	return PowFunc.Call([]cty.Value{num, power})
}
262494
public static Number power(Number self, Number exponent) {
        double base, exp, answer;
        base = self.doubleValue();
        exp = exponent.doubleValue();

        answer = Math.pow(base, exp);
        if ((double) ((int) answer) == answer) {
            return (int) answer;
        } else if ((double) ((long) answer) == answer) {
            return (long) answer;
        } else {
            return answer;
        }
    }
601209
func (vc *Ring) Power(id crypto.Address) (*big.Int, error) {
	return vc.GetPower(id), nil
}
247014
func Round(f float64, n int) float64 {
	pow10n := math.Pow10(n)
	return math.Trunc((f+0.5/pow10n)*pow10n) / pow10n
}
976458
func (decaying *Decaying) Value() float64 {
	decaying.Lock()
	now := time.Now()
	dt := now.Sub(decaying.t0).Seconds()
	decaying.t0 = now
	curValP := decaying.p
	decaying.p = curValP * math.Pow(decaying.e, (decaying.r*dt))
	pOut := decaying.p
	decaying.Unlock()
	return pOut
}
116951
func log(z, x *decimal.Big, ten bool) *decimal.Big {
	t := int64(adjusted(x))
	if t < 0 {
		t = -t - 1
	}
	t *= 2

	if arith.Length(arith.Abs(t))-1 > maxscl(z) {
		z.Context.Conditions |= decimal.Overflow | decimal.Inexact | decimal.Rounded
		return z.SetInf(t < 0)
	}

	// Argument reduction:
	// Given
	//    ln(a) = ln(b) + ln(c), where a = b * c
	// Given
	//    x = m * 10**n, where x ∈ ℝ
	// Reduce x (as y) so that
	//    1 <= y < 10
	// And create p so that
	//    x = y * 10**p
	// Compute
	//    log(y) + p*log(10)

	// TODO(eric): the precision adjustment should be large enough. It's passed
	// multiple iterations of with a precision in [1, 5000) and a 128-bit decimal.
	prec := precision(z)
	ctx := decimal.Context{
		Precision: prec + arith.Length(uint64(prec+x.Precision())) + 5,
	}
	if ten {
		ctx.Precision += 3
	}

	var p int64
	switch {
	// 1e+1000
	case x.Scale() <= 0:
		p = int64(x.Precision() - x.Scale() - 1)
	// 0.0001
	case x.Scale() >= x.Precision():
		p = -int64(x.Scale() - x.Precision() + 1)
		ctx.Precision = int(float64(ctx.Precision) * 1.5)
	// 12.345
	default:
		p = int64(-x.Scale() + x.Precision() - 1)
	}

	// Rescale to 1 <= x < 10
	y := new(decimal.Big).Copy(x).SetScale(x.Precision() - 1)
	// Continued fraction algorithm is for log(1+x)
	ctx.Sub(y, y, one)

	g := lgen{
		ctx: ctx,
		pow: ctx.Mul(new(decimal.Big), y, y),
		z2:  ctx.Add(new(decimal.Big), y, two),
		k:   -1,
		t:   Term{A: new(decimal.Big), B: new(decimal.Big)},
	}

	// TODO(eric): Similar to the comment inside Exp, this library only provides
	// better performance at ~750 digits of precision. Consider using Newton's
	// method or another algorithm for lower precision ranges.

	ctx.Quo(z, ctx.Mul(y, y, two), Wallis(z, &g))

	if p != 0 || ten {
		t := ln10_t(y, ctx.Precision) // recycle y

		// Avoid doing unnecessary work.
		switch p {
		default:
			p := g.z2.SetMantScale(p, 0) // recycle g.z2
			ctx.FMA(z, p, t, z)
		case 0:
			// OK
		case -1:
			ctx.Sub(z, z, t) // (-1 * t) + z = -t + z = z - t
		case 1:
			ctx.Add(z, t, z) // (+1 * t) + z = t + z
		}

		// We're calculating log10(x):
		//    log10(x) = log(x) / log(10)
		if ten {
			ctx.Quo(z, z, t)
		}
	}
	ctx.Precision = prec
	return ctx.Round(z)
}
770894
func (u *Ugen) Log() Input {
	return unaryOpLog(u.Rate, u, u.NumOutputs)
}
940162
func log(n, b float64) float64 {
	return math.Log(n) / math.Log(b)
}
90098
func (x *Big) Int(z *big.Int) *big.Int {
	if debug {
		x.validate()
	}

	if z == nil {
		z = new(big.Int)
	}

	if !x.IsFinite() {
		return z
	}

	if x.isCompact() {
		z.SetUint64(x.compact)
	} else {
		z.Set(&x.unscaled)
	}
	if x.Signbit() {
		z.Neg(z)
	}
	if x.exp == 0 {
		return z
	}
	return bigScalex(z, z, x.exp)
}
550257
func (f *LogFile) bytes() int {
	var b int
	b += 24 // mu RWMutex is 24 bytes
	b += int(unsafe.Sizeof(f.res))
	b += int(unsafe.Sizeof(f.id))
	// Do not count f.data contents because it is mmap'd
	b += int(unsafe.Sizeof(f.data))
	b += int(unsafe.Sizeof(f.file))
	b += int(unsafe.Sizeof(f.w))
	b += int(unsafe.Sizeof(f.bufferSize))
	b += int(unsafe.Sizeof(f.nosync))
	// TODO(jacobmarble): Uncomment when we are using go >= 1.10.0
	//b += f.w.Size()
	b += int(unsafe.Sizeof(f.buf)) + len(f.buf)
	b += int(unsafe.Sizeof(f.keyBuf)) + len(f.keyBuf)
	b += int(unsafe.Sizeof(f.sfile))
	b += int(unsafe.Sizeof(f.sfileref))
	b += int(unsafe.Sizeof(f.size))
	b += int(unsafe.Sizeof(f.modTime))
	b += int(unsafe.Sizeof(f.seriesIDSet)) + f.seriesIDSet.Bytes()
	b += int(unsafe.Sizeof(f.tombstoneSeriesIDSet)) + f.tombstoneSeriesIDSet.Bytes()
	b += int(unsafe.Sizeof(f.mms)) + f.mms.bytes()
	b += int(unsafe.Sizeof(f.stats))
	b += int(unsafe.Sizeof(f.path)) + len(f.path)
	return b
}
189229
func Ln(inReal []float64) []float64 {
	outReal := make([]float64, len(inReal))
	for i := 0; i < len(inReal); i++ {
		outReal[i] = math.Log(inReal[i])
	}
	return outReal
}
100573
func Pow(a, b []float64) {
	b = b[:len(a)]
	for i, v := range a {
		switch b[i] {
		case 0:
			a[i] = float64(1)
		case 1:
			a[i] = v
		case 2:
			a[i] = v * v
		case 3:
			a[i] = v * v * v
		default:
			a[i] = math.Pow(v, b[i])
		}
	}
}
1138524
func Exp(base, exponent *big.Int) *big.Int {
	result := big.NewInt(1)

	for _, word := range exponent.Bits() {
		for i := 0; i < wordBits; i++ {
			if word&1 == 1 {
				U256(result.Mul(result, base))
			}
			U256(base.Mul(base, base))
			word >>= 1
		}
	}
	return result
}
467253
func (x *Big) Precision() int {
	// Cannot call validate since validate calls this method.
	if !x.IsFinite() {
		return 0
	}
	if x.precision == 0 {
		return 1
	}
	return x.precision
}
274427
func (vs *Set) Power(id crypto.Address) (*big.Int, error) {
	return vs.GetPower(id), nil
}
524383
func (w *LogWriter) Write(b []byte) (int, error) {
	return len(b), nil
}
11888
func Digits(digits int) string {
	max := int(math.Pow10(digits)) - 1
	num := privateRand.Intn(max)
	format := fmt.Sprintf("%%0%dd", digits)
	return fmt.Sprintf(format, num)
}