Average Error: 0.0 → 0.0
Time: 12.3s
Precision: 64
\[\log \left(\frac{1}{x} + \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} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
\log \left(\frac{1}{x} + \frac{\sqrt{1 - x \cdot x}}{x}\right)
double f(double x) {
        double r1189560 = 1.0;
        double r1189561 = x;
        double r1189562 = r1189560 / r1189561;
        double r1189563 = r1189561 * r1189561;
        double r1189564 = r1189560 - r1189563;
        double r1189565 = sqrt(r1189564);
        double r1189566 = r1189565 / r1189561;
        double r1189567 = r1189562 + r1189566;
        double r1189568 = log(r1189567);
        return r1189568;
}

double f(double x) {
        double r1189569 = 1.0;
        double r1189570 = x;
        double r1189571 = r1189569 / r1189570;
        double r1189572 = r1189570 * r1189570;
        double r1189573 = r1189569 - r1189572;
        double r1189574 = sqrt(r1189573);
        double r1189575 = r1189574 / r1189570;
        double r1189576 = r1189571 + r1189575;
        double r1189577 = log(r1189576);
        return r1189577;
}

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. Final simplification0.0

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

Reproduce

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