\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\begin{array}{l}
\mathbf{if}\;x \le -1.1188714909134117 \cdot 10^{-13}:\\
\;\;\;\;\sqrt{\frac{e^{2 \cdot x} - 1}{\frac{\mathsf{fma}\left(-1, 1, e^{x + x}\right)}{e^{x} + 1}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{{x}^{1}}{\frac{\sqrt{2}}{x}}, 0.25 - \frac{0.125}{2}, \mathsf{fma}\left(0.5, \frac{x}{\sqrt{2}}, \sqrt{2}\right)\right)\\
\end{array}double code(double x) {
return sqrt(((exp((2.0 * x)) - 1.0) / (exp(x) - 1.0)));
}
double code(double x) {
double VAR;
if ((x <= -1.1188714909134117e-13)) {
VAR = sqrt(((exp((2.0 * x)) - 1.0) / (fma(-1.0, 1.0, exp((x + x))) / (exp(x) + 1.0))));
} else {
VAR = fma((pow(x, 1.0) / (sqrt(2.0) / x)), (0.25 - (0.125 / 2.0)), fma(0.5, (x / sqrt(2.0)), sqrt(2.0)));
}
return VAR;
}



Bits error versus x
Results
if x < -1.1188714909134117e-13Initial program 0.7
rmApplied flip--0.5
Simplified0.0
if -1.1188714909134117e-13 < x Initial program 36.6
Taylor expanded around 0 8.2
Simplified8.2
rmApplied sqr-pow8.2
Applied associate-/l*8.2
Simplified8.2
Final simplification0.9
herbie shell --seed 2020071 +o rules:numerics
(FPCore (x)
:name "sqrtexp (problem 3.4.4)"
:precision binary64
(sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))