Average Error: 52.6 → 44.9
Time: 6.5s
Precision: 64
Internal Precision: 2368
\[\log \left(x + \sqrt{x \cdot x + 1}\right)\]
\[\log \left(\sqrt{1^2 + x^2}^* + x\right)\]

Error

Bits error versus x

Target

Original52.6
Target44.7
Herbie44.9
\[\begin{array}{l} \mathbf{if}\;x \lt 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 52.6

    \[\log \left(x + \sqrt{x \cdot x + 1}\right)\]
  2. Applied simplify44.9

    \[\leadsto \color{blue}{\log \left(\sqrt{1^2 + x^2}^* + x\right)}\]

Runtime

Time bar (total: 6.5s)Debug logProfile

herbie shell --seed '#(1071119240 1686926585 3481876196 78132896 2080707795 3185793749)' +o rules:numerics
(FPCore (x)
  :name "Hyperbolic arcsine"

  :herbie-target
  (if (< x 0) (log (/ -1 (- x (sqrt (+ (* x x) 1))))) (log (+ x (sqrt (+ (* x x) 1)))))

  (log (+ x (sqrt (+ (* x x) 1)))))