You need to specify what exactly happens with the -0.5—0.5 range in the middle. If you assume that anything between -0.5 to 0 counts as -0.5, you need to handle that case extra, and do the same thing for 0 to 0.5 (which might count as 0.5). If that’s the case. If you want a deadzone, then you don‘t need to clamp at all, but set the output variable to 0 if the value is between -0.5 to 0.5.