Average Error: 32.6 → 0.2
Time: 6.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 r51565 = x;
        double r51566 = r51565 * r51565;
        double r51567 = 1.0;
        double r51568 = r51566 - r51567;
        double r51569 = sqrt(r51568);
        double r51570 = r51565 + r51569;
        double r51571 = log(r51570);
        return r51571;
}

double f(double x) {
        double r51572 = 2.0;
        double r51573 = x;
        double r51574 = r51572 * r51573;
        double r51575 = 0.5;
        double r51576 = r51575 / r51573;
        double r51577 = r51574 - r51576;
        double r51578 = 0.125;
        double r51579 = 3.0;
        double r51580 = pow(r51573, r51579);
        double r51581 = r51578 / r51580;
        double r51582 = r51577 - r51581;
        double r51583 = log(r51582);
        return r51583;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.6

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