Average Error: 0.1 → 0.1
Time: 14.8s
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)\]
\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 r2321438 = 1.0;
        double r2321439 = x;
        double r2321440 = r2321438 / r2321439;
        double r2321441 = r2321439 * r2321439;
        double r2321442 = r2321438 - r2321441;
        double r2321443 = sqrt(r2321442);
        double r2321444 = r2321443 / r2321439;
        double r2321445 = r2321440 + r2321444;
        double r2321446 = log(r2321445);
        return r2321446;
}

double f(double x) {
        double r2321447 = 1.0;
        double r2321448 = x;
        double r2321449 = r2321448 * r2321448;
        double r2321450 = r2321447 - r2321449;
        double r2321451 = sqrt(r2321450);
        double r2321452 = r2321447 + r2321451;
        double r2321453 = 1.0;
        double r2321454 = r2321453 / r2321448;
        double r2321455 = r2321452 * r2321454;
        double r2321456 = log(r2321455);
        return r2321456;
}

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

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

    \[\leadsto \log \left(\color{blue}{1 \cdot \frac{1}{x}} + \sqrt{1 - x \cdot x} \cdot \frac{1}{x}\right)\]
  5. Applied distribute-rgt-out0.1

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

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

Reproduce

herbie shell --seed 2019168 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  (log (+ (/ 1.0 x) (/ (sqrt (- 1.0 (* x x))) x))))