\sqrt{\frac{e^{2 \cdot x} - 1}{e^{x} - 1}}\sqrt{1 \cdot \mathsf{fma}\left(\sqrt{e^{x}}, \sqrt{e^{x}}, 1\right)}double code(double x) {
return sqrt(((exp((2.0 * x)) - 1.0) / (exp(x) - 1.0)));
}
double code(double x) {
return sqrt((1.0 * fma(sqrt(exp(x)), sqrt(exp(x)), 1.0)));
}



Bits error versus x
Results
Initial program 4.4
rmApplied flip--3.9
Applied associate-/r/3.9
Simplified2.7
Taylor expanded around 0 0.1
rmApplied add-sqr-sqrt0.1
Applied fma-def0.1
Final simplification0.1
herbie shell --seed 2020049 +o rules:numerics
(FPCore (x)
:name "sqrtexp (problem 3.4.4)"
:precision binary64
(sqrt (/ (- (exp (* 2 x)) 1) (- (exp x) 1))))