\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\left(-\log x\right) + \log \left(1 + \sqrt{1 - x \cdot x}\right)double f(double x) {
double r50904 = 1.0;
double r50905 = x;
double r50906 = r50904 / r50905;
double r50907 = r50905 * r50905;
double r50908 = r50904 - r50907;
double r50909 = sqrt(r50908);
double r50910 = r50909 / r50905;
double r50911 = r50906 + r50910;
double r50912 = log(r50911);
return r50912;
}
double f(double x) {
double r50913 = x;
double r50914 = log(r50913);
double r50915 = -r50914;
double r50916 = 1.0;
double r50917 = r50913 * r50913;
double r50918 = r50916 - r50917;
double r50919 = sqrt(r50918);
double r50920 = r50916 + r50919;
double r50921 = log(r50920);
double r50922 = r50915 + r50921;
return r50922;
}



Bits error versus x
Results
Initial program 0.1
rmApplied div-inv0.1
Applied div-inv0.1
Applied distribute-rgt-out0.1
Applied log-prod0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019323 +o rules:numerics
(FPCore (x)
:name "Hyperbolic arc-(co)secant"
:precision binary64
(log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))