Average Error: 31.7 → 0.2
Time: 7.2s
Precision: 64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(\left(2 \cdot x - \frac{0.5}{x}\right) - \frac{0.125}{{x}^{3}}\right)\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\log \left(\left(2 \cdot x - \frac{0.5}{x}\right) - \frac{0.125}{{x}^{3}}\right)
double f(double x) {
        double r52543 = x;
        double r52544 = r52543 * r52543;
        double r52545 = 1.0;
        double r52546 = r52544 - r52545;
        double r52547 = sqrt(r52546);
        double r52548 = r52543 + r52547;
        double r52549 = log(r52548);
        return r52549;
}

double f(double x) {
        double r52550 = 2.0;
        double r52551 = x;
        double r52552 = r52550 * r52551;
        double r52553 = 0.5;
        double r52554 = r52553 / r52551;
        double r52555 = r52552 - r52554;
        double r52556 = 0.125;
        double r52557 = 3.0;
        double r52558 = pow(r52551, r52557);
        double r52559 = r52556 / r52558;
        double r52560 = r52555 - r52559;
        double r52561 = log(r52560);
        return r52561;
}

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.2

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

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

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

Reproduce

herbie shell --seed 2019306 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  :precision binary64
  (log (+ x (sqrt (- (* x x) 1)))))