Add det function for FormulaTree