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

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original52.5
Target44.6
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.0681877647337914

    1. Initial program 61.9

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

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

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

    if -1.0681877647337914 < x < 0.9631168391620223

    1. Initial program 58.9

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

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

    if 0.9631168391620223 < x

    1. Initial program 30.3

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

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

      \[\leadsto \color{blue}{\log \left(\left(\frac{\frac{1}{2}}{x} + x \cdot 2\right) - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}\right)}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 55.1s)Debug logProfile

herbie shell --seed 2018170 
(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)))))