\log \left(x + \sqrt{x \cdot x - 1}\right)\log \left(\mathsf{fma}\left(\sqrt{x - \sqrt{1}}, \sqrt{x + \sqrt{1}}, x\right)\right)double code(double x) {
return log((x + sqrt(((x * x) - 1.0))));
}
double code(double x) {
return log(fma(sqrt((x - sqrt(1.0))), sqrt((x + sqrt(1.0))), x));
}



Bits error versus x
Results
Initial program 31.4
rmApplied add-sqr-sqrt31.4
Applied difference-of-squares31.4
Applied sqrt-prod0.1
rmApplied add-log-exp0.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2020091 +o rules:numerics
(FPCore (x)
:name "Hyperbolic arc-cosine"
:precision binary64
(log (+ x (sqrt (- (* x x) 1)))))