Average Error: 32.1 → 0.2
Time: 8.1s
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 r44915 = x;
        double r44916 = r44915 * r44915;
        double r44917 = 1.0;
        double r44918 = r44916 - r44917;
        double r44919 = sqrt(r44918);
        double r44920 = r44915 + r44919;
        double r44921 = log(r44920);
        return r44921;
}

double f(double x) {
        double r44922 = 2.0;
        double r44923 = x;
        double r44924 = r44922 * r44923;
        double r44925 = 0.5;
        double r44926 = r44925 / r44923;
        double r44927 = r44924 - r44926;
        double r44928 = 0.125;
        double r44929 = 3.0;
        double r44930 = pow(r44923, r44929);
        double r44931 = r44928 / r44930;
        double r44932 = r44927 - r44931;
        double r44933 = log(r44932);
        return r44933;
}

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