Average Error: 52.3 → 0.2
Time: 37.6s
Precision: 64
Internal Precision: 2368
\[\log \left(x + \sqrt{x \cdot x + 1}\right)\]
\[\begin{array}{l} \mathbf{if}\;x \le -1.1827205110785308:\\ \;\;\;\;\log \left(\frac{\frac{\frac{1}{8}}{x}}{x \cdot x} - \frac{\frac{1}{2}}{x}\right)\\ \mathbf{if}\;x \le 0.007830953645086805:\\ \;\;\;\;\left(\frac{3}{40} \cdot {x}^{5} + x\right) - \frac{1}{6} \cdot {x}^{3}\\ \mathbf{else}:\\ \;\;\;\;\log \left((\left(\sqrt[3]{\sqrt{1^2 + x^2}^*} \cdot \sqrt[3]{\sqrt{1^2 + x^2}^*}\right) \cdot \left(\sqrt[3]{\sqrt{1^2 + x^2}^*}\right) + x)_*\right)\\ \end{array}\]

Error

Bits error versus x

Target

Original52.3
Target44.7
Herbie0.2
\[\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. Split input into 3 regimes
  2. if x < -1.1827205110785308

    1. Initial program 61.3

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

      \[\leadsto \color{blue}{\log \left(\sqrt{1^2 + x^2}^* + x\right)}\]
    3. Taylor expanded around -inf 60.9

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

      \[\leadsto \color{blue}{\log \left(\frac{\frac{\frac{1}{8}}{x}}{x \cdot x} - \frac{\frac{1}{2}}{x}\right)}\]

    if -1.1827205110785308 < x < 0.007830953645086805

    1. Initial program 58.7

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

      \[\leadsto \color{blue}{\log \left(\sqrt{1^2 + x^2}^* + x\right)}\]
    3. Taylor expanded around 0 0.1

      \[\leadsto \color{blue}{\left(\frac{3}{40} \cdot {x}^{5} + x\right) - \frac{1}{6} \cdot {x}^{3}}\]

    if 0.007830953645086805 < x

    1. Initial program 31.1

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

      \[\leadsto \color{blue}{\log \left(\sqrt{1^2 + x^2}^* + x\right)}\]
    3. Using strategy rm
    4. Applied add-cube-cbrt0.1

      \[\leadsto \log \left(\color{blue}{\left(\sqrt[3]{\sqrt{1^2 + x^2}^*} \cdot \sqrt[3]{\sqrt{1^2 + x^2}^*}\right) \cdot \sqrt[3]{\sqrt{1^2 + x^2}^*}} + x\right)\]
    5. Applied fma-def0.1

      \[\leadsto \log \color{blue}{\left((\left(\sqrt[3]{\sqrt{1^2 + x^2}^*} \cdot \sqrt[3]{\sqrt{1^2 + x^2}^*}\right) \cdot \left(\sqrt[3]{\sqrt{1^2 + x^2}^*}\right) + x)_*\right)}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 37.6s)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' +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)))))