\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log 2 - \log x
(FPCore (x) :precision binary64 (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))
(FPCore (x) :precision binary64 (- (log 2.0) (log x)))
double code(double x) {
return log((1.0 / x) + (sqrt(1.0 - (x * x)) / x));
}
double code(double x) {
return log(2.0) - log(x);
}



Bits error versus x
Results
Initial program 0.1
Taylor expanded in x around 0 0.7
Final simplification0.7
herbie shell --seed 2022061
(FPCore (x)
:name "Hyperbolic arc-(co)secant"
:precision binary64
(log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))