Compute gate result