\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log 2 - \mathsf{fma}\left(x \cdot x, 0.25, \log x\right)
(FPCore (x) :precision binary64 (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))
(FPCore (x) :precision binary64 (- (log 2.0) (fma (* x x) 0.25 (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) - fma((x * x), 0.25, log(x));
}



Bits error versus x
Initial program 0.0
Taylor expanded around 0 0.5
Simplified0.5
rmApplied flip3--_binary640.8
Simplified0.8
Taylor expanded around inf 0.5
Simplified0.5
Final simplification0.5
herbie shell --seed 2021211
(FPCore (x)
:name "Hyperbolic arc-(co)secant"
:precision binary64
(log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))