Source: https://www.iro.umontreal.ca/~mignotte/IFT6150/Chapitre5_1_IFT6150.pdf