Average Error: 32.0 → 0.3
Time: 2.1s
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 r30750 = x;
        double r30751 = r30750 * r30750;
        double r30752 = 1.0;
        double r30753 = r30751 - r30752;
        double r30754 = sqrt(r30753);
        double r30755 = r30750 + r30754;
        double r30756 = log(r30755);
        return r30756;
}

double f(double x) {
        double r30757 = 2.0;
        double r30758 = x;
        double r30759 = r30757 * r30758;
        double r30760 = 0.5;
        double r30761 = 1.0;
        double r30762 = r30761 / r30758;
        double r30763 = r30760 * r30762;
        double r30764 = 0.125;
        double r30765 = 3.0;
        double r30766 = pow(r30758, r30765);
        double r30767 = r30761 / r30766;
        double r30768 = r30764 * r30767;
        double r30769 = r30763 + r30768;
        double r30770 = r30759 - r30769;
        double r30771 = log(r30770);
        return r30771;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.0

    \[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
  2. Taylor expanded around inf 0.3

    \[\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.3

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