Reduced code using nary_op in equation solver.