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



Bits error versus x
Results
if x < -6.689446129084614e-16Initial program 0.8
rmApplied flip--0.6
Simplified0.0
rmApplied div-inv0.0
if -6.689446129084614e-16 < x Initial program 37.0
Taylor expanded around 0 8.0
Simplified8.0
Final simplification0.8
herbie shell --seed 2020102 +o rules:numerics
(FPCore (x)
:name "sqrtexp (problem 3.4.4)"
:precision binary64
(sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))