Because noise spikes can also cause errors, the codes uses a rate-of-change check to filter out the possible erroneous signals and make sure that the points interpolated from are genuine zero-crossing points. For example, with two negative samples, a noise spike can make one of them positive and, therefore, make the negative and positive pair looks as if there were a zero crossing.
The resultant cycle-to-cycle timing goes through a weak low-pass filter to further smooth out cycle-to-cycle variations. This results in a stable and accurate frequency measurement that is tolerant of noise.