Source: http://irma.math.unistra.fr/~privat/documents/M1_Optim/M1_corrige_TD3.pdf