Average Error: 52.5 → 29.4
Time: 54.5s
Precision: 64
Internal Precision: 2368
\[\log \left(x + \sqrt{x \cdot x + 1}\right)\]
\[\begin{array}{l} \mathbf{if}\;x \le -384.63614652277926:\\ \;\;\;\;\log \left(\frac{\frac{\frac{1}{8}}{x}}{x \cdot x} - \frac{\frac{1}{2}}{x}\right)\\ \mathbf{if}\;x \le 184.87733837715223:\\ \;\;\;\;\log \left(x + \frac{\sqrt{1 + {\left(x \cdot x\right)}^{3}}}{\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 - x \cdot x\right)}}\right)\\ \mathbf{else}:\\ \;\;\;\;\log \left(\left(\left(x + x\right) + \frac{\frac{1}{2}}{x}\right) - \frac{\frac{\frac{1}{8}}{x}}{x \cdot x}\right)\\ \end{array}\]

Error

Bits error versus x

Target

Original52.5
Target44.7
Herbie29.4
\[\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 < -384.63614652277926

    1. Initial program 62.0

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

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

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

    if -384.63614652277926 < x < 184.87733837715223

    1. Initial program 58.0

      \[\log \left(x + \sqrt{x \cdot x + 1}\right)\]
    2. Using strategy rm
    3. Applied flip3-+58.0

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

      \[\leadsto \log \left(x + \color{blue}{\frac{\sqrt{{\left(x \cdot x\right)}^{3} + {1}^{3}}}{\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)}}}\right)\]
    5. Applied simplify58.0

      \[\leadsto \log \left(x + \frac{\color{blue}{\sqrt{1 + {\left(x \cdot x\right)}^{3}}}}{\sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right) + \left(1 \cdot 1 - \left(x \cdot x\right) \cdot 1\right)}}\right)\]
    6. Applied simplify58.0

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

    if 184.87733837715223 < x

    1. Initial program 31.4

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

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

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

Runtime

Time bar (total: 54.5s)Debug logProfile

herbie shell --seed '#(1071246582 2318319007 2683472949 3810440501 3233274817 2724848749)' 
(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)))))