compile formulas with macros