Direct evaluation of large-deviation functions.