The VEGAS algorithm is based on importance sampling. It samples points from the probability distribution described by the function | f | , so that the points are concentrated in the regions that make the largest contribution to the integral. The GNU Scientific Library (GSL) provides a VEGAS routine.