use the sqrt trick in exp