Utility function to compare the equality of two outputs.