Metropolis-Hastings algorithm implementation in C