DSP applications for Hysterisis
Let's consider your thermostat in your house.

Lacking hysteresis, it flips the furnace on for a few seconds, flips it off for a few seconds, flips it on for a few seconds, burns out the motor from starting it too frequently, and leaves you freezing in the middle of the night (it's always the middle of the night, or when you are on vacation far away and don't have anyone checking the house and it's cold enough to freeze the plumbing...)

With hysteresis, it turns on the furnace for a while, and then shuts it off after the temperature has risen a little. It waits to turn the furnace back on until the temperature has fallen a little. It will still die at an inconvenient time, but it will do so many years later than in the no-hysteresis scenario, since there are many fewer motor starts in the with-hysteresis scenario.

Code? Not rocket science. A bimetallic strip and a mercury bulb switch handled it for decades, though there is more than meets the "eww, murcury evil, must have wifi thermostat" eye going on in those to make the mechanical hysteresis happen.

If temp lower than setpoint AND furnace off, turn furnace on.
If temp higher than setpoint + hysteresis amount AND furnace on, turn furnace off.

(you don't need the case for if temp in between, leave state alone, but you can write it if it makes you happy.)