Average Error: 31.8 → 0.2
Time: 7.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 r51049 = x;
        double r51050 = r51049 * r51049;
        double r51051 = 1.0;
        double r51052 = r51050 - r51051;
        double r51053 = sqrt(r51052);
        double r51054 = r51049 + r51053;
        double r51055 = log(r51054);
        return r51055;
}

double f(double x) {
        double r51056 = 2.0;
        double r51057 = x;
        double r51058 = r51056 * r51057;
        double r51059 = 0.5;
        double r51060 = r51059 / r51057;
        double r51061 = r51058 - r51060;
        double r51062 = 0.125;
        double r51063 = 3.0;
        double r51064 = pow(r51057, r51063);
        double r51065 = r51062 / r51064;
        double r51066 = r51061 - r51065;
        double r51067 = log(r51066);
        return r51067;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.8

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