Average Error: 31.9 → 0.3
Time: 9.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 r54149 = x;
        double r54150 = r54149 * r54149;
        double r54151 = 1.0;
        double r54152 = r54150 - r54151;
        double r54153 = sqrt(r54152);
        double r54154 = r54149 + r54153;
        double r54155 = log(r54154);
        return r54155;
}

double f(double x) {
        double r54156 = 2.0;
        double r54157 = x;
        double r54158 = r54156 * r54157;
        double r54159 = 0.5;
        double r54160 = r54159 / r54157;
        double r54161 = r54158 - r54160;
        double r54162 = 0.125;
        double r54163 = 3.0;
        double r54164 = pow(r54157, r54163);
        double r54165 = r54162 / r54164;
        double r54166 = r54161 - r54165;
        double r54167 = log(r54166);
        return r54167;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.9

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

    \[\leadsto \log \color{blue}{\left(\left(2 \cdot x - \frac{0.5}{x}\right) - \frac{0.125}{{x}^{3}}\right)}\]
  4. Final simplification0.3

    \[\leadsto \log \left(\left(2 \cdot x - \frac{0.5}{x}\right) - \frac{0.125}{{x}^{3}}\right)\]

Reproduce

herbie shell --seed 2019303 +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arc-cosine"
  :precision binary64
  (log (+ x (sqrt (- (* x x) 1)))))