Average Error: 31.7 → 0.3
Time: 7.2s
Precision: 64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(x + \left(x - \left(\frac{0.5}{x} + \frac{0.125}{x \cdot \left(x \cdot x\right)}\right)\right)\right)\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\log \left(x + \left(x - \left(\frac{0.5}{x} + \frac{0.125}{x \cdot \left(x \cdot x\right)}\right)\right)\right)
double f(double x) {
        double r2220421 = x;
        double r2220422 = r2220421 * r2220421;
        double r2220423 = 1.0;
        double r2220424 = r2220422 - r2220423;
        double r2220425 = sqrt(r2220424);
        double r2220426 = r2220421 + r2220425;
        double r2220427 = log(r2220426);
        return r2220427;
}

double f(double x) {
        double r2220428 = x;
        double r2220429 = 0.5;
        double r2220430 = r2220429 / r2220428;
        double r2220431 = 0.125;
        double r2220432 = r2220428 * r2220428;
        double r2220433 = r2220428 * r2220432;
        double r2220434 = r2220431 / r2220433;
        double r2220435 = r2220430 + r2220434;
        double r2220436 = r2220428 - r2220435;
        double r2220437 = r2220428 + r2220436;
        double r2220438 = log(r2220437);
        return r2220438;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.7

    \[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
  2. Taylor expanded around inf 0.3

    \[\leadsto \log \left(x + \color{blue}{\left(x - \left(0.125 \cdot \frac{1}{{x}^{3}} + 0.5 \cdot \frac{1}{x}\right)\right)}\right)\]
  3. Simplified0.3

    \[\leadsto \log \left(x + \color{blue}{\left(x - \left(\frac{0.125}{x \cdot \left(x \cdot x\right)} + \frac{0.5}{x}\right)\right)}\right)\]
  4. Final simplification0.3

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

Reproduce

herbie shell --seed 2019192 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  (log (+ x (sqrt (- (* x x) 1.0)))))