Average Error: 29.3 → 1.0
Time: 5.0m
Precision: 64
Internal Precision: 1344
\[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\frac{\sqrt{{\left(2 + \frac{2}{3} \cdot {x}^{3}\right)}^{3} - {\left({x}^{2}\right)}^{3}}}{\sqrt[3]{\left(2 + \frac{2}{3} \cdot {x}^{3}\right) \cdot \left(2 + \frac{2}{3} \cdot {x}^{3}\right) + \left({x}^{2} \cdot {x}^{2} + \left(2 + \frac{2}{3} \cdot {x}^{3}\right) \cdot {x}^{2}\right)} \cdot \sqrt[3]{\left(2 + \frac{2}{3} \cdot {x}^{3}\right) \cdot \left(2 + \frac{2}{3} \cdot {x}^{3}\right) + \left({x}^{2} \cdot {x}^{2} + \left(2 + \frac{2}{3} \cdot {x}^{3}\right) \cdot {x}^{2}\right)}} \cdot \frac{\sqrt{{\left(2 + \frac{2}{3} \cdot {x}^{3}\right)}^{3} - {\left({x}^{2}\right)}^{3}}}{\sqrt[3]{\left(2 + \frac{2}{3} \cdot {x}^{3}\right) \cdot \left(2 + \frac{2}{3} \cdot {x}^{3}\right) + \left({x}^{2} \cdot {x}^{2} + \left(2 + \frac{2}{3} \cdot {x}^{3}\right) \cdot {x}^{2}\right)}}}{2} \le 5791.779952768384:\\ \;\;\;\;\frac{\left(\frac{1}{8} \cdot {x}^{8} + \left(2 + \frac{2}{3} \cdot {x}^{3}\right)\right) - \left({x}^{2} + \frac{1}{4} \cdot {x}^{6}\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\sqrt[3]{{\left(x - x \cdot \varepsilon\right)}^{3}}} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\\ \end{array}\]

Error

Bits error versus x

Bits error versus eps

Derivation

  1. Split input into 2 regimes
  2. if (/ (* (/ (sqrt (- (pow (+ 2 (* 2/3 (pow x 3))) 3) (pow (pow x 2) 3))) (* (cbrt (+ (* (+ 2 (* 2/3 (pow x 3))) (+ 2 (* 2/3 (pow x 3)))) (+ (* (pow x 2) (pow x 2)) (* (+ 2 (* 2/3 (pow x 3))) (pow x 2))))) (cbrt (+ (* (+ 2 (* 2/3 (pow x 3))) (+ 2 (* 2/3 (pow x 3)))) (+ (* (pow x 2) (pow x 2)) (* (+ 2 (* 2/3 (pow x 3))) (pow x 2))))))) (/ (sqrt (- (pow (+ 2 (* 2/3 (pow x 3))) 3) (pow (pow x 2) 3))) (cbrt (+ (* (+ 2 (* 2/3 (pow x 3))) (+ 2 (* 2/3 (pow x 3)))) (+ (* (pow x 2) (pow x 2)) (* (+ 2 (* 2/3 (pow x 3))) (pow x 2))))))) 2) < 5791.779952768384

    1. Initial program 38.9

      \[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\]
    2. Taylor expanded around 0 1.0

      \[\leadsto \frac{\color{blue}{\left(2 + \frac{2}{3} \cdot {x}^{3}\right) - {x}^{2}}}{2}\]
    3. Using strategy rm
    4. Applied flip3--1.0

      \[\leadsto \frac{\color{blue}{\frac{{\left(2 + \frac{2}{3} \cdot {x}^{3}\right)}^{3} - {\left({x}^{2}\right)}^{3}}{\left(2 + \frac{2}{3} \cdot {x}^{3}\right) \cdot \left(2 + \frac{2}{3} \cdot {x}^{3}\right) + \left({x}^{2} \cdot {x}^{2} + \left(2 + \frac{2}{3} \cdot {x}^{3}\right) \cdot {x}^{2}\right)}}}{2}\]
    5. Taylor expanded around 0 1.0

      \[\leadsto \frac{\color{blue}{\left(\frac{1}{8} \cdot {x}^{8} + \left(\frac{1}{6} \cdot {x}^{9} + \left(\frac{2}{3} \cdot {x}^{3} + 2\right)\right)\right) - \left({x}^{2} + \frac{1}{4} \cdot {x}^{6}\right)}}{2}\]
    6. Taylor expanded around 0 1.0

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

    if 5791.779952768384 < (/ (* (/ (sqrt (- (pow (+ 2 (* 2/3 (pow x 3))) 3) (pow (pow x 2) 3))) (* (cbrt (+ (* (+ 2 (* 2/3 (pow x 3))) (+ 2 (* 2/3 (pow x 3)))) (+ (* (pow x 2) (pow x 2)) (* (+ 2 (* 2/3 (pow x 3))) (pow x 2))))) (cbrt (+ (* (+ 2 (* 2/3 (pow x 3))) (+ 2 (* 2/3 (pow x 3)))) (+ (* (pow x 2) (pow x 2)) (* (+ 2 (* 2/3 (pow x 3))) (pow x 2))))))) (/ (sqrt (- (pow (+ 2 (* 2/3 (pow x 3))) 3) (pow (pow x 2) 3))) (cbrt (+ (* (+ 2 (* 2/3 (pow x 3))) (+ 2 (* 2/3 (pow x 3)))) (+ (* (pow x 2) (pow x 2)) (* (+ 2 (* 2/3 (pow x 3))) (pow x 2))))))) 2)

    1. Initial program 1.0

      \[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}\]
    2. Using strategy rm
    3. Applied add-cbrt-cube1.0

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

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

Runtime

Time bar (total: 5.0m)Debug logProfile

herbie shell --seed '#(1071948828 1180510430 2986424009 997076509 406109801 420189285)' 
(FPCore (x eps)
  :name "NMSE Section 6.1 mentioned, A"
  (/ (- (* (+ 1 (/ 1 eps)) (exp (- (* (- 1 eps) x)))) (* (- (/ 1 eps) 1) (exp (- (* (+ 1 eps) x))))) 2))