gaussian: optimize probability computation