algebraic simplification engine for scalar exp