acceptable_formula function

Checks that the formula can be parsed