Example #1
0
func RandomTree(nbits uint) (m1 arith.Model, desc string) {
	x1 := arith.Shift2{
		P0: arith.P(rand.Intn(arith.MaxP / 2)),
		I0: byte(rand.Intn(8) + 1),
		P1: arith.P(rand.Intn(arith.MaxP / 2)),
		I1: byte(rand.Intn(8) + 1),
	}

	m1 = arith.NewTree(nbits, func() arith.Model {
		x := x1
		return &x
	})

	desc = fmt.Sprintf("%#v", x1)
	return
}
Example #2
0
func mValues(nbits uint) arith.Model {
	return arith.NewTree(nbits, func() arith.Model {
		return &arith.Shift2{P0: 0x438, I0: 0x3, P1: 0x61a, I1: 0x1}
	})
}