Average Error: 0.0 → 0.0
Time: 21.6s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\left(1 + \sqrt{1 - x \cdot x}\right) \cdot \frac{1}{x}\right)\]
double f(double x) {
        double r5230743 = 1.0;
        double r5230744 = x;
        double r5230745 = r5230743 / r5230744;
        double r5230746 = r5230744 * r5230744;
        double r5230747 = r5230743 - r5230746;
        double r5230748 = sqrt(r5230747);
        double r5230749 = r5230748 / r5230744;
        double r5230750 = r5230745 + r5230749;
        double r5230751 = log(r5230750);
        return r5230751;
}

double f(double x) {
        double r5230752 = 1.0;
        double r5230753 = x;
        double r5230754 = r5230753 * r5230753;
        double r5230755 = r5230752 - r5230754;
        double r5230756 = sqrt(r5230755);
        double r5230757 = r5230752 + r5230756;
        double r5230758 = r5230752 / r5230753;
        double r5230759 = r5230757 * r5230758;
        double r5230760 = log(r5230759);
        return r5230760;
}

\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\left(1 + \sqrt{1 - x \cdot x}\right) \cdot \frac{1}{x}\right)

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 div-inv0.0

    \[\leadsto \log \left(\frac{1}{x} + \color{blue}{\sqrt{1 - x \cdot x} \cdot \frac{1}{x}}\right)\]
  4. Applied distribute-rgt1-in0.0

    \[\leadsto \log \color{blue}{\left(\left(\sqrt{1 - x \cdot x} + 1\right) \cdot \frac{1}{x}\right)}\]
  5. Final simplification0.0

    \[\leadsto \log \left(\left(1 + \sqrt{1 - x \cdot x}\right) \cdot \frac{1}{x}\right)\]

Reproduce

herbie shell --seed 2019101 
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))