Average Error: 32.1 → 0.3
Time: 7.3s
Precision: 64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(x + \left(\left(x - \frac{0.5}{x}\right) - \frac{0.125}{{x}^{3}}\right)\right)\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\log \left(x + \left(\left(x - \frac{0.5}{x}\right) - \frac{0.125}{{x}^{3}}\right)\right)
double f(double x) {
        double r49643 = x;
        double r49644 = r49643 * r49643;
        double r49645 = 1.0;
        double r49646 = r49644 - r49645;
        double r49647 = sqrt(r49646);
        double r49648 = r49643 + r49647;
        double r49649 = log(r49648);
        return r49649;
}

double f(double x) {
        double r49650 = x;
        double r49651 = 0.5;
        double r49652 = r49651 / r49650;
        double r49653 = r49650 - r49652;
        double r49654 = 0.125;
        double r49655 = 3.0;
        double r49656 = pow(r49650, r49655);
        double r49657 = r49654 / r49656;
        double r49658 = r49653 - r49657;
        double r49659 = r49650 + r49658;
        double r49660 = log(r49659);
        return r49660;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.1

    \[\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.5 \cdot \frac{1}{x} + 0.125 \cdot \frac{1}{{x}^{3}}\right)\right)}\right)\]
  3. Simplified0.3

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

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

Reproduce

herbie shell --seed 2019199 
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  (log (+ x (sqrt (- (* x x) 1.0)))))