Compare a predicted mathematical expression with a ground-truth expression after normalization, rather than relying only on Python's == operator. Parse both expressions with SymPy, then test whether their difference simplifies to zero. section 3.6
The implementation follows a defensive comparison workflow:
- Return True immediately when the raw expressions already match. section 3.6
Equivalent expressions
The checker accepts 13/4 and (13)/(4), 0.5 and (1)/(2), and tuple components such as 2/3 and 4/6 when used through answer grading; it rejects 14/3 versus 15/3.
