Source: https://learn.lboro.ac.uk/archive/olmp/olmp_resources/pages/workbooks_1_50_jan2008/Workbook1/1_3_simplificatn_n_factorisatn.pdf