parse_formula function

Parse the nonstandard balance formulas