An efficient algorithm for the solution of the correlation function for soft spherical repulsions