Average Error: 0.1 → 0.1
Time: 4.0s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\mathsf{fma}\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}, \sqrt[3]{\frac{1}{x}}, \frac{\sqrt{1 - x \cdot x}}{x}\right)\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\mathsf{fma}\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}, \sqrt[3]{\frac{1}{x}}, \frac{\sqrt{1 - x \cdot x}}{x}\right)\right)
double code(double x) {
	return log(((1.0 / x) + (sqrt((1.0 - (x * x))) / x)));
}
double code(double x) {
	return log(fma((cbrt((1.0 / x)) * cbrt((1.0 / x))), cbrt((1.0 / x)), (sqrt((1.0 - (x * x))) / x)));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  2. Using strategy rm
  3. Applied add-cube-cbrt0.1

    \[\leadsto \log \left(\color{blue}{\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}\right) \cdot \sqrt[3]{\frac{1}{x}}} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
  4. Applied fma-def0.1

    \[\leadsto \log \color{blue}{\left(\mathsf{fma}\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}, \sqrt[3]{\frac{1}{x}}, \frac{\sqrt{1 - x \cdot x}}{x}\right)\right)}\]
  5. Final simplification0.1

    \[\leadsto \log \left(\mathsf{fma}\left(\sqrt[3]{\frac{1}{x}} \cdot \sqrt[3]{\frac{1}{x}}, \sqrt[3]{\frac{1}{x}}, \frac{\sqrt{1 - x \cdot x}}{x}\right)\right)\]

Reproduce

herbie shell --seed 2020058 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))