Average Error: 0.0 → 0.0
Time: 4.5s
Precision: 64
\[\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)\]
\[\log \left(\frac{1}{x} + \frac{\sqrt{\sqrt{1 - x \cdot x}}}{\frac{x}{\sqrt{\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{\sqrt{1 - x \cdot x}}}{\frac{x}{\sqrt{\sqrt{1 - x \cdot x}}}}\right)
double f(double x) {
        double r57326 = 1.0;
        double r57327 = x;
        double r57328 = r57326 / r57327;
        double r57329 = r57327 * r57327;
        double r57330 = r57326 - r57329;
        double r57331 = sqrt(r57330);
        double r57332 = r57331 / r57327;
        double r57333 = r57328 + r57332;
        double r57334 = log(r57333);
        return r57334;
}

double f(double x) {
        double r57335 = 1.0;
        double r57336 = x;
        double r57337 = r57335 / r57336;
        double r57338 = r57336 * r57336;
        double r57339 = r57335 - r57338;
        double r57340 = sqrt(r57339);
        double r57341 = sqrt(r57340);
        double r57342 = r57336 / r57341;
        double r57343 = r57341 / r57342;
        double r57344 = r57337 + r57343;
        double r57345 = log(r57344);
        return r57345;
}

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 add-sqr-sqrt0.0

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

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

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

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

Reproduce

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