[math-fun] algebraic fcn simplification