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



Bits error versus x
Results
if x < -8.351232208718257e-12 or 6.561572677279099e-15 < x Initial program 1.2
rmApplied flip--0.8
Applied associate-/r/0.8
Simplified0.1
Taylor expanded around inf 0.2
if -8.351232208718257e-12 < x < 6.561572677279099e-15Initial program 54.9
rmApplied flip--54.4
Applied associate-/r/54.4
Simplified46.3
Taylor expanded around 0 0.1
Simplified0.1
Final simplification0.2
herbie shell --seed 2020091 +o rules:numerics
(FPCore (x)
:name "sqrtexp (problem 3.4.4)"
:precision binary64
(sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))