Average Error: 32.1 → 0.2
Time: 8.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 r39259 = x;
        double r39260 = r39259 * r39259;
        double r39261 = 1.0;
        double r39262 = r39260 - r39261;
        double r39263 = sqrt(r39262);
        double r39264 = r39259 + r39263;
        double r39265 = log(r39264);
        return r39265;
}

double f(double x) {
        double r39266 = 2.0;
        double r39267 = x;
        double r39268 = r39266 * r39267;
        double r39269 = 0.5;
        double r39270 = r39269 / r39267;
        double r39271 = r39268 - r39270;
        double r39272 = 0.125;
        double r39273 = 3.0;
        double r39274 = pow(r39267, r39273);
        double r39275 = r39272 / r39274;
        double r39276 = r39271 - r39275;
        double r39277 = log(r39276);
        return r39277;
}

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