Average Error: 31.6 → 0.1
Time: 2.7s
Precision: binary64
\[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
\[\log \left(x + \sqrt{x + 1} \cdot \sqrt{x - 1}\right)\]
\log \left(x + \sqrt{x \cdot x - 1}\right)
\log \left(x + \sqrt{x + 1} \cdot \sqrt{x - 1}\right)
(FPCore (x) :precision binary64 (log (+ x (sqrt (- (* x x) 1.0)))))
(FPCore (x)
 :precision binary64
 (log (+ x (* (sqrt (+ x 1.0)) (sqrt (- x 1.0))))))
double code(double x) {
	return ((double) log(((double) (x + ((double) sqrt(((double) (((double) (x * x)) - 1.0))))))));
}
double code(double x) {
	return ((double) log(((double) (x + ((double) (((double) sqrt(((double) (x + 1.0)))) * ((double) sqrt(((double) (x - 1.0))))))))));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.6

    \[\log \left(x + \sqrt{x \cdot x - 1}\right)\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt_binary6431.6

    \[\leadsto \log \left(x + \sqrt{x \cdot x - \color{blue}{\sqrt{1} \cdot \sqrt{1}}}\right)\]
  4. Applied difference-of-squares_binary6431.6

    \[\leadsto \log \left(x + \sqrt{\color{blue}{\left(x + \sqrt{1}\right) \cdot \left(x - \sqrt{1}\right)}}\right)\]
  5. Applied sqrt-prod_binary640.1

    \[\leadsto \log \left(x + \color{blue}{\sqrt{x + \sqrt{1}} \cdot \sqrt{x - \sqrt{1}}}\right)\]
  6. Simplified0.1

    \[\leadsto \log \left(x + \color{blue}{\sqrt{x + 1}} \cdot \sqrt{x - \sqrt{1}}\right)\]
  7. Simplified0.1

    \[\leadsto \log \left(x + \sqrt{x + 1} \cdot \color{blue}{\sqrt{x - 1}}\right)\]
  8. Final simplification0.1

    \[\leadsto \log \left(x + \sqrt{x + 1} \cdot \sqrt{x - 1}\right)\]

Reproduce

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