Value appears to change sign suddenly
I think I understand what's going on from here. That's why speed_value appears to change sign suddenly when entering the if...else... statement. But why speed_value == -speed_value is necessary is yet to be answered.