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



Bits error versus x
Results
if (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))) < 1.6150103447977282Initial program 1.7
rmApplied add-sqr-sqrt1.7
Applied add-sqr-sqrt1.4
Applied difference-of-squares0.5
if 1.6150103447977282 < (sqrt (/ (- (exp (* 2.0 x)) 1.0) (- (exp x) 1.0))) Initial program 54.3
rmApplied add-cbrt-cube54.3
Simplified54.3
Taylor expanded around 0 9.9
Final simplification1.1
herbie shell --seed 2020092
(FPCore (x)
:name "sqrtexp (problem 3.4.4)"
:precision binary64
(sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))