Average Error: 31.0 → 0.4
Time: 16.2s
Precision: 64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\left(\log x + \log 2\right) - \left(\frac{\frac{3}{32}}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)} + \frac{\frac{\frac{1}{4}}{x}}{x}\right)\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\left(\log x + \log 2\right) - \left(\frac{\frac{3}{32}}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)} + \frac{\frac{\frac{1}{4}}{x}}{x}\right)
double f(double x) {
        double r2372134 = x;
        double r2372135 = r2372134 * r2372134;
        double r2372136 = 1.0;
        double r2372137 = r2372135 - r2372136;
        double r2372138 = sqrt(r2372137);
        double r2372139 = r2372134 + r2372138;
        double r2372140 = log(r2372139);
        return r2372140;
}

double f(double x) {
        double r2372141 = x;
        double r2372142 = log(r2372141);
        double r2372143 = 2.0;
        double r2372144 = log(r2372143);
        double r2372145 = r2372142 + r2372144;
        double r2372146 = 0.09375;
        double r2372147 = r2372141 * r2372141;
        double r2372148 = r2372147 * r2372147;
        double r2372149 = r2372146 / r2372148;
        double r2372150 = 0.25;
        double r2372151 = r2372150 / r2372141;
        double r2372152 = r2372151 / r2372141;
        double r2372153 = r2372149 + r2372152;
        double r2372154 = r2372145 - r2372153;
        return r2372154;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.0

    \[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
  2. Simplified31.0

    \[\leadsto \color{blue}{\log \left(x + \sqrt{\mathsf{fma}\left(x, x, -1\right)}\right)}\]
  3. Taylor expanded around inf 0.4

    \[\leadsto \color{blue}{\log 2 - \left(\log \left(\frac{1}{x}\right) + \left(\frac{3}{32} \cdot \frac{1}{{x}^{4}} + \frac{1}{4} \cdot \frac{1}{{x}^{2}}\right)\right)}\]
  4. Simplified0.4

    \[\leadsto \color{blue}{\left(\log x + \log 2\right) - \left(\frac{\frac{3}{32}}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)} + \frac{\frac{\frac{1}{4}}{x}}{x}\right)}\]
  5. Final simplification0.4

    \[\leadsto \left(\log x + \log 2\right) - \left(\frac{\frac{3}{32}}{\left(x \cdot x\right) \cdot \left(x \cdot x\right)} + \frac{\frac{\frac{1}{4}}{x}}{x}\right)\]

Reproduce

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