Average Error: 0.1 → 0.1
Time: 6.6s
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 r101435 = 1.0;
        double r101436 = x;
        double r101437 = r101435 / r101436;
        double r101438 = r101436 * r101436;
        double r101439 = r101435 - r101438;
        double r101440 = sqrt(r101439);
        double r101441 = r101440 / r101436;
        double r101442 = r101437 + r101441;
        double r101443 = log(r101442);
        return r101443;
}

double f(double x) {
        double r101444 = 1.0;
        double r101445 = x;
        double r101446 = r101444 / r101445;
        double r101447 = r101445 * r101445;
        double r101448 = r101444 - r101447;
        double r101449 = sqrt(r101448);
        double r101450 = r101449 / r101445;
        double r101451 = r101446 + r101450;
        double r101452 = log(r101451);
        return r101452;
}

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 2020083 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-(co)secant"
  :precision binary64
  (log (+ (/ 1 x) (/ (sqrt (- 1 (* x x))) x))))