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 r42135 = x;
        double r42136 = r42135 * r42135;
        double r42137 = 1.0;
        double r42138 = r42136 - r42137;
        double r42139 = sqrt(r42138);
        double r42140 = r42135 + r42139;
        double r42141 = log(r42140);
        return r42141;
}

double f(double x) {
        double r42142 = 2.0;
        double r42143 = x;
        double r42144 = r42142 * r42143;
        double r42145 = 0.5;
        double r42146 = r42145 / r42143;
        double r42147 = r42144 - r42146;
        double r42148 = 0.125;
        double r42149 = 3.0;
        double r42150 = pow(r42143, r42149);
        double r42151 = r42148 / r42150;
        double r42152 = r42147 - r42151;
        double r42153 = log(r42152);
        return r42153;
}

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)))))