(FPCore (x) :precision binary64 (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))
(FPCore (x) :precision binary64 (let* ((t_0 (sqrt (- 1.0 (* x x))))) (+ (log (/ (sqrt (fma x t_0 x)) x)) (log (sqrt (+ (/ 1.0 x) (/ t_0 x)))))))
double code(double x) {
return log(((1.0 / x) + (sqrt((1.0 - (x * x))) / x)));
}
double code(double x) {
double t_0 = sqrt((1.0 - (x * x)));
return log((sqrt(fma(x, t_0, x)) / x)) + log(sqrt(((1.0 / x) + (t_0 / x))));
}
function code(x) return log(Float64(Float64(1.0 / x) + Float64(sqrt(Float64(1.0 - Float64(x * x))) / x))) end
function code(x) t_0 = sqrt(Float64(1.0 - Float64(x * x))) return Float64(log(Float64(sqrt(fma(x, t_0, x)) / x)) + log(sqrt(Float64(Float64(1.0 / x) + Float64(t_0 / x))))) end
code[x_] := N[Log[N[(N[(1.0 / x), $MachinePrecision] + N[(N[Sqrt[N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
code[x_] := Block[{t$95$0 = N[Sqrt[N[(1.0 - N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[(N[Log[N[(N[Sqrt[N[(x * t$95$0 + x), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision] + N[Log[N[Sqrt[N[(N[(1.0 / x), $MachinePrecision] + N[(t$95$0 / x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\begin{array}{l}
t_0 := \sqrt{1 - x \cdot x}\\
\log \left(\frac{\sqrt{\mathsf{fma}\left(x, t_0, x\right)}}{x}\right) + \log \left(\sqrt{\frac{1}{x} + \frac{t_0}{x}}\right)
\end{array}



Bits error versus x
Initial program 0.0
Applied add-sqr-sqrt_binary640.0
Applied log-prod_binary640.0
Applied frac-add_binary6430.9
Applied sqrt-div_binary6430.9
Simplified30.9
Simplified0.0
Final simplification0.0
herbie shell --seed 2022130
(FPCore (x)
:name "Hyperbolic arc-(co)secant"
:precision binary64
(log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))