Average Error: 31.9 → 0.3
Time: 9.3s
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 r37854 = x;
        double r37855 = r37854 * r37854;
        double r37856 = 1.0;
        double r37857 = r37855 - r37856;
        double r37858 = sqrt(r37857);
        double r37859 = r37854 + r37858;
        double r37860 = log(r37859);
        return r37860;
}

double f(double x) {
        double r37861 = 2.0;
        double r37862 = x;
        double r37863 = r37861 * r37862;
        double r37864 = 0.5;
        double r37865 = r37864 / r37862;
        double r37866 = r37863 - r37865;
        double r37867 = 0.125;
        double r37868 = 3.0;
        double r37869 = pow(r37862, r37868);
        double r37870 = r37867 / r37869;
        double r37871 = r37866 - r37870;
        double r37872 = log(r37871);
        return r37872;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.9

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

    \[\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.3

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

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

Reproduce

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