Source: http://www.iro.umontreal.ca/~marcotte/Ift3515/Compiegne.pdf