\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\begin{array}{l}
\mathbf{if}\;x \le -2.75769755893172789 \cdot 10^{-6}:\\
\;\;\;\;\sqrt{\left(\sqrt{e^{2 \cdot x}} + \sqrt{1}\right) \cdot \frac{{\left(e^{2}\right)}^{\left(\frac{1}{2} \cdot x\right)} - \sqrt{1}}{e^{x} - 1}}\\
\mathbf{else}:\\
\;\;\;\;\sqrt{x \cdot \left(1 + 0.5 \cdot x\right) + 2}\\
\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 <= -2.757697558931728e-06)) {
VAR = sqrt(((sqrt(exp((2.0 * x))) + sqrt(1.0)) * ((pow(exp(2.0), (0.5 * x)) - sqrt(1.0)) / (exp(x) - 1.0))));
} else {
VAR = sqrt(((x * (1.0 + (0.5 * x))) + 2.0));
}
return VAR;
}



Bits error versus x
Results
if x < -2.757697558931728e-06Initial program 0.1
rmApplied *-un-lft-identity0.1
Applied add-sqr-sqrt0.1
Applied add-sqr-sqrt0.1
Applied difference-of-squares0.0
Applied times-frac0.0
Simplified0.0
rmApplied add-log-exp0.0
Applied exp-to-pow0.0
Applied sqrt-pow10.0
Simplified0.0
if -2.757697558931728e-06 < x Initial program 33.8
Taylor expanded around 0 7.3
Simplified7.3
Final simplification1.0
herbie shell --seed 2020105
(FPCore (x)
:name "sqrtexp (problem 3.4.4)"
:precision binary64
(sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))