Average Error: 32.0 → 0.4
Time: 32.3s
Precision: 64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\left(\left(\log x - \frac{\frac{0.25}{x}}{x}\right) + \log 2\right) - \frac{\frac{0.09375}{x \cdot x}}{x \cdot x}\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\left(\left(\log x - \frac{\frac{0.25}{x}}{x}\right) + \log 2\right) - \frac{\frac{0.09375}{x \cdot x}}{x \cdot x}
double f(double x) {
        double r3086774 = x;
        double r3086775 = r3086774 * r3086774;
        double r3086776 = 1.0;
        double r3086777 = r3086775 - r3086776;
        double r3086778 = sqrt(r3086777);
        double r3086779 = r3086774 + r3086778;
        double r3086780 = log(r3086779);
        return r3086780;
}

double f(double x) {
        double r3086781 = x;
        double r3086782 = log(r3086781);
        double r3086783 = 0.25;
        double r3086784 = r3086783 / r3086781;
        double r3086785 = r3086784 / r3086781;
        double r3086786 = r3086782 - r3086785;
        double r3086787 = 2.0;
        double r3086788 = log(r3086787);
        double r3086789 = r3086786 + r3086788;
        double r3086790 = 0.09375;
        double r3086791 = r3086781 * r3086781;
        double r3086792 = r3086790 / r3086791;
        double r3086793 = r3086792 / r3086791;
        double r3086794 = r3086789 - r3086793;
        return r3086794;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.0

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

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

    \[\leadsto \color{blue}{\left(\log 2 + \left(\log x - \frac{\frac{0.25}{x}}{x}\right)\right) - \frac{\frac{0.09375}{x \cdot x}}{x \cdot x}}\]
  4. Final simplification0.4

    \[\leadsto \left(\left(\log x - \frac{\frac{0.25}{x}}{x}\right) + \log 2\right) - \frac{\frac{0.09375}{x \cdot x}}{x \cdot x}\]

Reproduce

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