Discrete Optimization of Finite Element Matrix Evaluation