Average Error: 32.1 → 0.2
Time: 7.6s
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 r38677 = x;
        double r38678 = r38677 * r38677;
        double r38679 = 1.0;
        double r38680 = r38678 - r38679;
        double r38681 = sqrt(r38680);
        double r38682 = r38677 + r38681;
        double r38683 = log(r38682);
        return r38683;
}

double f(double x) {
        double r38684 = 2.0;
        double r38685 = x;
        double r38686 = r38684 * r38685;
        double r38687 = 0.5;
        double r38688 = r38687 / r38685;
        double r38689 = r38686 - r38688;
        double r38690 = 0.125;
        double r38691 = 3.0;
        double r38692 = pow(r38685, r38691);
        double r38693 = r38690 / r38692;
        double r38694 = r38689 - r38693;
        double r38695 = log(r38694);
        return r38695;
}

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.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 2019323 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  :precision binary64
  (log (+ x (sqrt (- (* x x) 1)))))