?

Average Error: 0.0 → 0.0
Time: 43.6s
Precision: binary64
Cost: 19712

?

\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right) \]
\[\log \left(\frac{\sqrt{-\mathsf{fma}\left(x, x, -1\right)} + 1}{x}\right) \]
(FPCore (x)
 :precision binary64
 (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))
(FPCore (x) :precision binary64 (log (/ (+ (sqrt (- (fma x x -1.0))) 1.0) x)))
double code(double x) {
	return log(((1.0 / x) + (sqrt((1.0 - (x * x))) / x)));
}
double code(double x) {
	return log(((sqrt(-fma(x, x, -1.0)) + 1.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)
	return log(Float64(Float64(sqrt(Float64(-fma(x, x, -1.0))) + 1.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_] := N[Log[N[(N[(N[Sqrt[(-N[(x * x + -1.0), $MachinePrecision])], $MachinePrecision] + 1.0), $MachinePrecision] / x), $MachinePrecision]], $MachinePrecision]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{\sqrt{-\mathsf{fma}\left(x, x, -1\right)} + 1}{x}\right)

Error?

Derivation?

  1. Initial program 0.0

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right) \]
  2. Simplified0.0

    \[\leadsto \color{blue}{\log \left(\frac{\sqrt{-\mathsf{fma}\left(x, x, -1\right)} + 1}{x}\right)} \]
    Proof

Alternatives

Alternative 1
Error0.0
Cost13504
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right) \]
Alternative 2
Error0.3
Cost6976
\[\log \left(\frac{x \cdot \left(-0.5 \cdot x\right) - -2}{x}\right) \]
Alternative 3
Error0.3
Cost6848
\[\log \left(\frac{2}{x} - x \cdot 0.5\right) \]
Alternative 4
Error0.6
Cost6592
\[\log \left(\frac{2}{x}\right) \]

Error

Reproduce?

herbie shell --seed 2023033 
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))