Variational Calculation of the Electron-Gas Correlation Energy