NMSE Section 6.1 mentioned, A

Percentage Accurate: 73.4% → 99.5%
Time: 9.5s
Alternatives: 11
Speedup: 8.0×

Specification

?
\[\begin{array}{l} \\ \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} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (/
  (-
   (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x))))
   (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x)))))
  2.0))
double code(double x, double eps) {
	return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, eps)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
	return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps):
	return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps)
	return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0)
end
function tmp = code(x, eps)
	tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}

\\
\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}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 11 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 73.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \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} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (/
  (-
   (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x))))
   (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x)))))
  2.0))
double code(double x, double eps) {
	return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, eps)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: eps
    code = (((1.0d0 + (1.0d0 / eps)) * exp(-((1.0d0 - eps) * x))) - (((1.0d0 / eps) - 1.0d0) * exp(-((1.0d0 + eps) * x)))) / 2.0d0
end function
public static double code(double x, double eps) {
	return (((1.0 + (1.0 / eps)) * Math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * Math.exp(-((1.0 + eps) * x)))) / 2.0;
}
def code(x, eps):
	return (((1.0 + (1.0 / eps)) * math.exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * math.exp(-((1.0 + eps) * x)))) / 2.0
function code(x, eps)
	return Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps)) * exp(Float64(-Float64(Float64(1.0 - eps) * x)))) - Float64(Float64(Float64(1.0 / eps) - 1.0) * exp(Float64(-Float64(Float64(1.0 + eps) * x))))) / 2.0)
