Reference: sgn
sgn(x) returns the sign of the real number x, i.e. sgn(x) = 1 if x > 0 and sgn(x) = -1 if x < 0. In AlgoSim, sgn(0) = 0, so that it is not entirely true that sgn(x) is the derivative of abs(x).
sgn(x) returns the sign of the real number x, i.e. sgn(x) = 1 if x > 0 and sgn(x) = -1 if x < 0. In AlgoSim, sgn(0) = 0, so that it is not entirely true that sgn(x) is the derivative of abs(x).