For reference:
CH_alt = z ^ (x & (y ^ z))
MAJ_alt = (x & y) | (z & (x | y))
CH and MAJ are the functions from FIPS 180-3 while CH_alt and MAJ_alt are from bitcoin-core source code
CH_alt = (~z) & (x & (y ^ z)) | z & ((~x) | ~(y ^ z))
CH_alt = x & (~z) & (y ^ z) | (z & (~x)) | (z & ~(y ^ z))
CH_alt = x & y | (z & (~x)) | (z & ~(y ^ z))
CH_alt = (x & y) | ((~x) & z)
CH_alt = CH
z & ~(y ^ z) = 0