1D gaussian with interchanged loops