improve arith handling in hysteresis