Fast algorithms for volume integrals in potential theory