Average Error: 32.4 → 0.2
Time: 6.0s
Precision: 64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(x + \left(\left(x - \frac{0.125}{{x}^{3}}\right) - 0.5 \cdot \frac{1}{x}\right)\right)\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\log \left(x + \left(\left(x - \frac{0.125}{{x}^{3}}\right) - 0.5 \cdot \frac{1}{x}\right)\right)
double f(double x) {
        double r70952 = x;
        double r70953 = r70952 * r70952;
        double r70954 = 1.0;
        double r70955 = r70953 - r70954;
        double r70956 = sqrt(r70955);
        double r70957 = r70952 + r70956;
        double r70958 = log(r70957);
        return r70958;
}

double f(double x) {
        double r70959 = x;
        double r70960 = 0.125;
        double r70961 = 3.0;
        double r70962 = pow(r70959, r70961);
        double r70963 = r70960 / r70962;
        double r70964 = r70959 - r70963;
        double r70965 = 0.5;
        double r70966 = 1.0;
        double r70967 = r70966 / r70959;
        double r70968 = r70965 * r70967;
        double r70969 = r70964 - r70968;
        double r70970 = r70959 + r70969;
        double r70971 = log(r70970);
        return r70971;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.4

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

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

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

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

Reproduce

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