mc_mean function

Compute the monte-carlo mean of a function