Average Error: 0.0 → 0.0
Time: 4.2s
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 r37456 = 1.0;
        double r37457 = x;
        double r37458 = r37456 / r37457;
        double r37459 = r37457 * r37457;
        double r37460 = r37456 - r37459;
        double r37461 = sqrt(r37460);
        double r37462 = r37461 / r37457;
        double r37463 = r37458 + r37462;
        double r37464 = log(r37463);
        return r37464;
}

double f(double x) {
        double r37465 = 1.0;
        double r37466 = x;
        double r37467 = r37465 / r37466;
        double r37468 = r37466 * r37466;
        double r37469 = r37465 - r37468;
        double r37470 = sqrt(r37469);
        double r37471 = r37470 / r37466;
        double r37472 = r37467 + r37471;
        double r37473 = log(r37472);
        return r37473;
}

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