Average Error: 29.4 → 1.1
Time: 5.0s
Precision: binary64
\[\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}\;x \le 464.350103573216245:\\ \;\;\;\;\frac{\left(\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}} \cdot \sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}\right) \cdot \frac{\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}}{2 \cdot 2 + x \cdot \left(x \cdot \left(\left(x \cdot 0.66666666666666674 - 1\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) - 2\right)\right)\right)}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{x \cdot \left(\varepsilon - 1\right)} + {e}^{\left(x \cdot \left(\left(-1\right) - \varepsilon\right)\right)} \cdot \left(1 - \frac{1}{\varepsilon}\right)}{2}\\ \end{array}\]

Error

Bits error versus x

Bits error versus eps

Derivation

  1. Split input into 2 regimes
  2. if x < 464.350103573216245

    1. Initial program 39.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. Taylor expanded around 0 1.4

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

      \[\leadsto \frac{\color{blue}{{x}^{3} \cdot 0.66666666666666674 + \left(2 - 1 \cdot \left(x \cdot x\right)\right)}}{2}\]
    4. Using strategy rm
    5. Applied add-sqr-sqrt2.4

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

      \[\leadsto \frac{\color{blue}{\sqrt{2 + x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)}} \cdot \sqrt{{x}^{3} \cdot 0.66666666666666674 + \left(2 - 1 \cdot \left(x \cdot x\right)\right)}}{2}\]
    7. Simplified2.4

      \[\leadsto \frac{\sqrt{2 + x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)} \cdot \color{blue}{\sqrt{2 + x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)}}}{2}\]
    8. Using strategy rm
    9. Applied flip3-+2.4

      \[\leadsto \frac{\sqrt{2 + x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)} \cdot \sqrt{\color{blue}{\frac{{2}^{3} + {\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)}^{3}}{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)}}}}{2}\]
    10. Applied sqrt-div2.4

      \[\leadsto \frac{\sqrt{2 + x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)} \cdot \color{blue}{\frac{\sqrt{{2}^{3} + {\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)}^{3}}}{\sqrt{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)}}}}{2}\]
    11. Applied flip3-+2.4

      \[\leadsto \frac{\sqrt{\color{blue}{\frac{{2}^{3} + {\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)}^{3}}{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)}}} \cdot \frac{\sqrt{{2}^{3} + {\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)}^{3}}}{\sqrt{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)}}}{2}\]
    12. Applied sqrt-div2.4

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{{2}^{3} + {\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)}^{3}}}{\sqrt{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)}}} \cdot \frac{\sqrt{{2}^{3} + {\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)}^{3}}}{\sqrt{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)}}}{2}\]
    13. Applied frac-times2.4

      \[\leadsto \frac{\color{blue}{\frac{\sqrt{{2}^{3} + {\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)}^{3}} \cdot \sqrt{{2}^{3} + {\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)}^{3}}}{\sqrt{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)} \cdot \sqrt{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)}}}}{2}\]
    14. Simplified1.4

      \[\leadsto \frac{\frac{\color{blue}{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}}{\sqrt{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)} \cdot \sqrt{2 \cdot 2 + \left(\left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right) - 2 \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right)\right)\right)}}}{2}\]
    15. Simplified1.4

      \[\leadsto \frac{\frac{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}{\color{blue}{2 \cdot 2 + x \cdot \left(\left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) - 2\right)\right)}}}{2}\]
    16. Using strategy rm
    17. Applied *-un-lft-identity1.4

      \[\leadsto \frac{\frac{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}{\color{blue}{1 \cdot \left(2 \cdot 2 + x \cdot \left(\left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) - 2\right)\right)\right)}}}{2}\]
    18. Applied add-cube-cbrt1.4

      \[\leadsto \frac{\frac{\color{blue}{\left(\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}} \cdot \sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}\right) \cdot \sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}}}{1 \cdot \left(2 \cdot 2 + x \cdot \left(\left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) - 2\right)\right)\right)}}{2}\]
    19. Applied times-frac1.4

      \[\leadsto \frac{\color{blue}{\frac{\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}} \cdot \sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}}{1} \cdot \frac{\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}}{2 \cdot 2 + x \cdot \left(\left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) - 2\right)\right)}}}{2}\]
    20. Simplified1.4

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}} \cdot \sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}\right)} \cdot \frac{\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}}{2 \cdot 2 + x \cdot \left(\left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) - 2\right)\right)}}{2}\]
    21. Simplified1.4

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

    if 464.350103573216245 < x

    1. Initial program 0.1

      \[\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 *-un-lft-identity0.1

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

      \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \color{blue}{{\left(e^{1}\right)}^{\left(-\left(1 + \varepsilon\right) \cdot x\right)}}}{2}\]
    5. Simplified0.1

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le 464.350103573216245:\\ \;\;\;\;\frac{\left(\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}} \cdot \sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}\right) \cdot \frac{\sqrt[3]{{2}^{3} + {\left(x \cdot 0.66666666666666674 - 1\right)}^{3} \cdot {x}^{6}}}{2 \cdot 2 + x \cdot \left(x \cdot \left(\left(x \cdot 0.66666666666666674 - 1\right) \cdot \left(x \cdot \left(x \cdot \left(x \cdot 0.66666666666666674 - 1\right)\right) - 2\right)\right)\right)}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{x \cdot \left(\varepsilon - 1\right)} + {e}^{\left(x \cdot \left(\left(-1\right) - \varepsilon\right)\right)} \cdot \left(1 - \frac{1}{\varepsilon}\right)}{2}\\ \end{array}\]

Reproduce

herbie shell --seed 2020185 
(FPCore (x eps)
  :name "NMSE Section 6.1 mentioned, A"
  :precision binary64
  (/ (- (* (+ 1.0 (/ 1.0 eps)) (exp (neg (* (- 1.0 eps) x)))) (* (- (/ 1.0 eps) 1.0) (exp (neg (* (+ 1.0 eps) x))))) 2.0))