Average Error: 32.1 → 0.2
Time: 10.9s
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 r40307 = x;
        double r40308 = r40307 * r40307;
        double r40309 = 1.0;
        double r40310 = r40308 - r40309;
        double r40311 = sqrt(r40310);
        double r40312 = r40307 + r40311;
        double r40313 = log(r40312);
        return r40313;
}

double f(double x) {
        double r40314 = 2.0;
        double r40315 = x;
        double r40316 = r40314 * r40315;
        double r40317 = 0.5;
        double r40318 = r40317 / r40315;
        double r40319 = r40316 - r40318;
        double r40320 = 0.125;
        double r40321 = 3.0;
        double r40322 = pow(r40315, r40321);
        double r40323 = r40320 / r40322;
        double r40324 = r40319 - r40323;
        double r40325 = log(r40324);
        return r40325;
}

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