Automatic simplification of algebraic expressions in C#