end
function tmp = code(x, eps)
	tmp = (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
end
code[x_, eps_] := N[(N[(N[(N[(1.0 + N[(1.0 / eps), $MachinePrecision]), $MachinePrecision] * N[Exp[(-N[(N[(1.0 - eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[(-N[(N[(1.0 + eps), $MachinePrecision] * x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]
\begin{array}{l}

\\
\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}
\end{array}

Alternative 1: 99.5% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\left(-1 - \varepsilon\right) \cdot x}\\ t_1 := 1 + {\varepsilon}^{-1}\\ t_2 := e^{-x}\\ \mathbf{if}\;\frac{t\_1 \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot t\_0}{2} \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(t\_2, \left(1 + x\right) - -1, t\_2 \cdot x\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_1 \cdot e^{x \cdot \varepsilon} - -1 \cdot t\_0}{2}\\ \end{array} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (let* ((t_0 (exp (* (- -1.0 eps) x)))
        (t_1 (+ 1.0 (pow eps -1.0)))
        (t_2 (exp (- x))))
   (if (<=
        (/
         (- (* t_1 (exp (* (+ -1.0 eps) x))) (* (- (pow eps -1.0) 1.0) t_0))
         2.0)
        1.1)
     (* (fma t_2 (- (+ 1.0 x) -1.0) (* t_2 x)) 0.5)
     (/ (- (* t_1 (exp (* x eps))) (* -1.0 t_0)) 2.0))))
double code(double x, double eps) {
	double t_0 = exp(((-1.0 - eps) * x));
	double t_1 = 1.0 + pow(eps, -1.0);
	double t_2 = exp(-x);
	double tmp;
	if ((((t_1 * exp(((-1.0 + eps) * x))) - ((pow(eps, -1.0) - 1.0) * t_0)) / 2.0) <= 1.1) {
		tmp = fma(t_2, ((1.0 + x) - -1.0), (t_2 * x)) * 0.5;
	} else {
		tmp = ((t_1 * exp((x * eps))) - (-1.0 * t_0)) / 2.0;
	}
	return tmp;
}
function code(x, eps)
	t_0 = exp(Float64(Float64(-1.0 - eps) * x))
	t_1 = Float64(1.0 + (eps ^ -1.0))
	t_2 = exp(Float64(-x))
	tmp = 0.0
	if (Float64(Float64(Float64(t_1 * exp(Float64(Float64(-1.0 + eps) * x))) - Float64(Float64((eps ^ -1.0) - 1.0) * t_0)) / 2.0) <= 1.1)
		tmp = Float64(fma(t_2, Float64(Float64(1.0 + x) - -1.0), Float64(t_2 * x)) * 0.5);
	else
		tmp = Float64(Float64(Float64(t_1 * exp(Float64(x * eps))) - Float64(-1.0 * t_0)) / 2.0);
	end
	return tmp
end
code[x_, eps_] := Block[{t$95$0 = N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[N[(N[(N[(t$95$1 * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 1.1], N[(N[(t$95$2 * N[(N[(1.0 + x), $MachinePrecision] - -1.0), $MachinePrecision] + N[(t$95$2 * x), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(t$95$1 * N[Exp[N[(x * eps), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(-1.0 * t$95$0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{\left(-1 - \varepsilon\right) \cdot x}\\
t_1 := 1 + {\varepsilon}^{-1}\\
t_2 := e^{-x}\\
\mathbf{if}\;\frac{t\_1 \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot t\_0}{2} \leq 1.1:\\
\;\;\;\;\mathsf{fma}\left(t\_2, \left(1 + x\right) - -1, t\_2 \cdot x\right) \cdot 0.5\\

\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot e^{x \cdot \varepsilon} - -1 \cdot t\_0}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (/.f64 (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) #s(literal 2 binary64)) < 1.1000000000000001

    1. Initial program 54.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. Add Preprocessing
    3. Taylor expanded in eps around inf

      \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \color{blue}{-1} \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
    4. Step-by-step derivation
      1. Applied rewrites50.2%

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)} \]
      3. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right) \cdot \frac{1}{2}} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right) \cdot \frac{1}{2}} \]
      4. Applied rewrites100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(e^{-x}, \left(1 + x\right) - -1, e^{-x} \cdot x\right) \cdot 0.5} \]

      if 1.1000000000000001 < (/.f64 (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) #s(literal 2 binary64))

      1. Initial program 100.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. Add Preprocessing
      3. Taylor expanded in eps around inf

        \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \color{blue}{-1} \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
      4. Step-by-step derivation
        1. Applied rewrites100.0%

          \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \color{blue}{-1} \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
        2. Taylor expanded in eps around inf

          \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\color{blue}{\varepsilon \cdot x}} - -1 \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
        3. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\color{blue}{x \cdot \varepsilon}} - -1 \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
          2. lower-*.f64100.0

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

          \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\color{blue}{x \cdot \varepsilon}} - -1 \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
      5. Recombined 2 regimes into one program.
      6. Final simplification100.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 1.1:\\ \;\;\;\;\mathsf{fma}\left(e^{-x}, \left(1 + x\right) - -1, e^{-x} \cdot x\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{x \cdot \varepsilon} - -1 \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2}\\ \end{array} \]
      7. Add Preprocessing

      Alternative 2: 92.0% accurate, 0.4× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-x}\\ \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\ \;\;\;\;\mathsf{fma}\left(t\_0, \left(1 + x\right) - -1, t\_0 \cdot x\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2}\\ \end{array} \end{array} \]
      (FPCore (x eps)
       :precision binary64
       (let* ((t_0 (exp (- x))))
         (if (<=
              (/
               (-
                (* (+ 1.0 (pow eps -1.0)) (exp (* (+ -1.0 eps) x)))
                (* (- (pow eps -1.0) 1.0) (exp (* (- -1.0 eps) x))))
               2.0)
              2.0)
           (* (fma t_0 (- (+ 1.0 x) -1.0) (* t_0 x)) 0.5)
           (/
            (fma (/ (* (+ eps 1.0) (fma eps eps -1.0)) (+ eps 1.0)) (* x x) 2.0)
            2.0))))
      double code(double x, double eps) {
      	double t_0 = exp(-x);
      	double tmp;
      	if (((((1.0 + pow(eps, -1.0)) * exp(((-1.0 + eps) * x))) - ((pow(eps, -1.0) - 1.0) * exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0) {
      		tmp = fma(t_0, ((1.0 + x) - -1.0), (t_0 * x)) * 0.5;
      	} else {
      		tmp = fma((((eps + 1.0) * fma(eps, eps, -1.0)) / (eps + 1.0)), (x * x), 2.0) / 2.0;
      	}
      	return tmp;
      }
      
      function code(x, eps)
      	t_0 = exp(Float64(-x))
      	tmp = 0.0
      	if (Float64(Float64(Float64(Float64(1.0 + (eps ^ -1.0)) * exp(Float64(Float64(-1.0 + eps) * x))) - Float64(Float64((eps ^ -1.0) - 1.0) * exp(Float64(Float64(-1.0 - eps) * x)))) / 2.0) <= 2.0)
      		tmp = Float64(fma(t_0, Float64(Float64(1.0 + x) - -1.0), Float64(t_0 * x)) * 0.5);
      	else
      		tmp = Float64(fma(Float64(Float64(Float64(eps + 1.0) * fma(eps, eps, -1.0)) / Float64(eps + 1.0)), Float64(x * x), 2.0) / 2.0);
      	end
      	return tmp
      end
      
      code[x_, eps_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 2.0], N[(N[(t$95$0 * N[(N[(1.0 + x), $MachinePrecision] - -1.0), $MachinePrecision] + N[(t$95$0 * x), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(N[(eps + 1.0), $MachinePrecision] * N[(eps * eps + -1.0), $MachinePrecision]), $MachinePrecision] / N[(eps + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := e^{-x}\\
      \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\
      \;\;\;\;\mathsf{fma}\left(t\_0, \left(1 + x\right) - -1, t\_0 \cdot x\right) \cdot 0.5\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (/.f64 (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) #s(literal 2 binary64)) < 2

        1. Initial program 54.3%

          \[\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. Add Preprocessing
        3. Taylor expanded in eps around inf

          \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \color{blue}{-1} \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
        4. Step-by-step derivation
          1. Applied rewrites50.5%

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

            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)} \]
          3. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right) \cdot \frac{1}{2}} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right) \cdot \frac{1}{2}} \]
          4. Applied rewrites99.4%

            \[\leadsto \color{blue}{\mathsf{fma}\left(e^{-x}, \left(1 + x\right) - -1, e^{-x} \cdot x\right) \cdot 0.5} \]

          if 2 < (/.f64 (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) #s(literal 2 binary64))

          1. Initial program 100.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. Add Preprocessing
          3. Taylor expanded in eps around 0

            \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
          4. Applied rewrites11.8%

            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
          5. Taylor expanded in x around 0

            \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
          6. Step-by-step derivation
            1. Applied rewrites79.8%

              \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
            2. Step-by-step derivation
              1. Applied rewrites85.6%

                \[\leadsto \frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2} \]
            3. Recombined 2 regimes into one program.
            4. Final simplification93.3%

              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\ \;\;\;\;\mathsf{fma}\left(e^{-x}, \left(1 + x\right) - -1, e^{-x} \cdot x\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2}\\ \end{array} \]
            5. Add Preprocessing

            Alternative 3: 78.2% accurate, 0.6× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\ \end{array} \end{array} \]
            (FPCore (x eps)
             :precision binary64
             (if (<=
                  (/
                   (-
                    (* (+ 1.0 (pow eps -1.0)) (exp (* (+ -1.0 eps) x)))
                    (* (- (pow eps -1.0) 1.0) (exp (* (- -1.0 eps) x))))
                   2.0)
                  2.0)
               1.0
               (/ (* (* (* eps eps) x) x) 2.0)))
            double code(double x, double eps) {
            	double tmp;
            	if (((((1.0 + pow(eps, -1.0)) * exp(((-1.0 + eps) * x))) - ((pow(eps, -1.0) - 1.0) * exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0) {
            		tmp = 1.0;
            	} else {
            		tmp = (((eps * eps) * x) * x) / 2.0;
            	}
            	return tmp;
            }
            
            module fmin_fmax_functions
                implicit none
                private
                public fmax
                public fmin
            
                interface fmax
                    module procedure fmax88
                    module procedure fmax44
                    module procedure fmax84
                    module procedure fmax48
                end interface
                interface fmin
                    module procedure fmin88
                    module procedure fmin44
                    module procedure fmin84
                    module procedure fmin48
                end interface
            contains
                real(8) function fmax88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(4) function fmax44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                end function
                real(8) function fmax84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmax48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                end function
                real(8) function fmin88(x, y) result (res)
                    real(8), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(4) function fmin44(x, y) result (res)
                    real(4), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                end function
                real(8) function fmin84(x, y) result(res)
                    real(8), intent (in) :: x
                    real(4), intent (in) :: y
                    res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                end function
                real(8) function fmin48(x, y) result(res)
                    real(4), intent (in) :: x
                    real(8), intent (in) :: y
                    res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                end function
            end module
            
            real(8) function code(x, eps)
            use fmin_fmax_functions
                real(8), intent (in) :: x
                real(8), intent (in) :: eps
                real(8) :: tmp
                if (((((1.0d0 + (eps ** (-1.0d0))) * exp((((-1.0d0) + eps) * x))) - (((eps ** (-1.0d0)) - 1.0d0) * exp((((-1.0d0) - eps) * x)))) / 2.0d0) <= 2.0d0) then
                    tmp = 1.0d0
                else
                    tmp = (((eps * eps) * x) * x) / 2.0d0
                end if
                code = tmp
            end function
            
            public static double code(double x, double eps) {
            	double tmp;
            	if (((((1.0 + Math.pow(eps, -1.0)) * Math.exp(((-1.0 + eps) * x))) - ((Math.pow(eps, -1.0) - 1.0) * Math.exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0) {
            		tmp = 1.0;
            	} else {
            		tmp = (((eps * eps) * x) * x) / 2.0;
            	}
            	return tmp;
            }
            
            def code(x, eps):
            	tmp = 0
            	if ((((1.0 + math.pow(eps, -1.0)) * math.exp(((-1.0 + eps) * x))) - ((math.pow(eps, -1.0) - 1.0) * math.exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0:
            		tmp = 1.0
            	else:
            		tmp = (((eps * eps) * x) * x) / 2.0
            	return tmp
            
            function code(x, eps)
            	tmp = 0.0
            	if (Float64(Float64(Float64(Float64(1.0 + (eps ^ -1.0)) * exp(Float64(Float64(-1.0 + eps) * x))) - Float64(Float64((eps ^ -1.0) - 1.0) * exp(Float64(Float64(-1.0 - eps) * x)))) / 2.0) <= 2.0)
            		tmp = 1.0;
            	else
            		tmp = Float64(Float64(Float64(Float64(eps * eps) * x) * x) / 2.0);
            	end
            	return tmp
            end
            
            function tmp_2 = code(x, eps)
            	tmp = 0.0;
            	if (((((1.0 + (eps ^ -1.0)) * exp(((-1.0 + eps) * x))) - (((eps ^ -1.0) - 1.0) * exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0)
            		tmp = 1.0;
            	else
            		tmp = (((eps * eps) * x) * x) / 2.0;
            	end
            	tmp_2 = tmp;
            end
            
            code[x_, eps_] := If[LessEqual[N[(N[(N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 2.0], 1.0, N[(N[(N[(N[(eps * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] / 2.0), $MachinePrecision]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\
            \;\;\;\;1\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (/.f64 (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) #s(literal 2 binary64)) < 2

              1. Initial program 54.3%

                \[\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. Add Preprocessing
              3. Taylor expanded in x around 0

                \[\leadsto \color{blue}{1} \]
              4. Step-by-step derivation
                1. Applied rewrites73.7%

                  \[\leadsto \color{blue}{1} \]

                if 2 < (/.f64 (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) #s(literal 2 binary64))

                1. Initial program 100.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. Add Preprocessing
                3. Taylor expanded in eps around 0

                  \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                4. Applied rewrites11.8%

                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                5. Taylor expanded in x around 0

                  \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                6. Step-by-step derivation
                  1. Applied rewrites79.8%

                    \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                  2. Taylor expanded in eps around inf

                    \[\leadsto \frac{{\varepsilon}^{2} \cdot {x}^{\color{blue}{2}}}{2} \]
                  3. Step-by-step derivation
                    1. Applied rewrites84.2%

                      \[\leadsto \frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2} \]
                  4. Recombined 2 regimes into one program.
                  5. Final simplification78.4%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 4: 71.7% accurate, 0.6× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \varepsilon\right)}{2}\\ \end{array} \end{array} \]
                  (FPCore (x eps)
                   :precision binary64
                   (if (<=
                        (/
                         (-
                          (* (+ 1.0 (pow eps -1.0)) (exp (* (+ -1.0 eps) x)))
                          (* (- (pow eps -1.0) 1.0) (exp (* (- -1.0 eps) x))))
                         2.0)
                        2.0)
                     1.0
                     (/ (* (* x eps) (* x eps)) 2.0)))
                  double code(double x, double eps) {
                  	double tmp;
                  	if (((((1.0 + pow(eps, -1.0)) * exp(((-1.0 + eps) * x))) - ((pow(eps, -1.0) - 1.0) * exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0) {
                  		tmp = 1.0;
                  	} else {
                  		tmp = ((x * eps) * (x * eps)) / 2.0;
                  	}
                  	return tmp;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, eps)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: eps
                      real(8) :: tmp
                      if (((((1.0d0 + (eps ** (-1.0d0))) * exp((((-1.0d0) + eps) * x))) - (((eps ** (-1.0d0)) - 1.0d0) * exp((((-1.0d0) - eps) * x)))) / 2.0d0) <= 2.0d0) then
                          tmp = 1.0d0
                      else
                          tmp = ((x * eps) * (x * eps)) / 2.0d0
                      end if
                      code = tmp
                  end function
                  
                  public static double code(double x, double eps) {
                  	double tmp;
                  	if (((((1.0 + Math.pow(eps, -1.0)) * Math.exp(((-1.0 + eps) * x))) - ((Math.pow(eps, -1.0) - 1.0) * Math.exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0) {
                  		tmp = 1.0;
                  	} else {
                  		tmp = ((x * eps) * (x * eps)) / 2.0;
                  	}
                  	return tmp;
                  }
                  
                  def code(x, eps):
                  	tmp = 0
                  	if ((((1.0 + math.pow(eps, -1.0)) * math.exp(((-1.0 + eps) * x))) - ((math.pow(eps, -1.0) - 1.0) * math.exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0:
                  		tmp = 1.0
                  	else:
                  		tmp = ((x * eps) * (x * eps)) / 2.0
                  	return tmp
                  
                  function code(x, eps)
                  	tmp = 0.0
                  	if (Float64(Float64(Float64(Float64(1.0 + (eps ^ -1.0)) * exp(Float64(Float64(-1.0 + eps) * x))) - Float64(Float64((eps ^ -1.0) - 1.0) * exp(Float64(Float64(-1.0 - eps) * x)))) / 2.0) <= 2.0)
                  		tmp = 1.0;
                  	else
                  		tmp = Float64(Float64(Float64(x * eps) * Float64(x * eps)) / 2.0);
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(x, eps)
                  	tmp = 0.0;
                  	if (((((1.0 + (eps ^ -1.0)) * exp(((-1.0 + eps) * x))) - (((eps ^ -1.0) - 1.0) * exp(((-1.0 - eps) * x)))) / 2.0) <= 2.0)
                  		tmp = 1.0;
                  	else
                  		tmp = ((x * eps) * (x * eps)) / 2.0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[x_, eps_] := If[LessEqual[N[(N[(N[(N[(1.0 + N[Power[eps, -1.0], $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(-1.0 + eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[Power[eps, -1.0], $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[N[(N[(-1.0 - eps), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 2.0], 1.0, N[(N[(N[(x * eps), $MachinePrecision] * N[(x * eps), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\
                  \;\;\;\;1\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \varepsilon\right)}{2}\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if (/.f64 (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) #s(literal 2 binary64)) < 2

                    1. Initial program 54.3%

                      \[\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. Add Preprocessing
                    3. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{1} \]
                    4. Step-by-step derivation
                      1. Applied rewrites73.7%

                        \[\leadsto \color{blue}{1} \]

                      if 2 < (/.f64 (-.f64 (*.f64 (+.f64 #s(literal 1 binary64) (/.f64 #s(literal 1 binary64) eps)) (exp.f64 (neg.f64 (*.f64 (-.f64 #s(literal 1 binary64) eps) x)))) (*.f64 (-.f64 (/.f64 #s(literal 1 binary64) eps) #s(literal 1 binary64)) (exp.f64 (neg.f64 (*.f64 (+.f64 #s(literal 1 binary64) eps) x))))) #s(literal 2 binary64))

                      1. Initial program 100.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. Add Preprocessing
                      3. Taylor expanded in eps around 0

                        \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                      4. Applied rewrites11.8%

                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                      5. Taylor expanded in x around 0

                        \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                      6. Step-by-step derivation
                        1. Applied rewrites79.8%

                          \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                        2. Step-by-step derivation
                          1. Applied rewrites84.2%

                            \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, \varepsilon, -1\right) \cdot x, x, 2\right)}{2} \]
                          2. Taylor expanded in eps around inf

                            \[\leadsto \frac{{\varepsilon}^{2} \cdot {x}^{\color{blue}{2}}}{2} \]
                          3. Step-by-step derivation
                            1. Applied rewrites75.0%

                              \[\leadsto \frac{\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \color{blue}{\varepsilon}\right)}{2} \]
                          4. Recombined 2 regimes into one program.
                          5. Final simplification74.3%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{\left(1 + {\varepsilon}^{-1}\right) \cdot e^{\left(-1 + \varepsilon\right) \cdot x} - \left({\varepsilon}^{-1} - 1\right) \cdot e^{\left(-1 - \varepsilon\right) \cdot x}}{2} \leq 2:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(x \cdot \varepsilon\right) \cdot \left(x \cdot \varepsilon\right)}{2}\\ \end{array} \]
                          6. Add Preprocessing

                          Alternative 5: 84.9% accurate, 1.3× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(0.08333333333333333, \varepsilon \cdot \varepsilon, 0.16666666666666666\right)\\ \mathbf{if}\;x \leq -2.35 \cdot 10^{-132}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t\_0 \cdot \left(\varepsilon \cdot \varepsilon\right) - 0.25, x, \mathsf{fma}\left(-0.6666666666666666, \varepsilon \cdot \varepsilon, 0.6666666666666666\right)\right), x, \varepsilon \cdot \varepsilon - 1\right), x \cdot x, 2\right)}{2}\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{-156}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - 1, 2\right)}{2}\\ \mathbf{elif}\;x \leq 125000000000:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x \cdot t\_0 - 0.6666666666666666, \varepsilon \cdot \varepsilon, \mathsf{fma}\left(-0.125, x, 0.3333333333333333\right)\right), x, \varepsilon \cdot \varepsilon - 0.5\right), x \cdot x, 1\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\ \end{array} \end{array} \]
                          (FPCore (x eps)
                           :precision binary64
                           (let* ((t_0 (fma 0.08333333333333333 (* eps eps) 0.16666666666666666)))
                             (if (<= x -2.35e-132)
                               (/
                                (fma
                                 (fma
                                  (fma
                                   (- (* t_0 (* eps eps)) 0.25)
                                   x
                                   (fma -0.6666666666666666 (* eps eps) 0.6666666666666666))
                                  x
                                  (- (* eps eps) 1.0))
                                 (* x x)
                                 2.0)
                                2.0)
                               (if (<= x 1.02e-156)
                                 (/ (fma (* (* x x) (+ eps 1.0)) (- eps 1.0) 2.0) 2.0)
                                 (if (<= x 125000000000.0)
                                   (/
                                    (-
                                     (fma
                                      (fma
                                       (fma
                                        (- (* x t_0) 0.6666666666666666)
                                        (* eps eps)
                                        (fma -0.125 x 0.3333333333333333))
                                       x
                                       (- (* eps eps) 0.5))
                                      (* x x)
                                      1.0)
                                     (/ (fma -1.0 x -1.0) (exp x)))
                                    2.0)
                                   (/ (* (* (* eps eps) x) x) 2.0))))))
                          double code(double x, double eps) {
                          	double t_0 = fma(0.08333333333333333, (eps * eps), 0.16666666666666666);
                          	double tmp;
                          	if (x <= -2.35e-132) {
                          		tmp = fma(fma(fma(((t_0 * (eps * eps)) - 0.25), x, fma(-0.6666666666666666, (eps * eps), 0.6666666666666666)), x, ((eps * eps) - 1.0)), (x * x), 2.0) / 2.0;
                          	} else if (x <= 1.02e-156) {
                          		tmp = fma(((x * x) * (eps + 1.0)), (eps - 1.0), 2.0) / 2.0;
                          	} else if (x <= 125000000000.0) {
                          		tmp = (fma(fma(fma(((x * t_0) - 0.6666666666666666), (eps * eps), fma(-0.125, x, 0.3333333333333333)), x, ((eps * eps) - 0.5)), (x * x), 1.0) - (fma(-1.0, x, -1.0) / exp(x))) / 2.0;
                          	} else {
                          		tmp = (((eps * eps) * x) * x) / 2.0;
                          	}
                          	return tmp;
                          }
                          
                          function code(x, eps)
                          	t_0 = fma(0.08333333333333333, Float64(eps * eps), 0.16666666666666666)
                          	tmp = 0.0
                          	if (x <= -2.35e-132)
                          		tmp = Float64(fma(fma(fma(Float64(Float64(t_0 * Float64(eps * eps)) - 0.25), x, fma(-0.6666666666666666, Float64(eps * eps), 0.6666666666666666)), x, Float64(Float64(eps * eps) - 1.0)), Float64(x * x), 2.0) / 2.0);
                          	elseif (x <= 1.02e-156)
                          		tmp = Float64(fma(Float64(Float64(x * x) * Float64(eps + 1.0)), Float64(eps - 1.0), 2.0) / 2.0);
                          	elseif (x <= 125000000000.0)
                          		tmp = Float64(Float64(fma(fma(fma(Float64(Float64(x * t_0) - 0.6666666666666666), Float64(eps * eps), fma(-0.125, x, 0.3333333333333333)), x, Float64(Float64(eps * eps) - 0.5)), Float64(x * x), 1.0) - Float64(fma(-1.0, x, -1.0) / exp(x))) / 2.0);
                          	else
                          		tmp = Float64(Float64(Float64(Float64(eps * eps) * x) * x) / 2.0);
                          	end
                          	return tmp
                          end
                          
                          code[x_, eps_] := Block[{t$95$0 = N[(0.08333333333333333 * N[(eps * eps), $MachinePrecision] + 0.16666666666666666), $MachinePrecision]}, If[LessEqual[x, -2.35e-132], N[(N[(N[(N[(N[(N[(t$95$0 * N[(eps * eps), $MachinePrecision]), $MachinePrecision] - 0.25), $MachinePrecision] * x + N[(-0.6666666666666666 * N[(eps * eps), $MachinePrecision] + 0.6666666666666666), $MachinePrecision]), $MachinePrecision] * x + N[(N[(eps * eps), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.02e-156], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(eps + 1.0), $MachinePrecision]), $MachinePrecision] * N[(eps - 1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 125000000000.0], N[(N[(N[(N[(N[(N[(N[(x * t$95$0), $MachinePrecision] - 0.6666666666666666), $MachinePrecision] * N[(eps * eps), $MachinePrecision] + N[(-0.125 * x + 0.3333333333333333), $MachinePrecision]), $MachinePrecision] * x + N[(N[(eps * eps), $MachinePrecision] - 0.5), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision] - N[(N[(-1.0 * x + -1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(eps * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] / 2.0), $MachinePrecision]]]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_0 := \mathsf{fma}\left(0.08333333333333333, \varepsilon \cdot \varepsilon, 0.16666666666666666\right)\\
                          \mathbf{if}\;x \leq -2.35 \cdot 10^{-132}:\\
                          \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(t\_0 \cdot \left(\varepsilon \cdot \varepsilon\right) - 0.25, x, \mathsf{fma}\left(-0.6666666666666666, \varepsilon \cdot \varepsilon, 0.6666666666666666\right)\right), x, \varepsilon \cdot \varepsilon - 1\right), x \cdot x, 2\right)}{2}\\
                          
                          \mathbf{elif}\;x \leq 1.02 \cdot 10^{-156}:\\
                          \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - 1, 2\right)}{2}\\
                          
                          \mathbf{elif}\;x \leq 125000000000:\\
                          \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x \cdot t\_0 - 0.6666666666666666, \varepsilon \cdot \varepsilon, \mathsf{fma}\left(-0.125, x, 0.3333333333333333\right)\right), x, \varepsilon \cdot \varepsilon - 0.5\right), x \cdot x, 1\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}{2}\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 4 regimes
                          2. if x < -2.3500000000000001e-132

                            1. Initial program 79.8%

                              \[\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. Add Preprocessing
                            3. Taylor expanded in eps around 0

                              \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                            4. Applied rewrites29.2%

                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                            5. Taylor expanded in x around 0

                              \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left(\left(x \cdot \left(\frac{2}{3} + \left(\frac{-2}{3} \cdot {\varepsilon}^{2} + x \cdot \left({\varepsilon}^{2} \cdot \left(\frac{1}{6} + \frac{1}{12} \cdot {\varepsilon}^{2}\right) - \frac{1}{4}\right)\right)\right) + {\varepsilon}^{2}\right) - 1\right)}}{2} \]
                            6. Step-by-step derivation
                              1. Applied rewrites95.3%

                                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.08333333333333333, \varepsilon \cdot \varepsilon, 0.16666666666666666\right) \cdot \left(\varepsilon \cdot \varepsilon\right) - 0.25, x, \mathsf{fma}\left(-0.6666666666666666, \varepsilon \cdot \varepsilon, 0.6666666666666666\right)\right), x, \varepsilon \cdot \varepsilon - 1\right), \color{blue}{x \cdot x}, 2\right)}{2} \]

                              if -2.3500000000000001e-132 < x < 1.02e-156

                              1. Initial program 51.6%

                                \[\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. Add Preprocessing
                              3. Taylor expanded in eps around 0

                                \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                              4. Applied rewrites76.4%

                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                              5. Taylor expanded in x around 0

                                \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                              6. Step-by-step derivation
                                1. Applied rewrites79.2%

                                  \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                2. Step-by-step derivation
                                  1. Applied rewrites92.0%

                                    \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - \color{blue}{1}, 2\right)}{2} \]

                                  if 1.02e-156 < x < 1.25e11

                                  1. Initial program 63.4%

                                    \[\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. Add Preprocessing
                                  3. Taylor expanded in eps around 0

                                    \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                  4. Applied rewrites76.0%

                                    \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                  5. Taylor expanded in x around 0

                                    \[\leadsto \frac{\left(1 + {x}^{2} \cdot \left(\left(x \cdot \left(\frac{1}{3} + \left(\frac{-2}{3} \cdot {\varepsilon}^{2} + x \cdot \left({\varepsilon}^{2} \cdot \left(\frac{1}{6} + \frac{1}{12} \cdot {\varepsilon}^{2}\right) - \frac{1}{8}\right)\right)\right) + {\varepsilon}^{2}\right) - \frac{1}{2}\right)\right) - \frac{\color{blue}{\mathsf{fma}\left(-1, x, -1\right)}}{e^{x}}}{2} \]
                                  6. Step-by-step derivation
                                    1. Applied rewrites60.0%

                                      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.08333333333333333, \varepsilon \cdot \varepsilon, 0.16666666666666666\right) \cdot \left(\varepsilon \cdot \varepsilon\right) - 0.125, x, \mathsf{fma}\left(-0.6666666666666666, \varepsilon \cdot \varepsilon, 0.3333333333333333\right)\right), x, \varepsilon \cdot \varepsilon - 0.5\right), x \cdot x, 1\right) - \frac{\color{blue}{\mathsf{fma}\left(-1, x, -1\right)}}{e^{x}}}{2} \]
                                    2. Taylor expanded in eps around 0

                                      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{3} + \left(\frac{-1}{8} \cdot x + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{12} \cdot \left({\varepsilon}^{2} \cdot x\right) + \frac{1}{6} \cdot x\right) - \frac{2}{3}\right)\right), x, \varepsilon \cdot \varepsilon - \frac{1}{2}\right), x \cdot x, 1\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}{2} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites93.3%

                                        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x \cdot \mathsf{fma}\left(0.08333333333333333, \varepsilon \cdot \varepsilon, 0.16666666666666666\right) - 0.6666666666666666, \varepsilon \cdot \varepsilon, \mathsf{fma}\left(-0.125, x, 0.3333333333333333\right)\right), x, \varepsilon \cdot \varepsilon - 0.5\right), x \cdot x, 1\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}{2} \]

                                      if 1.25e11 < x

                                      1. Initial program 100.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. Add Preprocessing
                                      3. Taylor expanded in eps around 0

                                        \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                      4. Applied rewrites8.4%

                                        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                      5. Taylor expanded in x around 0

                                        \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                      6. Step-by-step derivation
                                        1. Applied rewrites47.0%

                                          \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                        2. Taylor expanded in eps around inf

                                          \[\leadsto \frac{{\varepsilon}^{2} \cdot {x}^{\color{blue}{2}}}{2} \]
                                        3. Step-by-step derivation
                                          1. Applied rewrites67.7%

                                            \[\leadsto \frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2} \]
                                        4. Recombined 4 regimes into one program.
                                        5. Add Preprocessing

                                        Alternative 6: 84.7% accurate, 3.2× speedup?

                                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -2.35 \cdot 10^{-132}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.08333333333333333, \varepsilon \cdot \varepsilon, 0.16666666666666666\right) \cdot \left(\varepsilon \cdot \varepsilon\right) - 0.25, x, \mathsf{fma}\left(-0.6666666666666666, \varepsilon \cdot \varepsilon, 0.6666666666666666\right)\right), x, \varepsilon \cdot \varepsilon - 1\right), x \cdot x, 2\right)}{2}\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{-156}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - 1, 2\right)}{2}\\ \mathbf{elif}\;x \leq 38:\\ \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\ \end{array} \end{array} \]
                                        (FPCore (x eps)
                                         :precision binary64
                                         (if (<= x -2.35e-132)
                                           (/
                                            (fma
                                             (fma
                                              (fma
                                               (-
                                                (*
                                                 (fma 0.08333333333333333 (* eps eps) 0.16666666666666666)
                                                 (* eps eps))
                                                0.25)
                                               x
                                               (fma -0.6666666666666666 (* eps eps) 0.6666666666666666))
                                              x
                                              (- (* eps eps) 1.0))
                                             (* x x)
                                             2.0)
                                            2.0)
                                           (if (<= x 1.02e-156)
                                             (/ (fma (* (* x x) (+ eps 1.0)) (- eps 1.0) 2.0) 2.0)
                                             (if (<= x 38.0)
                                               (/
                                                (fma (/ (* (+ eps 1.0) (fma eps eps -1.0)) (+ eps 1.0)) (* x x) 2.0)
                                                2.0)
                                               (/ (* (* (* eps eps) x) x) 2.0)))))
                                        double code(double x, double eps) {
                                        	double tmp;
                                        	if (x <= -2.35e-132) {
                                        		tmp = fma(fma(fma(((fma(0.08333333333333333, (eps * eps), 0.16666666666666666) * (eps * eps)) - 0.25), x, fma(-0.6666666666666666, (eps * eps), 0.6666666666666666)), x, ((eps * eps) - 1.0)), (x * x), 2.0) / 2.0;
                                        	} else if (x <= 1.02e-156) {
                                        		tmp = fma(((x * x) * (eps + 1.0)), (eps - 1.0), 2.0) / 2.0;
                                        	} else if (x <= 38.0) {
                                        		tmp = fma((((eps + 1.0) * fma(eps, eps, -1.0)) / (eps + 1.0)), (x * x), 2.0) / 2.0;
                                        	} else {
                                        		tmp = (((eps * eps) * x) * x) / 2.0;
                                        	}
                                        	return tmp;
                                        }
                                        
                                        function code(x, eps)
                                        	tmp = 0.0
                                        	if (x <= -2.35e-132)
                                        		tmp = Float64(fma(fma(fma(Float64(Float64(fma(0.08333333333333333, Float64(eps * eps), 0.16666666666666666) * Float64(eps * eps)) - 0.25), x, fma(-0.6666666666666666, Float64(eps * eps), 0.6666666666666666)), x, Float64(Float64(eps * eps) - 1.0)), Float64(x * x), 2.0) / 2.0);
                                        	elseif (x <= 1.02e-156)
                                        		tmp = Float64(fma(Float64(Float64(x * x) * Float64(eps + 1.0)), Float64(eps - 1.0), 2.0) / 2.0);
                                        	elseif (x <= 38.0)
                                        		tmp = Float64(fma(Float64(Float64(Float64(eps + 1.0) * fma(eps, eps, -1.0)) / Float64(eps + 1.0)), Float64(x * x), 2.0) / 2.0);
                                        	else
                                        		tmp = Float64(Float64(Float64(Float64(eps * eps) * x) * x) / 2.0);
                                        	end
                                        	return tmp
                                        end
                                        
                                        code[x_, eps_] := If[LessEqual[x, -2.35e-132], N[(N[(N[(N[(N[(N[(N[(0.08333333333333333 * N[(eps * eps), $MachinePrecision] + 0.16666666666666666), $MachinePrecision] * N[(eps * eps), $MachinePrecision]), $MachinePrecision] - 0.25), $MachinePrecision] * x + N[(-0.6666666666666666 * N[(eps * eps), $MachinePrecision] + 0.6666666666666666), $MachinePrecision]), $MachinePrecision] * x + N[(N[(eps * eps), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.02e-156], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(eps + 1.0), $MachinePrecision]), $MachinePrecision] * N[(eps - 1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 38.0], N[(N[(N[(N[(N[(eps + 1.0), $MachinePrecision] * N[(eps * eps + -1.0), $MachinePrecision]), $MachinePrecision] / N[(eps + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(eps * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] / 2.0), $MachinePrecision]]]]
                                        
                                        \begin{array}{l}
                                        
                                        \\
                                        \begin{array}{l}
                                        \mathbf{if}\;x \leq -2.35 \cdot 10^{-132}:\\
                                        \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.08333333333333333, \varepsilon \cdot \varepsilon, 0.16666666666666666\right) \cdot \left(\varepsilon \cdot \varepsilon\right) - 0.25, x, \mathsf{fma}\left(-0.6666666666666666, \varepsilon \cdot \varepsilon, 0.6666666666666666\right)\right), x, \varepsilon \cdot \varepsilon - 1\right), x \cdot x, 2\right)}{2}\\
                                        
                                        \mathbf{elif}\;x \leq 1.02 \cdot 10^{-156}:\\
                                        \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - 1, 2\right)}{2}\\
                                        
                                        \mathbf{elif}\;x \leq 38:\\
                                        \;\;\;\;\frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2}\\
                                        
                                        \mathbf{else}:\\
                                        \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\
                                        
                                        
                                        \end{array}
                                        \end{array}
                                        
                                        Derivation
                                        1. Split input into 4 regimes
                                        2. if x < -2.3500000000000001e-132

                                          1. Initial program 79.8%

                                            \[\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. Add Preprocessing
                                          3. Taylor expanded in eps around 0

                                            \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                          4. Applied rewrites29.2%

                                            \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                          5. Taylor expanded in x around 0

                                            \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left(\left(x \cdot \left(\frac{2}{3} + \left(\frac{-2}{3} \cdot {\varepsilon}^{2} + x \cdot \left({\varepsilon}^{2} \cdot \left(\frac{1}{6} + \frac{1}{12} \cdot {\varepsilon}^{2}\right) - \frac{1}{4}\right)\right)\right) + {\varepsilon}^{2}\right) - 1\right)}}{2} \]
                                          6. Step-by-step derivation
                                            1. Applied rewrites95.3%

                                              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.08333333333333333, \varepsilon \cdot \varepsilon, 0.16666666666666666\right) \cdot \left(\varepsilon \cdot \varepsilon\right) - 0.25, x, \mathsf{fma}\left(-0.6666666666666666, \varepsilon \cdot \varepsilon, 0.6666666666666666\right)\right), x, \varepsilon \cdot \varepsilon - 1\right), \color{blue}{x \cdot x}, 2\right)}{2} \]

                                            if -2.3500000000000001e-132 < x < 1.02e-156

                                            1. Initial program 51.6%

                                              \[\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. Add Preprocessing
                                            3. Taylor expanded in eps around 0

                                              \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                            4. Applied rewrites76.4%

                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                            5. Taylor expanded in x around 0

                                              \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                            6. Step-by-step derivation
                                              1. Applied rewrites79.2%

                                                \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                              2. Step-by-step derivation
                                                1. Applied rewrites92.0%

                                                  \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - \color{blue}{1}, 2\right)}{2} \]

                                                if 1.02e-156 < x < 38

                                                1. Initial program 61.7%

                                                  \[\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. Add Preprocessing
                                                3. Taylor expanded in eps around 0

                                                  \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                4. Applied rewrites79.4%

                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                5. Taylor expanded in x around 0

                                                  \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites88.0%

                                                    \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                  2. Step-by-step derivation
                                                    1. Applied rewrites94.5%

                                                      \[\leadsto \frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2} \]

                                                    if 38 < x

                                                    1. Initial program 100.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. Add Preprocessing
                                                    3. Taylor expanded in eps around 0

                                                      \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                    4. Applied rewrites8.2%

                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                    5. Taylor expanded in x around 0

                                                      \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                    6. Step-by-step derivation
                                                      1. Applied rewrites45.9%

                                                        \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                      2. Taylor expanded in eps around inf

                                                        \[\leadsto \frac{{\varepsilon}^{2} \cdot {x}^{\color{blue}{2}}}{2} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites66.0%

                                                          \[\leadsto \frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2} \]
                                                      4. Recombined 4 regimes into one program.
                                                      5. Add Preprocessing

                                                      Alternative 7: 83.2% accurate, 4.0× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2}\\ \mathbf{if}\;x \leq -2.3 \cdot 10^{-132}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{-156}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - 1, 2\right)}{2}\\ \mathbf{elif}\;x \leq 38:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\ \end{array} \end{array} \]
                                                      (FPCore (x eps)
                                                       :precision binary64
                                                       (let* ((t_0
                                                               (/
                                                                (fma (/ (* (+ eps 1.0) (fma eps eps -1.0)) (+ eps 1.0)) (* x x) 2.0)
                                                                2.0)))
                                                         (if (<= x -2.3e-132)
                                                           t_0
                                                           (if (<= x 1.02e-156)
                                                             (/ (fma (* (* x x) (+ eps 1.0)) (- eps 1.0) 2.0) 2.0)
                                                             (if (<= x 38.0) t_0 (/ (* (* (* eps eps) x) x) 2.0))))))
                                                      double code(double x, double eps) {
                                                      	double t_0 = fma((((eps + 1.0) * fma(eps, eps, -1.0)) / (eps + 1.0)), (x * x), 2.0) / 2.0;
                                                      	double tmp;
                                                      	if (x <= -2.3e-132) {
                                                      		tmp = t_0;
                                                      	} else if (x <= 1.02e-156) {
                                                      		tmp = fma(((x * x) * (eps + 1.0)), (eps - 1.0), 2.0) / 2.0;
                                                      	} else if (x <= 38.0) {
                                                      		tmp = t_0;
                                                      	} else {
                                                      		tmp = (((eps * eps) * x) * x) / 2.0;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      function code(x, eps)
                                                      	t_0 = Float64(fma(Float64(Float64(Float64(eps + 1.0) * fma(eps, eps, -1.0)) / Float64(eps + 1.0)), Float64(x * x), 2.0) / 2.0)
                                                      	tmp = 0.0
                                                      	if (x <= -2.3e-132)
                                                      		tmp = t_0;
                                                      	elseif (x <= 1.02e-156)
                                                      		tmp = Float64(fma(Float64(Float64(x * x) * Float64(eps + 1.0)), Float64(eps - 1.0), 2.0) / 2.0);
                                                      	elseif (x <= 38.0)
                                                      		tmp = t_0;
                                                      	else
                                                      		tmp = Float64(Float64(Float64(Float64(eps * eps) * x) * x) / 2.0);
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      code[x_, eps_] := Block[{t$95$0 = N[(N[(N[(N[(N[(eps + 1.0), $MachinePrecision] * N[(eps * eps + -1.0), $MachinePrecision]), $MachinePrecision] / N[(eps + 1.0), $MachinePrecision]), $MachinePrecision] * N[(x * x), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision]}, If[LessEqual[x, -2.3e-132], t$95$0, If[LessEqual[x, 1.02e-156], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(eps + 1.0), $MachinePrecision]), $MachinePrecision] * N[(eps - 1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 38.0], t$95$0, N[(N[(N[(N[(eps * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] / 2.0), $MachinePrecision]]]]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      t_0 := \frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2}\\
                                                      \mathbf{if}\;x \leq -2.3 \cdot 10^{-132}:\\
                                                      \;\;\;\;t\_0\\
                                                      
                                                      \mathbf{elif}\;x \leq 1.02 \cdot 10^{-156}:\\
                                                      \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - 1, 2\right)}{2}\\
                                                      
                                                      \mathbf{elif}\;x \leq 38:\\
                                                      \;\;\;\;t\_0\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 3 regimes
                                                      2. if x < -2.30000000000000003e-132 or 1.02e-156 < x < 38

                                                        1. Initial program 72.7%

                                                          \[\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. Add Preprocessing
                                                        3. Taylor expanded in eps around 0

                                                          \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                        4. Applied rewrites48.8%

                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                        5. Taylor expanded in x around 0

                                                          \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                        6. Step-by-step derivation
                                                          1. Applied rewrites86.1%

                                                            \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                          2. Step-by-step derivation
                                                            1. Applied rewrites91.8%

                                                              \[\leadsto \frac{\mathsf{fma}\left(\frac{\left(\varepsilon + 1\right) \cdot \mathsf{fma}\left(\varepsilon, \varepsilon, -1\right)}{\varepsilon + 1}, x \cdot x, 2\right)}{2} \]

                                                            if -2.30000000000000003e-132 < x < 1.02e-156

                                                            1. Initial program 51.6%

                                                              \[\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. Add Preprocessing
                                                            3. Taylor expanded in eps around 0

                                                              \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                            4. Applied rewrites76.4%

                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                            5. Taylor expanded in x around 0

                                                              \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                            6. Step-by-step derivation
                                                              1. Applied rewrites79.2%

                                                                \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                              2. Step-by-step derivation
                                                                1. Applied rewrites92.0%

                                                                  \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - \color{blue}{1}, 2\right)}{2} \]

                                                                if 38 < x

                                                                1. Initial program 100.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. Add Preprocessing
                                                                3. Taylor expanded in eps around 0

                                                                  \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                                4. Applied rewrites8.2%

                                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                                5. Taylor expanded in x around 0

                                                                  \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                                6. Step-by-step derivation
                                                                  1. Applied rewrites45.9%

                                                                    \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                                  2. Taylor expanded in eps around inf

                                                                    \[\leadsto \frac{{\varepsilon}^{2} \cdot {x}^{\color{blue}{2}}}{2} \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites66.0%

                                                                      \[\leadsto \frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2} \]
                                                                  4. Recombined 3 regimes into one program.
                                                                  5. Add Preprocessing

                                                                  Alternative 8: 80.9% accurate, 6.7× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 5 \cdot 10^{-231}:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - 1, 2\right)}{2}\\ \mathbf{elif}\;x \leq 1.4:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, \varepsilon, -1\right) \cdot x, x, 2\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\ \end{array} \end{array} \]
                                                                  (FPCore (x eps)
                                                                   :precision binary64
                                                                   (if (<= x 5e-231)
                                                                     (/ (fma (* (* x x) (+ eps 1.0)) (- eps 1.0) 2.0) 2.0)
                                                                     (if (<= x 1.4)
                                                                       (/ (fma (* (fma eps eps -1.0) x) x 2.0) 2.0)
                                                                       (/ (* (* (* eps eps) x) x) 2.0))))
                                                                  double code(double x, double eps) {
                                                                  	double tmp;
                                                                  	if (x <= 5e-231) {
                                                                  		tmp = fma(((x * x) * (eps + 1.0)), (eps - 1.0), 2.0) / 2.0;
                                                                  	} else if (x <= 1.4) {
                                                                  		tmp = fma((fma(eps, eps, -1.0) * x), x, 2.0) / 2.0;
                                                                  	} else {
                                                                  		tmp = (((eps * eps) * x) * x) / 2.0;
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  function code(x, eps)
                                                                  	tmp = 0.0
                                                                  	if (x <= 5e-231)
                                                                  		tmp = Float64(fma(Float64(Float64(x * x) * Float64(eps + 1.0)), Float64(eps - 1.0), 2.0) / 2.0);
                                                                  	elseif (x <= 1.4)
                                                                  		tmp = Float64(fma(Float64(fma(eps, eps, -1.0) * x), x, 2.0) / 2.0);
                                                                  	else
                                                                  		tmp = Float64(Float64(Float64(Float64(eps * eps) * x) * x) / 2.0);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  code[x_, eps_] := If[LessEqual[x, 5e-231], N[(N[(N[(N[(x * x), $MachinePrecision] * N[(eps + 1.0), $MachinePrecision]), $MachinePrecision] * N[(eps - 1.0), $MachinePrecision] + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, 1.4], N[(N[(N[(N[(eps * eps + -1.0), $MachinePrecision] * x), $MachinePrecision] * x + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(eps * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] / 2.0), $MachinePrecision]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  \mathbf{if}\;x \leq 5 \cdot 10^{-231}:\\
                                                                  \;\;\;\;\frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - 1, 2\right)}{2}\\
                                                                  
                                                                  \mathbf{elif}\;x \leq 1.4:\\
                                                                  \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, \varepsilon, -1\right) \cdot x, x, 2\right)}{2}\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if x < 5.00000000000000023e-231

                                                                    1. Initial program 65.7%

                                                                      \[\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. Add Preprocessing
                                                                    3. Taylor expanded in eps around 0

                                                                      \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                                    4. Applied rewrites52.4%

                                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                                    5. Taylor expanded in x around 0

                                                                      \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                                    6. Step-by-step derivation
                                                                      1. Applied rewrites83.3%

                                                                        \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                                      2. Step-by-step derivation
                                                                        1. Applied rewrites89.0%

                                                                          \[\leadsto \frac{\mathsf{fma}\left(\left(x \cdot x\right) \cdot \left(\varepsilon + 1\right), \varepsilon - \color{blue}{1}, 2\right)}{2} \]

                                                                        if 5.00000000000000023e-231 < x < 1.3999999999999999

                                                                        1. Initial program 61.3%

                                                                          \[\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. Add Preprocessing
                                                                        3. Taylor expanded in eps around 0

                                                                          \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                                        4. Applied rewrites76.6%

                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                                        5. Taylor expanded in x around 0

                                                                          \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                                        6. Step-by-step derivation
                                                                          1. Applied rewrites83.3%

                                                                            \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                                          2. Step-by-step derivation
                                                                            1. Applied rewrites88.8%

                                                                              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, \varepsilon, -1\right) \cdot x, x, 2\right)}{2} \]

                                                                            if 1.3999999999999999 < x

                                                                            1. Initial program 100.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. Add Preprocessing
                                                                            3. Taylor expanded in eps around 0

                                                                              \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                                            4. Applied rewrites8.2%

                                                                              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                                            5. Taylor expanded in x around 0

                                                                              \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                                            6. Step-by-step derivation
                                                                              1. Applied rewrites45.9%

                                                                                \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                                              2. Taylor expanded in eps around inf

                                                                                \[\leadsto \frac{{\varepsilon}^{2} \cdot {x}^{\color{blue}{2}}}{2} \]
                                                                              3. Step-by-step derivation
                                                                                1. Applied rewrites66.0%

                                                                                  \[\leadsto \frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2} \]
                                                                              4. Recombined 3 regimes into one program.
                                                                              5. Add Preprocessing

                                                                              Alternative 9: 81.6% accurate, 7.8× speedup?

                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq 1.4:\\ \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, \varepsilon, -1\right) \cdot x, x, 2\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\ \end{array} \end{array} \]
                                                                              (FPCore (x eps)
                                                                               :precision binary64
                                                                               (if (<= x 1.4)
                                                                                 (/ (fma (* (fma eps eps -1.0) x) x 2.0) 2.0)
                                                                                 (/ (* (* (* eps eps) x) x) 2.0)))
                                                                              double code(double x, double eps) {
                                                                              	double tmp;
                                                                              	if (x <= 1.4) {
                                                                              		tmp = fma((fma(eps, eps, -1.0) * x), x, 2.0) / 2.0;
                                                                              	} else {
                                                                              		tmp = (((eps * eps) * x) * x) / 2.0;
                                                                              	}
                                                                              	return tmp;
                                                                              }
                                                                              
                                                                              function code(x, eps)
                                                                              	tmp = 0.0
                                                                              	if (x <= 1.4)
                                                                              		tmp = Float64(fma(Float64(fma(eps, eps, -1.0) * x), x, 2.0) / 2.0);
                                                                              	else
                                                                              		tmp = Float64(Float64(Float64(Float64(eps * eps) * x) * x) / 2.0);
                                                                              	end
                                                                              	return tmp
                                                                              end
                                                                              
                                                                              code[x_, eps_] := If[LessEqual[x, 1.4], N[(N[(N[(N[(eps * eps + -1.0), $MachinePrecision] * x), $MachinePrecision] * x + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(eps * eps), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] / 2.0), $MachinePrecision]]
                                                                              
                                                                              \begin{array}{l}
                                                                              
                                                                              \\
                                                                              \begin{array}{l}
                                                                              \mathbf{if}\;x \leq 1.4:\\
                                                                              \;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, \varepsilon, -1\right) \cdot x, x, 2\right)}{2}\\
                                                                              
                                                                              \mathbf{else}:\\
                                                                              \;\;\;\;\frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2}\\
                                                                              
                                                                              
                                                                              \end{array}
                                                                              \end{array}
                                                                              
                                                                              Derivation
                                                                              1. Split input into 2 regimes
                                                                              2. if x < 1.3999999999999999

                                                                                1. Initial program 64.3%

                                                                                  \[\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. Add Preprocessing
                                                                                3. Taylor expanded in eps around 0

                                                                                  \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                                                4. Applied rewrites59.7%

                                                                                  \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                                                5. Taylor expanded in x around 0

                                                                                  \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                                                6. Step-by-step derivation
                                                                                  1. Applied rewrites83.3%

                                                                                    \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                                                  2. Step-by-step derivation
                                                                                    1. Applied rewrites86.3%

                                                                                      \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, \varepsilon, -1\right) \cdot x, x, 2\right)}{2} \]

                                                                                    if 1.3999999999999999 < x

                                                                                    1. Initial program 100.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. Add Preprocessing
                                                                                    3. Taylor expanded in eps around 0

                                                                                      \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                                                    4. Applied rewrites8.2%

                                                                                      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                                                    5. Taylor expanded in x around 0

                                                                                      \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                                                    6. Step-by-step derivation
                                                                                      1. Applied rewrites45.9%

                                                                                        \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                                                      2. Taylor expanded in eps around inf

                                                                                        \[\leadsto \frac{{\varepsilon}^{2} \cdot {x}^{\color{blue}{2}}}{2} \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Applied rewrites66.0%

                                                                                          \[\leadsto \frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2} \]
                                                                                      4. Recombined 2 regimes into one program.
                                                                                      5. Add Preprocessing

                                                                                      Alternative 10: 81.5% accurate, 8.0× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(\varepsilon \cdot \varepsilon\right) \cdot x\\ \mathbf{if}\;x \leq 44:\\ \;\;\;\;\frac{\mathsf{fma}\left(t\_0, x, 2\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{t\_0 \cdot x}{2}\\ \end{array} \end{array} \]
                                                                                      (FPCore (x eps)
                                                                                       :precision binary64
                                                                                       (let* ((t_0 (* (* eps eps) x)))
                                                                                         (if (<= x 44.0) (/ (fma t_0 x 2.0) 2.0) (/ (* t_0 x) 2.0))))
                                                                                      double code(double x, double eps) {
                                                                                      	double t_0 = (eps * eps) * x;
                                                                                      	double tmp;
                                                                                      	if (x <= 44.0) {
                                                                                      		tmp = fma(t_0, x, 2.0) / 2.0;
                                                                                      	} else {
                                                                                      		tmp = (t_0 * x) / 2.0;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      function code(x, eps)
                                                                                      	t_0 = Float64(Float64(eps * eps) * x)
                                                                                      	tmp = 0.0
                                                                                      	if (x <= 44.0)
                                                                                      		tmp = Float64(fma(t_0, x, 2.0) / 2.0);
                                                                                      	else
                                                                                      		tmp = Float64(Float64(t_0 * x) / 2.0);
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      code[x_, eps_] := Block[{t$95$0 = N[(N[(eps * eps), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, 44.0], N[(N[(t$95$0 * x + 2.0), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(t$95$0 * x), $MachinePrecision] / 2.0), $MachinePrecision]]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      t_0 := \left(\varepsilon \cdot \varepsilon\right) \cdot x\\
                                                                                      \mathbf{if}\;x \leq 44:\\
                                                                                      \;\;\;\;\frac{\mathsf{fma}\left(t\_0, x, 2\right)}{2}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;\frac{t\_0 \cdot x}{2}\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 2 regimes
                                                                                      2. if x < 44

                                                                                        1. Initial program 64.3%

                                                                                          \[\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. Add Preprocessing
                                                                                        3. Taylor expanded in eps around 0

                                                                                          \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                                                        4. Applied rewrites59.7%

                                                                                          \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                                                        5. Taylor expanded in x around 0

                                                                                          \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                                                        6. Step-by-step derivation
                                                                                          1. Applied rewrites83.3%

                                                                                            \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                                                          2. Step-by-step derivation
                                                                                            1. Applied rewrites86.3%

                                                                                              \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, \varepsilon, -1\right) \cdot x, x, 2\right)}{2} \]
                                                                                            2. Taylor expanded in eps around inf

                                                                                              \[\leadsto \frac{\mathsf{fma}\left({\varepsilon}^{2} \cdot x, x, 2\right)}{2} \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites86.0%

                                                                                                \[\leadsto \frac{\mathsf{fma}\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x, x, 2\right)}{2} \]

                                                                                              if 44 < x

                                                                                              1. Initial program 100.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. Add Preprocessing
                                                                                              3. Taylor expanded in eps around 0

                                                                                                \[\leadsto \frac{\color{blue}{\left(e^{\mathsf{neg}\left(x\right)} + \left(x \cdot e^{\mathsf{neg}\left(x\right)} + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\frac{1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + {\varepsilon}^{2} \cdot \left(\left(\frac{1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) - \left(\frac{-1}{24} \cdot \left({x}^{4} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{120} \cdot \left({x}^{5} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(\frac{-1}{2} \cdot \left({x}^{2} \cdot e^{\mathsf{neg}\left(x\right)}\right) + \frac{-1}{6} \cdot \left({x}^{3} \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)\right)\right)\right) - \left(-1 \cdot e^{\mathsf{neg}\left(x\right)} + -1 \cdot \left(x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right)}}{2} \]
                                                                                              4. Applied rewrites8.2%

                                                                                                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(e^{-x} \cdot \mathsf{fma}\left({x}^{4}, 0.041666666666666664, {x}^{5} \cdot 0.008333333333333333\right) - e^{-x} \cdot \mathsf{fma}\left(-0.008333333333333333, {x}^{5}, -0.041666666666666664 \cdot {x}^{4}\right), \varepsilon \cdot \varepsilon, e^{-x} \cdot \mathsf{fma}\left(0.5 \cdot x, x, {x}^{3} \cdot 0.16666666666666666\right)\right) - e^{-x} \cdot \mathsf{fma}\left({x}^{3}, -0.16666666666666666, -0.5 \cdot \left(x \cdot x\right)\right), \varepsilon \cdot \varepsilon, \frac{1 + x}{e^{x}}\right) - \frac{\mathsf{fma}\left(-1, x, -1\right)}{e^{x}}}}{2} \]
                                                                                              5. Taylor expanded in x around 0

                                                                                                \[\leadsto \frac{2 + \color{blue}{{x}^{2} \cdot \left({\varepsilon}^{2} - 1\right)}}{2} \]
                                                                                              6. Step-by-step derivation
                                                                                                1. Applied rewrites45.9%

                                                                                                  \[\leadsto \frac{\mathsf{fma}\left(\varepsilon \cdot \varepsilon - 1, \color{blue}{x \cdot x}, 2\right)}{2} \]
                                                                                                2. Taylor expanded in eps around inf

                                                                                                  \[\leadsto \frac{{\varepsilon}^{2} \cdot {x}^{\color{blue}{2}}}{2} \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites66.0%

                                                                                                    \[\leadsto \frac{\left(\left(\varepsilon \cdot \varepsilon\right) \cdot x\right) \cdot x}{2} \]
                                                                                                4. Recombined 2 regimes into one program.
                                                                                                5. Add Preprocessing

                                                                                                Alternative 11: 43.7% accurate, 273.0× speedup?

                                                                                                \[\begin{array}{l} \\ 1 \end{array} \]
                                                                                                (FPCore (x eps) :precision binary64 1.0)
                                                                                                double code(double x, double eps) {
                                                                                                	return 1.0;
                                                                                                }
                                                                                                
                                                                                                module fmin_fmax_functions
                                                                                                    implicit none
                                                                                                    private
                                                                                                    public fmax
                                                                                                    public fmin
                                                                                                
                                                                                                    interface fmax
                                                                                                        module procedure fmax88
                                                                                                        module procedure fmax44
                                                                                                        module procedure fmax84
                                                                                                        module procedure fmax48
                                                                                                    end interface
                                                                                                    interface fmin
                                                                                                        module procedure fmin88
                                                                                                        module procedure fmin44
                                                                                                        module procedure fmin84
                                                                                                        module procedure fmin48
                                                                                                    end interface
                                                                                                contains
                                                                                                    real(8) function fmax88(x, y) result (res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(4) function fmax44(x, y) result (res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmax84(x, y) result(res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmax48(x, y) result(res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin88(x, y) result (res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(4) function fmin44(x, y) result (res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin84(x, y) result(res)
                                                                                                        real(8), intent (in) :: x
                                                                                                        real(4), intent (in) :: y
                                                                                                        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                    end function
                                                                                                    real(8) function fmin48(x, y) result(res)
                                                                                                        real(4), intent (in) :: x
                                                                                                        real(8), intent (in) :: y
                                                                                                        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                    end function
                                                                                                end module
                                                                                                
                                                                                                real(8) function code(x, eps)
                                                                                                use fmin_fmax_functions
                                                                                                    real(8), intent (in) :: x
                                                                                                    real(8), intent (in) :: eps
                                                                                                    code = 1.0d0
                                                                                                end function
                                                                                                
                                                                                                public static double code(double x, double eps) {
                                                                                                	return 1.0;
                                                                                                }
                                                                                                
                                                                                                def code(x, eps):
                                                                                                	return 1.0
                                                                                                
                                                                                                function code(x, eps)
                                                                                                	return 1.0
                                                                                                end
                                                                                                
                                                                                                function tmp = code(x, eps)
                                                                                                	tmp = 1.0;
                                                                                                end
                                                                                                
                                                                                                code[x_, eps_] := 1.0
                                                                                                
                                                                                                \begin{array}{l}
                                                                                                
                                                                                                \\
                                                                                                1
                                                                                                \end{array}
                                                                                                
                                                                                                Derivation
                                                                                                1. Initial program 74.6%

                                                                                                  \[\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. Add Preprocessing
                                                                                                3. Taylor expanded in x around 0

                                                                                                  \[\leadsto \color{blue}{1} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. Applied rewrites42.3%

                                                                                                    \[\leadsto \color{blue}{1} \]
                                                                                                  2. Add Preprocessing

                                                                                                  Reproduce

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