The tested functions treat s_m[i] == 0 as a special case. Other than that, the functions are slightly complicated vector additions. This actually makes the zero case happen pseudorandomly.