Average Error: 0.1 → 0.1
Time: 8.4s
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 r2142569 = 1.0;
        double r2142570 = x;
        double r2142571 = r2142569 / r2142570;
        double r2142572 = r2142570 * r2142570;
        double r2142573 = r2142569 - r2142572;
        double r2142574 = sqrt(r2142573);
        double r2142575 = r2142574 / r2142570;
        double r2142576 = r2142571 + r2142575;
        double r2142577 = log(r2142576);
        return r2142577;
}

double f(double x) {
        double r2142578 = 1.0;
        double r2142579 = x;
        double r2142580 = r2142578 / r2142579;
        double r2142581 = r2142579 * r2142579;
        double r2142582 = r2142578 - r2142581;
        double r2142583 = sqrt(r2142582);
        double r2142584 = r2142583 / r2142579;
        double r2142585 = r2142580 + r2142584;
        double r2142586 = log(r2142585);
        return r2142586;
}

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

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

Reproduce

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