Index Mathematics Conjectures nbv lettuce Widgets

xor_bits

stdlib/bits/xor_bits.nbv

xor_bits(lhs, rhs)

1 + 0 - 2 * 1 * 0 = 1 0 + 1 - 2 * 0 * 1 = 1 1 + 1 - 2 * 1 * 1 = 0 0 + 0 - 2 * 0 * 0 = 0

Used by
bits/lt_bits, bits/lte_bits, bits/lte_negone, keccak/keccak_f1600

Source

(lhs, rhs)

# 1 + 0 - 2 * 1 * 0 = 1
# 0 + 1 - 2 * 0 * 1 = 1
# 1 + 1 - 2 * 1 * 1 = 0
# 0 + 0 - 2 * 0 * 0 = 0
lhs + rhs - 2 * lhs * rhs