Average Error: 0.0 → 0.0
Time: 3.2s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 \cdot 1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}}{x \cdot \sqrt{1 + x \cdot x}}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \frac{\sqrt{1 \cdot 1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}}{x \cdot \sqrt{1 + x \cdot x}}\right)
double f(double x) {
        double r52098 = 1.0;
        double r52099 = x;
        double r52100 = r52098 / r52099;
        double r52101 = r52099 * r52099;
        double r52102 = r52098 - r52101;
        double r52103 = sqrt(r52102);
        double r52104 = r52103 / r52099;
        double r52105 = r52100 + r52104;
        double r52106 = log(r52105);
        return r52106;
}

double f(double x) {
        double r52107 = 1.0;
        double r52108 = x;
        double r52109 = r52107 / r52108;
        double r52110 = r52107 * r52107;
        double r52111 = r52108 * r52108;
        double r52112 = r52111 * r52111;
        double r52113 = r52110 - r52112;
        double r52114 = sqrt(r52113);
        double r52115 = r52107 + r52111;
        double r52116 = sqrt(r52115);
        double r52117 = r52108 * r52116;
        double r52118 = r52114 / r52117;
        double r52119 = r52109 + r52118;
        double r52120 = log(r52119);
        return r52120;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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 flip--0.0

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

    \[\leadsto \log \left(\frac{1}{x} + \frac{\color{blue}{\frac{\sqrt{1 \cdot 1 - \left(x \cdot x\right) \cdot \left(x \cdot x\right)}}{\sqrt{1 + x \cdot x}}}}{x}\right)\]
  5. Applied associate-/l/0.0

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

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

Reproduce

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