Average Error: 0.0 → 0.0
Time: 4.1s
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 f(double x) {
        double r63785 = 1.0;
        double r63786 = x;
        double r63787 = r63785 / r63786;
        double r63788 = r63786 * r63786;
        double r63789 = r63785 - r63788;
        double r63790 = sqrt(r63789);
        double r63791 = r63790 / r63786;
        double r63792 = r63787 + r63791;
        double r63793 = log(r63792);
        return r63793;
}

double f(double x) {
        double r63794 = 1.0;
        double r63795 = x;
        double r63796 = r63794 / r63795;
        double r63797 = cbrt(r63796);
        double r63798 = r63797 * r63797;
        double r63799 = r63795 * r63795;
        double r63800 = r63794 - r63799;
        double r63801 = sqrt(r63800);
        double r63802 = r63801 / r63795;
        double r63803 = fma(r63798, r63797, r63802);
        double r63804 = log(r63803);
        return r63804;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

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

    \[\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.0

    \[\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.0

    \[\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 2020024 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))