Average Error: 53.2 → 53.2
Time: 2.3s
Precision: binary64
Cost: 13248
\[\log \left(x + \sqrt{x \cdot x + 1}\right)\]
\[\log \left(x + \sqrt{x \cdot x + 1}\right)\]
\log \left(x + \sqrt{x \cdot x + 1}\right)
\log \left(x + \sqrt{x \cdot x + 1}\right)
(FPCore (x) :precision binary64 (log (+ x (sqrt (+ (* x x) 1.0)))))
(FPCore (x) :precision binary64 (log (+ x (sqrt (+ (* x x) 1.0)))))
double code(double x) {
	return log(x + sqrt((x * x) + 1.0));
}
double code(double x) {
	return log(x + sqrt((x * x) + 1.0));
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original53.2
Target45.4
Herbie53.2
\[\begin{array}{l} \mathbf{if}\;x < 0:\\ \;\;\;\;\log \left(\frac{-1}{x - \sqrt{x \cdot x + 1}}\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(x + \sqrt{x \cdot x + 1}\right)\\ \end{array}\]

Derivation

  1. Initial program 53.2

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

Reproduce

herbie shell --seed 2021042 
(FPCore (x)
  :name "Hyperbolic arcsine"
  :precision binary64

  :herbie-target
  (if (< x 0.0) (log (/ -1.0 (- x (sqrt (+ (* x x) 1.0))))) (log (+ x (sqrt (+ (* x x) 1.0)))))

  (log (+ x (sqrt (+ (* x x) 1.0)))))