A math parser and formula generator