Hi, anyone know the mathematic formula behind the "Hard Mix" blend mode? How is it implemented?

Thanks,

fineman