Average Error: 32.7 → 0.2
Time: 2.8s
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 r32291 = x;
        double r32292 = r32291 * r32291;
        double r32293 = 1.0;
        double r32294 = r32292 - r32293;
        double r32295 = sqrt(r32294);
        double r32296 = r32291 + r32295;
        double r32297 = log(r32296);
        return r32297;
}

double f(double x) {
        double r32298 = 2.0;
        double r32299 = x;
        double r32300 = r32298 * r32299;
        double r32301 = 0.5;
        double r32302 = 1.0;
        double r32303 = r32302 / r32299;
        double r32304 = r32301 * r32303;
        double r32305 = 0.125;
        double r32306 = 3.0;
        double r32307 = pow(r32299, r32306);
        double r32308 = r32302 / r32307;
        double r32309 = r32305 * r32308;
        double r32310 = r32304 + r32309;
        double r32311 = r32300 - r32310;
        double r32312 = log(r32311);
        return r32312;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.7

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