Average Error: 32.5 → 0.2
Time: 2.2s
Precision: 64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(2 \cdot x - \left(0.5 \cdot \frac{1}{x} + 0.125 \cdot \frac{1}{{x}^{3}}\right)\right)\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\log \left(2 \cdot x - \left(0.5 \cdot \frac{1}{x} + 0.125 \cdot \frac{1}{{x}^{3}}\right)\right)
double f(double x) {
        double r67899 = x;
        double r67900 = r67899 * r67899;
        double r67901 = 1.0;
        double r67902 = r67900 - r67901;
        double r67903 = sqrt(r67902);
        double r67904 = r67899 + r67903;
        double r67905 = log(r67904);
        return r67905;
}

double f(double x) {
        double r67906 = 2.0;
        double r67907 = x;
        double r67908 = r67906 * r67907;
        double r67909 = 0.5;
        double r67910 = 1.0;
        double r67911 = r67910 / r67907;
        double r67912 = r67909 * r67911;
        double r67913 = 0.125;
        double r67914 = 3.0;
        double r67915 = pow(r67907, r67914);
        double r67916 = r67910 / r67915;
        double r67917 = r67913 * r67916;
        double r67918 = r67912 + r67917;
        double r67919 = r67908 - r67918;
        double r67920 = log(r67919);
        return r67920;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.5

    \[\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. Final simplification0.2

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

Reproduce

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