implemented algebraic simplifications in standard library