Average Error: 0.1 → 0.1
Time: 5.4s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \sqrt{\frac{\sqrt{1 - x \cdot x}}{x}} \cdot \sqrt{\frac{\sqrt{1 - x \cdot x}}{x}}\right)\]
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \sqrt{\frac{\sqrt{1 - x \cdot x}}{x}} \cdot \sqrt{\frac{\sqrt{1 - x \cdot x}}{x}}\right)
double f(double x) {
        double r74271 = 1.0;
        double r74272 = x;
        double r74273 = r74271 / r74272;
        double r74274 = r74272 * r74272;
        double r74275 = r74271 - r74274;
        double r74276 = sqrt(r74275);
        double r74277 = r74276 / r74272;
        double r74278 = r74273 + r74277;
        double r74279 = log(r74278);
        return r74279;
}

double f(double x) {
        double r74280 = 1.0;
        double r74281 = x;
        double r74282 = r74280 / r74281;
        double r74283 = r74281 * r74281;
        double r74284 = r74280 - r74283;
        double r74285 = sqrt(r74284);
        double r74286 = r74285 / r74281;
        double r74287 = sqrt(r74286);
        double r74288 = r74287 * r74287;
        double r74289 = r74282 + r74288;
        double r74290 = log(r74289);
        return r74290;
}

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-sqr-sqrt0.1

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

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

Reproduce

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