NMSE Section 6.1 mentioned, A

Percentage Accurate: 73.4% → 99.9%
Time: 13.7s
Alternatives: 15
Speedup: 7.2×

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;
}
real(8) function code(x, eps)
    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 15 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;
}
real(8) function code(x, eps)
    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.9% accurate, 1.0× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - e^{\left(-1 - eps\_m\right) \cdot x} \cdot \left(\frac{1}{eps\_m} - 1\right)}{2}\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= eps_m 1.4e-8)
   (* 0.5 (* (+ (+ 2.0 x) x) (exp (- x))))
   (/
    (-
     (* (exp (* (- eps_m 1.0) x)) (+ (/ 1.0 eps_m) 1.0))
     (* (exp (* (- -1.0 eps_m) x)) (- (/ 1.0 eps_m) 1.0)))
    2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (eps_m <= 1.4e-8) {
		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
	} else {
		tmp = ((exp(((eps_m - 1.0) * x)) * ((1.0 / eps_m) + 1.0)) - (exp(((-1.0 - eps_m) * x)) * ((1.0 / eps_m) - 1.0))) / 2.0;
	}
	return tmp;
}
eps_m = abs(eps)
real(8) function code(x, eps_m)
    real(8), intent (in) :: x
    real(8), intent (in) :: eps_m
    real(8) :: tmp
    if (eps_m <= 1.4d-8) then
        tmp = 0.5d0 * (((2.0d0 + x) + x) * exp(-x))
    else
        tmp = ((exp(((eps_m - 1.0d0) * x)) * ((1.0d0 / eps_m) + 1.0d0)) - (exp((((-1.0d0) - eps_m) * x)) * ((1.0d0 / eps_m) - 1.0d0))) / 2.0d0
    end if
    code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
	double tmp;
	if (eps_m <= 1.4e-8) {
		tmp = 0.5 * (((2.0 + x) + x) * Math.exp(-x));
	} else {
		tmp = ((Math.exp(((eps_m - 1.0) * x)) * ((1.0 / eps_m) + 1.0)) - (Math.exp(((-1.0 - eps_m) * x)) * ((1.0 / eps_m) - 1.0))) / 2.0;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if eps_m <= 1.4e-8:
		tmp = 0.5 * (((2.0 + x) + x) * math.exp(-x))
	else:
		tmp = ((math.exp(((eps_m - 1.0) * x)) * ((1.0 / eps_m) + 1.0)) - (math.exp(((-1.0 - eps_m) * x)) * ((1.0 / eps_m) - 1.0))) / 2.0
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (eps_m <= 1.4e-8)
		tmp = Float64(0.5 * Float64(Float64(Float64(2.0 + x) + x) * exp(Float64(-x))));
	else
		tmp = Float64(Float64(Float64(exp(Float64(Float64(eps_m - 1.0) * x)) * Float64(Float64(1.0 / eps_m) + 1.0)) - Float64(exp(Float64(Float64(-1.0 - eps_m) * x)) * Float64(Float64(1.0 / eps_m) - 1.0))) / 2.0);
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	tmp = 0.0;
	if (eps_m <= 1.4e-8)
		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
	else
		tmp = ((exp(((eps_m - 1.0) * x)) * ((1.0 / eps_m) + 1.0)) - (exp(((-1.0 - eps_m) * x)) * ((1.0 / eps_m) - 1.0))) / 2.0;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 1.4e-8], N[(0.5 * N[(N[(N[(2.0 + x), $MachinePrecision] + x), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Exp[N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[Exp[N[(N[(-1.0 - eps$95$m), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 1.4 \cdot 10^{-8}:\\
\;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - e^{\left(-1 - eps\_m\right) \cdot x} \cdot \left(\frac{1}{eps\_m} - 1\right)}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eps < 1.4e-8

    1. Initial program 68.5%

      \[\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 \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)} \]
    4. 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}} \]
    5. Applied rewrites69.5%

      \[\leadsto \color{blue}{\left(e^{-x} \cdot \left(\left(x + 2\right) + x\right)\right) \cdot 0.5} \]

    if 1.4e-8 < eps

    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. Recombined 2 regimes into one program.
  4. Final simplification77.6%

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

Alternative 2: 92.8% accurate, 0.7× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := \frac{1}{eps\_m} - 1\\ t_1 := \frac{eps\_m - 1}{eps\_m} - \left(1 - eps\_m\right)\\ \mathbf{if}\;e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - e^{\left(-1 - eps\_m\right) \cdot x} \cdot t\_0 \leq 10^{+39}:\\ \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot x, \mathsf{fma}\left(\mathsf{fma}\left(-1 - eps\_m, \left(\frac{1 + eps\_m}{eps\_m} + -1\right) - eps\_m, t\_1 \cdot \left(eps\_m - 1\right)\right) \cdot 0.5, x, \mathsf{fma}\left(t\_0, 1 + eps\_m, t\_1\right)\right), 1\right)\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (let* ((t_0 (- (/ 1.0 eps_m) 1.0))
        (t_1 (- (/ (- eps_m 1.0) eps_m) (- 1.0 eps_m))))
   (if (<=
        (-
         (* (exp (* (- eps_m 1.0) x)) (+ (/ 1.0 eps_m) 1.0))
         (* (exp (* (- -1.0 eps_m) x)) t_0))
        1e+39)
     (* 0.5 (* (+ (+ 2.0 x) x) (exp (- x))))
     (fma
      (* 0.5 x)
      (fma
       (*
        (fma
         (- -1.0 eps_m)
         (- (+ (/ (+ 1.0 eps_m) eps_m) -1.0) eps_m)
         (* t_1 (- eps_m 1.0)))
        0.5)
       x
       (fma t_0 (+ 1.0 eps_m) t_1))
      1.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double t_0 = (1.0 / eps_m) - 1.0;
	double t_1 = ((eps_m - 1.0) / eps_m) - (1.0 - eps_m);
	double tmp;
	if (((exp(((eps_m - 1.0) * x)) * ((1.0 / eps_m) + 1.0)) - (exp(((-1.0 - eps_m) * x)) * t_0)) <= 1e+39) {
		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
	} else {
		tmp = fma((0.5 * x), fma((fma((-1.0 - eps_m), ((((1.0 + eps_m) / eps_m) + -1.0) - eps_m), (t_1 * (eps_m - 1.0))) * 0.5), x, fma(t_0, (1.0 + eps_m), t_1)), 1.0);
	}
	return tmp;
}
eps_m = abs(eps)
function code(x, eps_m)
	t_0 = Float64(Float64(1.0 / eps_m) - 1.0)
	t_1 = Float64(Float64(Float64(eps_m - 1.0) / eps_m) - Float64(1.0 - eps_m))
	tmp = 0.0
	if (Float64(Float64(exp(Float64(Float64(eps_m - 1.0) * x)) * Float64(Float64(1.0 / eps_m) + 1.0)) - Float64(exp(Float64(Float64(-1.0 - eps_m) * x)) * t_0)) <= 1e+39)
		tmp = Float64(0.5 * Float64(Float64(Float64(2.0 + x) + x) * exp(Float64(-x))));
	else
		tmp = fma(Float64(0.5 * x), fma(Float64(fma(Float64(-1.0 - eps_m), Float64(Float64(Float64(Float64(1.0 + eps_m) / eps_m) + -1.0) - eps_m), Float64(t_1 * Float64(eps_m - 1.0))) * 0.5), x, fma(t_0, Float64(1.0 + eps_m), t_1)), 1.0);
	end
	return tmp
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(eps$95$m - 1.0), $MachinePrecision] / eps$95$m), $MachinePrecision] - N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[Exp[N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[Exp[N[(N[(-1.0 - eps$95$m), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]), $MachinePrecision], 1e+39], N[(0.5 * N[(N[(N[(2.0 + x), $MachinePrecision] + x), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(0.5 * x), $MachinePrecision] * N[(N[(N[(N[(-1.0 - eps$95$m), $MachinePrecision] * N[(N[(N[(N[(1.0 + eps$95$m), $MachinePrecision] / eps$95$m), $MachinePrecision] + -1.0), $MachinePrecision] - eps$95$m), $MachinePrecision] + N[(t$95$1 * N[(eps$95$m - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision] * x + N[(t$95$0 * N[(1.0 + eps$95$m), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
t_0 := \frac{1}{eps\_m} - 1\\
t_1 := \frac{eps\_m - 1}{eps\_m} - \left(1 - eps\_m\right)\\
\mathbf{if}\;e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - e^{\left(-1 - eps\_m\right) \cdot x} \cdot t\_0 \leq 10^{+39}:\\
\;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5 \cdot x, \mathsf{fma}\left(\mathsf{fma}\left(-1 - eps\_m, \left(\frac{1 + eps\_m}{eps\_m} + -1\right) - eps\_m, t\_1 \cdot \left(eps\_m - 1\right)\right) \cdot 0.5, x, \mathsf{fma}\left(t\_0, 1 + eps\_m, t\_1\right)\right), 1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.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))))) < 9.9999999999999994e38

    1. Initial program 59.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 \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)} \]
    4. 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}} \]
    5. Applied rewrites98.6%

      \[\leadsto \color{blue}{\left(e^{-x} \cdot \left(\left(x + 2\right) + x\right)\right) \cdot 0.5} \]

    if 9.9999999999999994e38 < (-.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)))))

    1. Initial program 99.1%

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

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

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

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

Alternative 3: 92.8% accurate, 0.7× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - e^{\left(-1 - eps\_m\right) \cdot x} \cdot \left(\frac{1}{eps\_m} - 1\right) \leq 10^{+39}:\\ \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(eps\_m - 1, eps\_m - 1, \left(-1 - eps\_m\right) \cdot \left(-1 - eps\_m\right)\right), 0.5 \cdot x, -2\right), x, 2\right) \cdot 0.5\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<=
      (-
       (* (exp (* (- eps_m 1.0) x)) (+ (/ 1.0 eps_m) 1.0))
       (* (exp (* (- -1.0 eps_m) x)) (- (/ 1.0 eps_m) 1.0)))
      1e+39)
   (* 0.5 (* (+ (+ 2.0 x) x) (exp (- x))))
   (*
    (fma
     (fma
      (fma (- eps_m 1.0) (- eps_m 1.0) (* (- -1.0 eps_m) (- -1.0 eps_m)))
      (* 0.5 x)
      -2.0)
     x
     2.0)
    0.5)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (((exp(((eps_m - 1.0) * x)) * ((1.0 / eps_m) + 1.0)) - (exp(((-1.0 - eps_m) * x)) * ((1.0 / eps_m) - 1.0))) <= 1e+39) {
		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
	} else {
		tmp = fma(fma(fma((eps_m - 1.0), (eps_m - 1.0), ((-1.0 - eps_m) * (-1.0 - eps_m))), (0.5 * x), -2.0), x, 2.0) * 0.5;
	}
	return tmp;
}
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (Float64(Float64(exp(Float64(Float64(eps_m - 1.0) * x)) * Float64(Float64(1.0 / eps_m) + 1.0)) - Float64(exp(Float64(Float64(-1.0 - eps_m) * x)) * Float64(Float64(1.0 / eps_m) - 1.0))) <= 1e+39)
		tmp = Float64(0.5 * Float64(Float64(Float64(2.0 + x) + x) * exp(Float64(-x))));
	else
		tmp = Float64(fma(fma(fma(Float64(eps_m - 1.0), Float64(eps_m - 1.0), Float64(Float64(-1.0 - eps_m) * Float64(-1.0 - eps_m))), Float64(0.5 * x), -2.0), x, 2.0) * 0.5);
	end
	return tmp
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[Exp[N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[Exp[N[(N[(-1.0 - eps$95$m), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+39], N[(0.5 * N[(N[(N[(2.0 + x), $MachinePrecision] + x), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(eps$95$m - 1.0), $MachinePrecision] * N[(eps$95$m - 1.0), $MachinePrecision] + N[(N[(-1.0 - eps$95$m), $MachinePrecision] * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 * x), $MachinePrecision] + -2.0), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - e^{\left(-1 - eps\_m\right) \cdot x} \cdot \left(\frac{1}{eps\_m} - 1\right) \leq 10^{+39}:\\
\;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(eps\_m - 1, eps\_m - 1, \left(-1 - eps\_m\right) \cdot \left(-1 - eps\_m\right)\right), 0.5 \cdot x, -2\right), x, 2\right) \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.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))))) < 9.9999999999999994e38

    1. Initial program 59.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 \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)} \]
    4. 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}} \]
    5. Applied rewrites98.6%

      \[\leadsto \color{blue}{\left(e^{-x} \cdot \left(\left(x + 2\right) + x\right)\right) \cdot 0.5} \]

    if 9.9999999999999994e38 < (-.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)))))

    1. Initial program 99.1%

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

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

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

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

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

      \[\leadsto \left(2 + x \cdot \left(\left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2} + \left(\frac{1}{2} \cdot {\left(\varepsilon - 1\right)}^{2} + x \cdot \left(\frac{-1}{6} \cdot {\left(1 + \varepsilon\right)}^{3} + \frac{1}{6} \cdot {\left(\varepsilon - 1\right)}^{3}\right)\right)\right)\right)\right) - 1\right)\right) \cdot \frac{1}{2} \]
    7. Applied rewrites19.0%

      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(1 - \varepsilon, 1 - \varepsilon, \left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right), 0.5, \mathsf{fma}\left(0.16666666666666666 \cdot \left(\varepsilon - 1\right), \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right), \left(-0.16666666666666666 \cdot \left(1 + \varepsilon\right)\right) \cdot \left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right)\right) \cdot x\right), x, \left(\varepsilon - 1\right) - \varepsilon\right) - 1, x, 2\right) \cdot 0.5 \]
    8. Taylor expanded in x around 0

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

        \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon - 1, \varepsilon - 1, \left(\varepsilon + 1\right) \cdot \left(\varepsilon + 1\right)\right), x \cdot 0.5, -2\right), x, 2\right) \cdot 0.5 \]
    10. Recombined 2 regimes into one program.
    11. Final simplification92.1%

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

    Alternative 4: 92.0% accurate, 0.7× speedup?

    \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - e^{\left(-1 - eps\_m\right) \cdot x} \cdot \left(\frac{1}{eps\_m} - 1\right) \leq 10^{+39}:\\ \;\;\;\;e^{-x}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(eps\_m - 1, eps\_m - 1, \left(-1 - eps\_m\right) \cdot \left(-1 - eps\_m\right)\right), 0.5 \cdot x, -2\right), x, 2\right) \cdot 0.5\\ \end{array} \end{array} \]
    eps_m = (fabs.f64 eps)
    (FPCore (x eps_m)
     :precision binary64
     (if (<=
          (-
           (* (exp (* (- eps_m 1.0) x)) (+ (/ 1.0 eps_m) 1.0))
           (* (exp (* (- -1.0 eps_m) x)) (- (/ 1.0 eps_m) 1.0)))
          1e+39)
       (exp (- x))
       (*
        (fma
         (fma
          (fma (- eps_m 1.0) (- eps_m 1.0) (* (- -1.0 eps_m) (- -1.0 eps_m)))
          (* 0.5 x)
          -2.0)
         x
         2.0)
        0.5)))
    eps_m = fabs(eps);
    double code(double x, double eps_m) {
    	double tmp;
    	if (((exp(((eps_m - 1.0) * x)) * ((1.0 / eps_m) + 1.0)) - (exp(((-1.0 - eps_m) * x)) * ((1.0 / eps_m) - 1.0))) <= 1e+39) {
    		tmp = exp(-x);
    	} else {
    		tmp = fma(fma(fma((eps_m - 1.0), (eps_m - 1.0), ((-1.0 - eps_m) * (-1.0 - eps_m))), (0.5 * x), -2.0), x, 2.0) * 0.5;
    	}
    	return tmp;
    }
    
    eps_m = abs(eps)
    function code(x, eps_m)
    	tmp = 0.0
    	if (Float64(Float64(exp(Float64(Float64(eps_m - 1.0) * x)) * Float64(Float64(1.0 / eps_m) + 1.0)) - Float64(exp(Float64(Float64(-1.0 - eps_m) * x)) * Float64(Float64(1.0 / eps_m) - 1.0))) <= 1e+39)
    		tmp = exp(Float64(-x));
    	else
    		tmp = Float64(fma(fma(fma(Float64(eps_m - 1.0), Float64(eps_m - 1.0), Float64(Float64(-1.0 - eps_m) * Float64(-1.0 - eps_m))), Float64(0.5 * x), -2.0), x, 2.0) * 0.5);
    	end
    	return tmp
    end
    
    eps_m = N[Abs[eps], $MachinePrecision]
    code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[Exp[N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[Exp[N[(N[(-1.0 - eps$95$m), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+39], N[Exp[(-x)], $MachinePrecision], N[(N[(N[(N[(N[(eps$95$m - 1.0), $MachinePrecision] * N[(eps$95$m - 1.0), $MachinePrecision] + N[(N[(-1.0 - eps$95$m), $MachinePrecision] * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(0.5 * x), $MachinePrecision] + -2.0), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision]]
    
    \begin{array}{l}
    eps_m = \left|\varepsilon\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - e^{\left(-1 - eps\_m\right) \cdot x} \cdot \left(\frac{1}{eps\_m} - 1\right) \leq 10^{+39}:\\
    \;\;\;\;e^{-x}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(eps\_m - 1, eps\_m - 1, \left(-1 - eps\_m\right) \cdot \left(-1 - eps\_m\right)\right), 0.5 \cdot x, -2\right), x, 2\right) \cdot 0.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (-.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))))) < 9.9999999999999994e38

      1. Initial program 59.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 inf

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

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

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

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

        \[\leadsto e^{-1 \cdot x} \]
      7. Step-by-step derivation
        1. Applied rewrites95.8%

          \[\leadsto e^{-x} \]

        if 9.9999999999999994e38 < (-.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)))))

        1. Initial program 99.1%

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

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

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

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

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

          \[\leadsto \left(2 + x \cdot \left(\left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2} + \left(\frac{1}{2} \cdot {\left(\varepsilon - 1\right)}^{2} + x \cdot \left(\frac{-1}{6} \cdot {\left(1 + \varepsilon\right)}^{3} + \frac{1}{6} \cdot {\left(\varepsilon - 1\right)}^{3}\right)\right)\right)\right)\right) - 1\right)\right) \cdot \frac{1}{2} \]
        7. Applied rewrites19.0%

          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(1 - \varepsilon, 1 - \varepsilon, \left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right), 0.5, \mathsf{fma}\left(0.16666666666666666 \cdot \left(\varepsilon - 1\right), \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right), \left(-0.16666666666666666 \cdot \left(1 + \varepsilon\right)\right) \cdot \left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right)\right) \cdot x\right), x, \left(\varepsilon - 1\right) - \varepsilon\right) - 1, x, 2\right) \cdot 0.5 \]
        8. Taylor expanded in x around 0

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

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon - 1, \varepsilon - 1, \left(\varepsilon + 1\right) \cdot \left(\varepsilon + 1\right)\right), x \cdot 0.5, -2\right), x, 2\right) \cdot 0.5 \]
        10. Recombined 2 regimes into one program.
        11. Final simplification90.6%

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

        Alternative 5: 99.9% accurate, 1.2× speedup?

        \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(e^{\left(eps\_m - 1\right) \cdot x} + e^{\left(-1 - eps\_m\right) \cdot x}\right) \cdot 0.5\\ \end{array} \end{array} \]
        eps_m = (fabs.f64 eps)
        (FPCore (x eps_m)
         :precision binary64
         (if (<= eps_m 1.4e-8)
           (* 0.5 (* (+ (+ 2.0 x) x) (exp (- x))))
           (* (+ (exp (* (- eps_m 1.0) x)) (exp (* (- -1.0 eps_m) x))) 0.5)))
        eps_m = fabs(eps);
        double code(double x, double eps_m) {
        	double tmp;
        	if (eps_m <= 1.4e-8) {
        		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
        	} else {
        		tmp = (exp(((eps_m - 1.0) * x)) + exp(((-1.0 - eps_m) * x))) * 0.5;
        	}
        	return tmp;
        }
        
        eps_m = abs(eps)
        real(8) function code(x, eps_m)
            real(8), intent (in) :: x
            real(8), intent (in) :: eps_m
            real(8) :: tmp
            if (eps_m <= 1.4d-8) then
                tmp = 0.5d0 * (((2.0d0 + x) + x) * exp(-x))
            else
                tmp = (exp(((eps_m - 1.0d0) * x)) + exp((((-1.0d0) - eps_m) * x))) * 0.5d0
            end if
            code = tmp
        end function
        
        eps_m = Math.abs(eps);
        public static double code(double x, double eps_m) {
        	double tmp;
        	if (eps_m <= 1.4e-8) {
        		tmp = 0.5 * (((2.0 + x) + x) * Math.exp(-x));
        	} else {
        		tmp = (Math.exp(((eps_m - 1.0) * x)) + Math.exp(((-1.0 - eps_m) * x))) * 0.5;
        	}
        	return tmp;
        }
        
        eps_m = math.fabs(eps)
        def code(x, eps_m):
        	tmp = 0
        	if eps_m <= 1.4e-8:
        		tmp = 0.5 * (((2.0 + x) + x) * math.exp(-x))
        	else:
        		tmp = (math.exp(((eps_m - 1.0) * x)) + math.exp(((-1.0 - eps_m) * x))) * 0.5
        	return tmp
        
        eps_m = abs(eps)
        function code(x, eps_m)
        	tmp = 0.0
        	if (eps_m <= 1.4e-8)
        		tmp = Float64(0.5 * Float64(Float64(Float64(2.0 + x) + x) * exp(Float64(-x))));
        	else
        		tmp = Float64(Float64(exp(Float64(Float64(eps_m - 1.0) * x)) + exp(Float64(Float64(-1.0 - eps_m) * x))) * 0.5);
        	end
        	return tmp
        end
        
        eps_m = abs(eps);
        function tmp_2 = code(x, eps_m)
        	tmp = 0.0;
        	if (eps_m <= 1.4e-8)
        		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
        	else
        		tmp = (exp(((eps_m - 1.0) * x)) + exp(((-1.0 - eps_m) * x))) * 0.5;
        	end
        	tmp_2 = tmp;
        end
        
        eps_m = N[Abs[eps], $MachinePrecision]
        code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 1.4e-8], N[(0.5 * N[(N[(N[(2.0 + x), $MachinePrecision] + x), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(N[(-1.0 - eps$95$m), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
        
        \begin{array}{l}
        eps_m = \left|\varepsilon\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;eps\_m \leq 1.4 \cdot 10^{-8}:\\
        \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(e^{\left(eps\_m - 1\right) \cdot x} + e^{\left(-1 - eps\_m\right) \cdot x}\right) \cdot 0.5\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if eps < 1.4e-8

          1. Initial program 68.5%

            \[\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 \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)} \]
          4. 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}} \]
          5. Applied rewrites69.5%

            \[\leadsto \color{blue}{\left(e^{-x} \cdot \left(\left(x + 2\right) + x\right)\right) \cdot 0.5} \]

          if 1.4e-8 < eps

          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 \color{blue}{\frac{1}{2} \cdot \left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} - -1 \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

        Alternative 6: 99.9% accurate, 1.2× speedup?

        \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 1.4 \cdot 10^{-8}:\\ \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(e^{\left(-x\right) \cdot eps\_m} + e^{\left(eps\_m - 1\right) \cdot x}\right) \cdot 0.5\\ \end{array} \end{array} \]
        eps_m = (fabs.f64 eps)
        (FPCore (x eps_m)
         :precision binary64
         (if (<= eps_m 1.4e-8)
           (* 0.5 (* (+ (+ 2.0 x) x) (exp (- x))))
           (* (+ (exp (* (- x) eps_m)) (exp (* (- eps_m 1.0) x))) 0.5)))
        eps_m = fabs(eps);
        double code(double x, double eps_m) {
        	double tmp;
        	if (eps_m <= 1.4e-8) {
        		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
        	} else {
        		tmp = (exp((-x * eps_m)) + exp(((eps_m - 1.0) * x))) * 0.5;
        	}
        	return tmp;
        }
        
        eps_m = abs(eps)
        real(8) function code(x, eps_m)
            real(8), intent (in) :: x
            real(8), intent (in) :: eps_m
            real(8) :: tmp
            if (eps_m <= 1.4d-8) then
                tmp = 0.5d0 * (((2.0d0 + x) + x) * exp(-x))
            else
                tmp = (exp((-x * eps_m)) + exp(((eps_m - 1.0d0) * x))) * 0.5d0
            end if
            code = tmp
        end function
        
        eps_m = Math.abs(eps);
        public static double code(double x, double eps_m) {
        	double tmp;
        	if (eps_m <= 1.4e-8) {
        		tmp = 0.5 * (((2.0 + x) + x) * Math.exp(-x));
        	} else {
        		tmp = (Math.exp((-x * eps_m)) + Math.exp(((eps_m - 1.0) * x))) * 0.5;
        	}
        	return tmp;
        }
        
        eps_m = math.fabs(eps)
        def code(x, eps_m):
        	tmp = 0
        	if eps_m <= 1.4e-8:
        		tmp = 0.5 * (((2.0 + x) + x) * math.exp(-x))
        	else:
        		tmp = (math.exp((-x * eps_m)) + math.exp(((eps_m - 1.0) * x))) * 0.5
        	return tmp
        
        eps_m = abs(eps)
        function code(x, eps_m)
        	tmp = 0.0
        	if (eps_m <= 1.4e-8)
        		tmp = Float64(0.5 * Float64(Float64(Float64(2.0 + x) + x) * exp(Float64(-x))));
        	else
        		tmp = Float64(Float64(exp(Float64(Float64(-x) * eps_m)) + exp(Float64(Float64(eps_m - 1.0) * x))) * 0.5);
        	end
        	return tmp
        end
        
        eps_m = abs(eps);
        function tmp_2 = code(x, eps_m)
        	tmp = 0.0;
        	if (eps_m <= 1.4e-8)
        		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
        	else
        		tmp = (exp((-x * eps_m)) + exp(((eps_m - 1.0) * x))) * 0.5;
        	end
        	tmp_2 = tmp;
        end
        
        eps_m = N[Abs[eps], $MachinePrecision]
        code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 1.4e-8], N[(0.5 * N[(N[(N[(2.0 + x), $MachinePrecision] + x), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[((-x) * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[Exp[N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
        
        \begin{array}{l}
        eps_m = \left|\varepsilon\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;eps\_m \leq 1.4 \cdot 10^{-8}:\\
        \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(e^{\left(-x\right) \cdot eps\_m} + e^{\left(eps\_m - 1\right) \cdot x}\right) \cdot 0.5\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if eps < 1.4e-8

          1. Initial program 68.5%

            \[\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 \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)} \]
          4. 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}} \]
          5. Applied rewrites69.5%

            \[\leadsto \color{blue}{\left(e^{-x} \cdot \left(\left(x + 2\right) + x\right)\right) \cdot 0.5} \]

          if 1.4e-8 < eps

          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 \color{blue}{\frac{1}{2} \cdot \left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} - -1 \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

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

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

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

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

              \[\leadsto \left(e^{\left(-x\right) \cdot \varepsilon} + e^{\left(\varepsilon - 1\right) \cdot x}\right) \cdot 0.5 \]
          8. Recombined 2 regimes into one program.
          9. Final simplification77.6%

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

          Alternative 7: 94.8% accurate, 1.4× speedup?

          \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 0.0152:\\ \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.5 \cdot x, 1 + eps\_m, -1\right) \cdot \left(1 + eps\_m\right), x, 1\right) \cdot \left(\frac{1}{eps\_m} - 1\right)}{2}\\ \end{array} \end{array} \]
          eps_m = (fabs.f64 eps)
          (FPCore (x eps_m)
           :precision binary64
           (if (<= eps_m 0.0152)
             (* 0.5 (* (+ (+ 2.0 x) x) (exp (- x))))
             (/
              (-
               (* (exp (* (- eps_m 1.0) x)) (+ (/ 1.0 eps_m) 1.0))
               (*
                (fma (* (fma (* 0.5 x) (+ 1.0 eps_m) -1.0) (+ 1.0 eps_m)) x 1.0)
                (- (/ 1.0 eps_m) 1.0)))
              2.0)))
          eps_m = fabs(eps);
          double code(double x, double eps_m) {
          	double tmp;
          	if (eps_m <= 0.0152) {
          		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
          	} else {
          		tmp = ((exp(((eps_m - 1.0) * x)) * ((1.0 / eps_m) + 1.0)) - (fma((fma((0.5 * x), (1.0 + eps_m), -1.0) * (1.0 + eps_m)), x, 1.0) * ((1.0 / eps_m) - 1.0))) / 2.0;
          	}
          	return tmp;
          }
          
          eps_m = abs(eps)
          function code(x, eps_m)
          	tmp = 0.0
          	if (eps_m <= 0.0152)
          		tmp = Float64(0.5 * Float64(Float64(Float64(2.0 + x) + x) * exp(Float64(-x))));
          	else
          		tmp = Float64(Float64(Float64(exp(Float64(Float64(eps_m - 1.0) * x)) * Float64(Float64(1.0 / eps_m) + 1.0)) - Float64(fma(Float64(fma(Float64(0.5 * x), Float64(1.0 + eps_m), -1.0) * Float64(1.0 + eps_m)), x, 1.0) * Float64(Float64(1.0 / eps_m) - 1.0))) / 2.0);
          	end
          	return tmp
          end
          
          eps_m = N[Abs[eps], $MachinePrecision]
          code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.0152], N[(0.5 * N[(N[(N[(2.0 + x), $MachinePrecision] + x), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Exp[N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(N[(N[(0.5 * x), $MachinePrecision] * N[(1.0 + eps$95$m), $MachinePrecision] + -1.0), $MachinePrecision] * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * x + 1.0), $MachinePrecision] * N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
          
          \begin{array}{l}
          eps_m = \left|\varepsilon\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;eps\_m \leq 0.0152:\\
          \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{e^{\left(eps\_m - 1\right) \cdot x} \cdot \left(\frac{1}{eps\_m} + 1\right) - \mathsf{fma}\left(\mathsf{fma}\left(0.5 \cdot x, 1 + eps\_m, -1\right) \cdot \left(1 + eps\_m\right), x, 1\right) \cdot \left(\frac{1}{eps\_m} - 1\right)}{2}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if eps < 0.0152

            1. Initial program 68.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 \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)} \]
            4. 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}} \]
            5. Applied rewrites69.8%

              \[\leadsto \color{blue}{\left(e^{-x} \cdot \left(\left(x + 2\right) + x\right)\right) \cdot 0.5} \]

            if 0.0152 < eps

            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 x around 0

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

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

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

                \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\mathsf{neg}\left(\left(1 - \varepsilon\right) \cdot x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \color{blue}{\mathsf{fma}\left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right), x, 1\right)}}{2} \]
              4. +-commutativeN/A

                \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\mathsf{neg}\left(\left(1 - \varepsilon\right) \cdot x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right) + -1 \cdot \left(1 + \varepsilon\right)}, x, 1\right)}{2} \]
              5. associate-*r*N/A

                \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\mathsf{neg}\left(\left(1 - \varepsilon\right) \cdot x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(\color{blue}{\left(\frac{1}{2} \cdot x\right) \cdot {\left(1 + \varepsilon\right)}^{2}} + -1 \cdot \left(1 + \varepsilon\right), x, 1\right)}{2} \]
              6. unpow2N/A

                \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\mathsf{neg}\left(\left(1 - \varepsilon\right) \cdot x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(\left(\frac{1}{2} \cdot x\right) \cdot \color{blue}{\left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right)} + -1 \cdot \left(1 + \varepsilon\right), x, 1\right)}{2} \]
              7. associate-*r*N/A

                \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\mathsf{neg}\left(\left(1 - \varepsilon\right) \cdot x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(\color{blue}{\left(\left(\frac{1}{2} \cdot x\right) \cdot \left(1 + \varepsilon\right)\right) \cdot \left(1 + \varepsilon\right)} + -1 \cdot \left(1 + \varepsilon\right), x, 1\right)}{2} \]
              8. distribute-rgt-outN/A

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

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

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

                \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\mathsf{neg}\left(\left(1 - \varepsilon\right) \cdot x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(\left(1 + \varepsilon\right) \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{2} \cdot x, 1 + \varepsilon, -1\right)}, x, 1\right)}{2} \]
              12. *-commutativeN/A

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

                \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{\mathsf{neg}\left(\left(1 - \varepsilon\right) \cdot x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(\left(1 + \varepsilon\right) \cdot \mathsf{fma}\left(\color{blue}{x \cdot \frac{1}{2}}, 1 + \varepsilon, -1\right), x, 1\right)}{2} \]
              14. lower-+.f6490.3

                \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(\left(1 + \varepsilon\right) \cdot \mathsf{fma}\left(x \cdot 0.5, \color{blue}{1 + \varepsilon}, -1\right), x, 1\right)}{2} \]
            5. Applied rewrites90.3%

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

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

          Alternative 8: 94.8% accurate, 1.8× speedup?

          \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 0.0152:\\ \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(eps\_m, x, x\right) \cdot \left(1 + eps\_m\right), 0.5, -1 - eps\_m\right), x, 1\right) + e^{\left(eps\_m - 1\right) \cdot x}\right) \cdot 0.5\\ \end{array} \end{array} \]
          eps_m = (fabs.f64 eps)
          (FPCore (x eps_m)
           :precision binary64
           (if (<= eps_m 0.0152)
             (* 0.5 (* (+ (+ 2.0 x) x) (exp (- x))))
             (*
              (+
               (fma (fma (* (fma eps_m x x) (+ 1.0 eps_m)) 0.5 (- -1.0 eps_m)) x 1.0)
               (exp (* (- eps_m 1.0) x)))
              0.5)))
          eps_m = fabs(eps);
          double code(double x, double eps_m) {
          	double tmp;
          	if (eps_m <= 0.0152) {
          		tmp = 0.5 * (((2.0 + x) + x) * exp(-x));
          	} else {
          		tmp = (fma(fma((fma(eps_m, x, x) * (1.0 + eps_m)), 0.5, (-1.0 - eps_m)), x, 1.0) + exp(((eps_m - 1.0) * x))) * 0.5;
          	}
          	return tmp;
          }
          
          eps_m = abs(eps)
          function code(x, eps_m)
          	tmp = 0.0
          	if (eps_m <= 0.0152)
          		tmp = Float64(0.5 * Float64(Float64(Float64(2.0 + x) + x) * exp(Float64(-x))));
          	else
          		tmp = Float64(Float64(fma(fma(Float64(fma(eps_m, x, x) * Float64(1.0 + eps_m)), 0.5, Float64(-1.0 - eps_m)), x, 1.0) + exp(Float64(Float64(eps_m - 1.0) * x))) * 0.5);
          	end
          	return tmp
          end
          
          eps_m = N[Abs[eps], $MachinePrecision]
          code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.0152], N[(0.5 * N[(N[(N[(2.0 + x), $MachinePrecision] + x), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(eps$95$m * x + x), $MachinePrecision] * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] * x + 1.0), $MachinePrecision] + N[Exp[N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
          
          \begin{array}{l}
          eps_m = \left|\varepsilon\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;eps\_m \leq 0.0152:\\
          \;\;\;\;0.5 \cdot \left(\left(\left(2 + x\right) + x\right) \cdot e^{-x}\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(eps\_m, x, x\right) \cdot \left(1 + eps\_m\right), 0.5, -1 - eps\_m\right), x, 1\right) + e^{\left(eps\_m - 1\right) \cdot x}\right) \cdot 0.5\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if eps < 0.0152

            1. Initial program 68.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 \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)} \]
            4. 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}} \]
            5. Applied rewrites69.8%

              \[\leadsto \color{blue}{\left(e^{-x} \cdot \left(\left(x + 2\right) + x\right)\right) \cdot 0.5} \]

            if 0.0152 < eps

            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 \color{blue}{\frac{1}{2} \cdot \left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} - -1 \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

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

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

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

              \[\leadsto \left(\left(1 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right) + e^{\left(\varepsilon - 1\right) \cdot x}\right) \cdot \frac{1}{2} \]
            7. Step-by-step derivation
              1. Applied rewrites90.3%

                \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, x, x\right) \cdot \left(1 + \varepsilon\right), 0.5, -1 - \varepsilon\right), x, 1\right) + e^{\left(\varepsilon - 1\right) \cdot x}\right) \cdot 0.5 \]
            8. Recombined 2 regimes into one program.
            9. Final simplification75.1%

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

            Alternative 9: 78.5% accurate, 2.6× speedup?

            \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq 9.4 \cdot 10^{-172}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(1 - x\right) \cdot x\right) \cdot eps\_m\right) \cdot eps\_m, x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(1 - eps\_m, 1 - eps\_m, \left(-1 - eps\_m\right) \cdot \left(-1 - eps\_m\right)\right), 0.5, \mathsf{fma}\left(0.16666666666666666 \cdot \left(eps\_m - 1\right), \left(eps\_m - 1\right) \cdot \left(eps\_m - 1\right), 1 \cdot \left(-0.16666666666666666 \cdot \left(1 + eps\_m\right)\right)\right) \cdot x\right), x, \left(eps\_m - 1\right) - eps\_m\right) - 1, x, 2\right) \cdot 0.5\\ \end{array} \end{array} \]
            eps_m = (fabs.f64 eps)
            (FPCore (x eps_m)
             :precision binary64
             (if (<= x 9.4e-172)
               (* (fma (* (* (* (- 1.0 x) x) eps_m) eps_m) x 2.0) 0.5)
               (*
                (fma
                 (-
                  (fma
                   (fma
                    (fma (- 1.0 eps_m) (- 1.0 eps_m) (* (- -1.0 eps_m) (- -1.0 eps_m)))
                    0.5
                    (*
                     (fma
                      (* 0.16666666666666666 (- eps_m 1.0))
                      (* (- eps_m 1.0) (- eps_m 1.0))
                      (* 1.0 (* -0.16666666666666666 (+ 1.0 eps_m))))
                     x))
                   x
                   (- (- eps_m 1.0) eps_m))
                  1.0)
                 x
                 2.0)
                0.5)))
            eps_m = fabs(eps);
            double code(double x, double eps_m) {
            	double tmp;
            	if (x <= 9.4e-172) {
            		tmp = fma(((((1.0 - x) * x) * eps_m) * eps_m), x, 2.0) * 0.5;
            	} else {
            		tmp = fma((fma(fma(fma((1.0 - eps_m), (1.0 - eps_m), ((-1.0 - eps_m) * (-1.0 - eps_m))), 0.5, (fma((0.16666666666666666 * (eps_m - 1.0)), ((eps_m - 1.0) * (eps_m - 1.0)), (1.0 * (-0.16666666666666666 * (1.0 + eps_m)))) * x)), x, ((eps_m - 1.0) - eps_m)) - 1.0), x, 2.0) * 0.5;
            	}
            	return tmp;
            }
            
            eps_m = abs(eps)
            function code(x, eps_m)
            	tmp = 0.0
            	if (x <= 9.4e-172)
            		tmp = Float64(fma(Float64(Float64(Float64(Float64(1.0 - x) * x) * eps_m) * eps_m), x, 2.0) * 0.5);
            	else
            		tmp = Float64(fma(Float64(fma(fma(fma(Float64(1.0 - eps_m), Float64(1.0 - eps_m), Float64(Float64(-1.0 - eps_m) * Float64(-1.0 - eps_m))), 0.5, Float64(fma(Float64(0.16666666666666666 * Float64(eps_m - 1.0)), Float64(Float64(eps_m - 1.0) * Float64(eps_m - 1.0)), Float64(1.0 * Float64(-0.16666666666666666 * Float64(1.0 + eps_m)))) * x)), x, Float64(Float64(eps_m - 1.0) - eps_m)) - 1.0), x, 2.0) * 0.5);
            	end
            	return tmp
            end
            
            eps_m = N[Abs[eps], $MachinePrecision]
            code[x_, eps$95$m_] := If[LessEqual[x, 9.4e-172], N[(N[(N[(N[(N[(N[(1.0 - x), $MachinePrecision] * x), $MachinePrecision] * eps$95$m), $MachinePrecision] * eps$95$m), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision] + N[(N[(-1.0 - eps$95$m), $MachinePrecision] * N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(N[(N[(0.16666666666666666 * N[(eps$95$m - 1.0), $MachinePrecision]), $MachinePrecision] * N[(N[(eps$95$m - 1.0), $MachinePrecision] * N[(eps$95$m - 1.0), $MachinePrecision]), $MachinePrecision] + N[(1.0 * N[(-0.16666666666666666 * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] * x + N[(N[(eps$95$m - 1.0), $MachinePrecision] - eps$95$m), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision]]
            
            \begin{array}{l}
            eps_m = \left|\varepsilon\right|
            
            \\
            \begin{array}{l}
            \mathbf{if}\;x \leq 9.4 \cdot 10^{-172}:\\
            \;\;\;\;\mathsf{fma}\left(\left(\left(\left(1 - x\right) \cdot x\right) \cdot eps\_m\right) \cdot eps\_m, x, 2\right) \cdot 0.5\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(1 - eps\_m, 1 - eps\_m, \left(-1 - eps\_m\right) \cdot \left(-1 - eps\_m\right)\right), 0.5, \mathsf{fma}\left(0.16666666666666666 \cdot \left(eps\_m - 1\right), \left(eps\_m - 1\right) \cdot \left(eps\_m - 1\right), 1 \cdot \left(-0.16666666666666666 \cdot \left(1 + eps\_m\right)\right)\right) \cdot x\right), x, \left(eps\_m - 1\right) - eps\_m\right) - 1, x, 2\right) \cdot 0.5\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if x < 9.39999999999999952e-172

              1. Initial program 70.1%

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

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

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

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

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

                \[\leadsto \left(2 + x \cdot \left(\left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2} + \left(\frac{1}{2} \cdot {\left(\varepsilon - 1\right)}^{2} + x \cdot \left(\frac{-1}{6} \cdot {\left(1 + \varepsilon\right)}^{3} + \frac{1}{6} \cdot {\left(\varepsilon - 1\right)}^{3}\right)\right)\right)\right)\right) - 1\right)\right) \cdot \frac{1}{2} \]
              7. Applied rewrites53.4%

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

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

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

                if 9.39999999999999952e-172 < x

                1. Initial program 85.9%

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

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

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

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

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

                  \[\leadsto \left(2 + x \cdot \left(\left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2} + \left(\frac{1}{2} \cdot {\left(\varepsilon - 1\right)}^{2} + x \cdot \left(\frac{-1}{6} \cdot {\left(1 + \varepsilon\right)}^{3} + \frac{1}{6} \cdot {\left(\varepsilon - 1\right)}^{3}\right)\right)\right)\right)\right) - 1\right)\right) \cdot \frac{1}{2} \]
                7. Applied rewrites27.1%

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(1 - \varepsilon, 1 - \varepsilon, \left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right), 0.5, \mathsf{fma}\left(0.16666666666666666 \cdot \left(\varepsilon - 1\right), \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right), \left(-0.16666666666666666 \cdot \left(1 + \varepsilon\right)\right) \cdot \left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right)\right) \cdot x\right), x, \left(\varepsilon - 1\right) - \varepsilon\right) - 1, x, 2\right) \cdot 0.5 \]
                8. Taylor expanded in eps around 0

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(1 - \varepsilon, 1 - \varepsilon, \left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right), 0.5, \mathsf{fma}\left(0.16666666666666666 \cdot \left(\varepsilon - 1\right), \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right), \left(-0.16666666666666666 \cdot \left(1 + \varepsilon\right)\right) \cdot 1\right) \cdot x\right), x, \left(\varepsilon - 1\right) - \varepsilon\right) - 1, x, 2\right) \cdot 0.5 \]
                10. Recombined 2 regimes into one program.
                11. Final simplification69.4%

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

                Alternative 10: 74.5% accurate, 7.2× speedup?

                \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \left(1 + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(eps\_m, x, x\right) \cdot \left(1 + eps\_m\right), 0.5, -1 - eps\_m\right), x, 1\right)\right) \cdot 0.5 \end{array} \]
                eps_m = (fabs.f64 eps)
                (FPCore (x eps_m)
                 :precision binary64
                 (*
                  (+
                   1.0
                   (fma (fma (* (fma eps_m x x) (+ 1.0 eps_m)) 0.5 (- -1.0 eps_m)) x 1.0))
                  0.5))
                eps_m = fabs(eps);
                double code(double x, double eps_m) {
                	return (1.0 + fma(fma((fma(eps_m, x, x) * (1.0 + eps_m)), 0.5, (-1.0 - eps_m)), x, 1.0)) * 0.5;
                }
                
                eps_m = abs(eps)
                function code(x, eps_m)
                	return Float64(Float64(1.0 + fma(fma(Float64(fma(eps_m, x, x) * Float64(1.0 + eps_m)), 0.5, Float64(-1.0 - eps_m)), x, 1.0)) * 0.5)
                end
                
                eps_m = N[Abs[eps], $MachinePrecision]
                code[x_, eps$95$m_] := N[(N[(1.0 + N[(N[(N[(N[(eps$95$m * x + x), $MachinePrecision] * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] * x + 1.0), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]
                
                \begin{array}{l}
                eps_m = \left|\varepsilon\right|
                
                \\
                \left(1 + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(eps\_m, x, x\right) \cdot \left(1 + eps\_m\right), 0.5, -1 - eps\_m\right), x, 1\right)\right) \cdot 0.5
                \end{array}
                
                Derivation
                1. Initial program 76.9%

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

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

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

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

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

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

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

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

                      \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, x, x\right) \cdot \left(1 + \varepsilon\right), 0.5, -1 - \varepsilon\right), x, 1\right) + 1\right) \cdot 0.5 \]
                    2. Final simplification75.1%

                      \[\leadsto \left(1 + \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\varepsilon, x, x\right) \cdot \left(1 + \varepsilon\right), 0.5, -1 - \varepsilon\right), x, 1\right)\right) \cdot 0.5 \]
                    3. Add Preprocessing

                    Alternative 11: 72.9% accurate, 7.6× speedup?

                    \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq 1.32 \cdot 10^{+20}:\\ \;\;\;\;\mathsf{fma}\left(\left(\left(\left(1 - x\right) \cdot x\right) \cdot eps\_m\right) \cdot eps\_m, x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.5, -1\right), x, 1\right) \cdot \left(\left(2 + x\right) + x\right)\right) \cdot 0.5\\ \end{array} \end{array} \]
                    eps_m = (fabs.f64 eps)
                    (FPCore (x eps_m)
                     :precision binary64
                     (if (<= x 1.32e+20)
                       (* (fma (* (* (* (- 1.0 x) x) eps_m) eps_m) x 2.0) 0.5)
                       (* (* (fma (fma x 0.5 -1.0) x 1.0) (+ (+ 2.0 x) x)) 0.5)))
                    eps_m = fabs(eps);
                    double code(double x, double eps_m) {
                    	double tmp;
                    	if (x <= 1.32e+20) {
                    		tmp = fma(((((1.0 - x) * x) * eps_m) * eps_m), x, 2.0) * 0.5;
                    	} else {
                    		tmp = (fma(fma(x, 0.5, -1.0), x, 1.0) * ((2.0 + x) + x)) * 0.5;
                    	}
                    	return tmp;
                    }
                    
                    eps_m = abs(eps)
                    function code(x, eps_m)
                    	tmp = 0.0
                    	if (x <= 1.32e+20)
                    		tmp = Float64(fma(Float64(Float64(Float64(Float64(1.0 - x) * x) * eps_m) * eps_m), x, 2.0) * 0.5);
                    	else
                    		tmp = Float64(Float64(fma(fma(x, 0.5, -1.0), x, 1.0) * Float64(Float64(2.0 + x) + x)) * 0.5);
                    	end
                    	return tmp
                    end
                    
                    eps_m = N[Abs[eps], $MachinePrecision]
                    code[x_, eps$95$m_] := If[LessEqual[x, 1.32e+20], N[(N[(N[(N[(N[(N[(1.0 - x), $MachinePrecision] * x), $MachinePrecision] * eps$95$m), $MachinePrecision] * eps$95$m), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(x * 0.5 + -1.0), $MachinePrecision] * x + 1.0), $MachinePrecision] * N[(N[(2.0 + x), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
                    
                    \begin{array}{l}
                    eps_m = \left|\varepsilon\right|
                    
                    \\
                    \begin{array}{l}
                    \mathbf{if}\;x \leq 1.32 \cdot 10^{+20}:\\
                    \;\;\;\;\mathsf{fma}\left(\left(\left(\left(1 - x\right) \cdot x\right) \cdot eps\_m\right) \cdot eps\_m, x, 2\right) \cdot 0.5\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.5, -1\right), x, 1\right) \cdot \left(\left(2 + x\right) + x\right)\right) \cdot 0.5\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if x < 1.32e20

                      1. Initial program 67.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 inf

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

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

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

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

                        \[\leadsto \left(2 + x \cdot \left(\left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2} + \left(\frac{1}{2} \cdot {\left(\varepsilon - 1\right)}^{2} + x \cdot \left(\frac{-1}{6} \cdot {\left(1 + \varepsilon\right)}^{3} + \frac{1}{6} \cdot {\left(\varepsilon - 1\right)}^{3}\right)\right)\right)\right)\right) - 1\right)\right) \cdot \frac{1}{2} \]
                      7. Applied rewrites55.3%

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

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

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

                        if 1.32e20 < 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 \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)} \]
                        4. 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}} \]
                        5. Applied rewrites50.1%

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

                          \[\leadsto \left(\left(1 + x \cdot \left(\frac{1}{2} \cdot x - 1\right)\right) \cdot \left(\left(x + 2\right) + x\right)\right) \cdot \frac{1}{2} \]
                        7. Step-by-step derivation
                          1. Applied rewrites42.6%

                            \[\leadsto \left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.5, -1\right), x, 1\right) \cdot \left(\left(x + 2\right) + x\right)\right) \cdot 0.5 \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification74.1%

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

                        Alternative 12: 62.1% accurate, 9.1× speedup?

                        \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -210000:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 1\right), x, -2\right), x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), x \cdot x, 1\right)\\ \end{array} \end{array} \]
                        eps_m = (fabs.f64 eps)
                        (FPCore (x eps_m)
                         :precision binary64
                         (if (<= x -210000.0)
                           (* (fma (fma (fma -0.3333333333333333 x 1.0) x -2.0) x 2.0) 0.5)
                           (fma (fma 0.3333333333333333 x -0.5) (* x x) 1.0)))
                        eps_m = fabs(eps);
                        double code(double x, double eps_m) {
                        	double tmp;
                        	if (x <= -210000.0) {
                        		tmp = fma(fma(fma(-0.3333333333333333, x, 1.0), x, -2.0), x, 2.0) * 0.5;
                        	} else {
                        		tmp = fma(fma(0.3333333333333333, x, -0.5), (x * x), 1.0);
                        	}
                        	return tmp;
                        }
                        
                        eps_m = abs(eps)
                        function code(x, eps_m)
                        	tmp = 0.0
                        	if (x <= -210000.0)
                        		tmp = Float64(fma(fma(fma(-0.3333333333333333, x, 1.0), x, -2.0), x, 2.0) * 0.5);
                        	else
                        		tmp = fma(fma(0.3333333333333333, x, -0.5), Float64(x * x), 1.0);
                        	end
                        	return tmp
                        end
                        
                        eps_m = N[Abs[eps], $MachinePrecision]
                        code[x_, eps$95$m_] := If[LessEqual[x, -210000.0], N[(N[(N[(N[(-0.3333333333333333 * x + 1.0), $MachinePrecision] * x + -2.0), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(0.3333333333333333 * x + -0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]]
                        
                        \begin{array}{l}
                        eps_m = \left|\varepsilon\right|
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;x \leq -210000:\\
                        \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 1\right), x, -2\right), x, 2\right) \cdot 0.5\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), x \cdot x, 1\right)\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if x < -2.1e5

                          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 \color{blue}{\frac{1}{2} \cdot \left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} - -1 \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)} \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

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

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

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

                            \[\leadsto \left(2 + x \cdot \left(\left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2} + \left(\frac{1}{2} \cdot {\left(\varepsilon - 1\right)}^{2} + x \cdot \left(\frac{-1}{6} \cdot {\left(1 + \varepsilon\right)}^{3} + \frac{1}{6} \cdot {\left(\varepsilon - 1\right)}^{3}\right)\right)\right)\right)\right) - 1\right)\right) \cdot \frac{1}{2} \]
                          7. Applied rewrites31.6%

                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(1 - \varepsilon, 1 - \varepsilon, \left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right), 0.5, \mathsf{fma}\left(0.16666666666666666 \cdot \left(\varepsilon - 1\right), \left(1 - \varepsilon\right) \cdot \left(1 - \varepsilon\right), \left(-0.16666666666666666 \cdot \left(1 + \varepsilon\right)\right) \cdot \left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right)\right) \cdot x\right), x, \left(\varepsilon - 1\right) - \varepsilon\right) - 1, x, 2\right) \cdot 0.5 \]
                          8. Taylor expanded in eps around 0

                            \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                          9. Step-by-step derivation
                            1. Applied rewrites67.3%

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

                            if -2.1e5 < x

                            1. Initial program 73.2%

                              \[\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 \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)} \]
                            4. 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}} \]
                            5. Applied rewrites65.5%

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

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

                                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), \color{blue}{x \cdot x}, 1\right) \]
                            8. Recombined 2 regimes into one program.
                            9. Add Preprocessing

                            Alternative 13: 59.8% accurate, 11.4× speedup?

                            \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -62:\\ \;\;\;\;\left(\mathsf{fma}\left(-1 - eps\_m, x, 1\right) + 1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), x \cdot x, 1\right)\\ \end{array} \end{array} \]
                            eps_m = (fabs.f64 eps)
                            (FPCore (x eps_m)
                             :precision binary64
                             (if (<= x -62.0)
                               (* (+ (fma (- -1.0 eps_m) x 1.0) 1.0) 0.5)
                               (fma (fma 0.3333333333333333 x -0.5) (* x x) 1.0)))
                            eps_m = fabs(eps);
                            double code(double x, double eps_m) {
                            	double tmp;
                            	if (x <= -62.0) {
                            		tmp = (fma((-1.0 - eps_m), x, 1.0) + 1.0) * 0.5;
                            	} else {
                            		tmp = fma(fma(0.3333333333333333, x, -0.5), (x * x), 1.0);
                            	}
                            	return tmp;
                            }
                            
                            eps_m = abs(eps)
                            function code(x, eps_m)
                            	tmp = 0.0
                            	if (x <= -62.0)
                            		tmp = Float64(Float64(fma(Float64(-1.0 - eps_m), x, 1.0) + 1.0) * 0.5);
                            	else
                            		tmp = fma(fma(0.3333333333333333, x, -0.5), Float64(x * x), 1.0);
                            	end
                            	return tmp
                            end
                            
                            eps_m = N[Abs[eps], $MachinePrecision]
                            code[x_, eps$95$m_] := If[LessEqual[x, -62.0], N[(N[(N[(N[(-1.0 - eps$95$m), $MachinePrecision] * x + 1.0), $MachinePrecision] + 1.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(0.3333333333333333 * x + -0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]]
                            
                            \begin{array}{l}
                            eps_m = \left|\varepsilon\right|
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;x \leq -62:\\
                            \;\;\;\;\left(\mathsf{fma}\left(-1 - eps\_m, x, 1\right) + 1\right) \cdot 0.5\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), x \cdot x, 1\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 2 regimes
                            2. if x < -62

                              1. Initial program 97.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 \color{blue}{\frac{1}{2} \cdot \left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} - -1 \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)} \]
                              4. Step-by-step derivation
                                1. *-commutativeN/A

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

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

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

                                \[\leadsto \left(e^{\left(-1 - \varepsilon\right) \cdot x} + 1\right) \cdot \frac{1}{2} \]
                              7. Step-by-step derivation
                                1. Applied rewrites44.9%

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

                                  \[\leadsto \left(\left(1 + -1 \cdot \left(x \cdot \left(1 + \varepsilon\right)\right)\right) + 1\right) \cdot \frac{1}{2} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites20.4%

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

                                  if -62 < x

                                  1. Initial program 73.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 \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)} \]
                                  4. 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}} \]
                                  5. Applied rewrites65.6%

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

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

                                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), \color{blue}{x \cdot x}, 1\right) \]
                                  8. Recombined 2 regimes into one program.
                                  9. Add Preprocessing

                                  Alternative 14: 52.5% accurate, 15.2× speedup?

                                  \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), x \cdot x, 1\right) \end{array} \]
                                  eps_m = (fabs.f64 eps)
                                  (FPCore (x eps_m)
                                   :precision binary64
                                   (fma (fma 0.3333333333333333 x -0.5) (* x x) 1.0))
                                  eps_m = fabs(eps);
                                  double code(double x, double eps_m) {
                                  	return fma(fma(0.3333333333333333, x, -0.5), (x * x), 1.0);
                                  }
                                  
                                  eps_m = abs(eps)
                                  function code(x, eps_m)
                                  	return fma(fma(0.3333333333333333, x, -0.5), Float64(x * x), 1.0)
                                  end
                                  
                                  eps_m = N[Abs[eps], $MachinePrecision]
                                  code[x_, eps$95$m_] := N[(N[(0.3333333333333333 * x + -0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]
                                  
                                  \begin{array}{l}
                                  eps_m = \left|\varepsilon\right|
                                  
                                  \\
                                  \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), x \cdot x, 1\right)
                                  \end{array}
                                  
                                  Derivation
                                  1. Initial program 76.9%

                                    \[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
                                  2. Add Preprocessing
                                  3. 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)} \]
                                  4. 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}} \]
                                  5. Applied rewrites56.6%

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

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

                                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(0.3333333333333333, x, -0.5\right), \color{blue}{x \cdot x}, 1\right) \]
                                    2. Add Preprocessing

                                    Alternative 15: 44.0% accurate, 273.0× speedup?

                                    \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ 1 \end{array} \]
                                    eps_m = (fabs.f64 eps)
                                    (FPCore (x eps_m) :precision binary64 1.0)
                                    eps_m = fabs(eps);
                                    double code(double x, double eps_m) {
                                    	return 1.0;
                                    }
                                    
                                    eps_m = abs(eps)
                                    real(8) function code(x, eps_m)
                                        real(8), intent (in) :: x
                                        real(8), intent (in) :: eps_m
                                        code = 1.0d0
                                    end function
                                    
                                    eps_m = Math.abs(eps);
                                    public static double code(double x, double eps_m) {
                                    	return 1.0;
                                    }
                                    
                                    eps_m = math.fabs(eps)
                                    def code(x, eps_m):
                                    	return 1.0
                                    
                                    eps_m = abs(eps)
                                    function code(x, eps_m)
                                    	return 1.0
                                    end
                                    
                                    eps_m = abs(eps);
                                    function tmp = code(x, eps_m)
                                    	tmp = 1.0;
                                    end
                                    
                                    eps_m = N[Abs[eps], $MachinePrecision]
                                    code[x_, eps$95$m_] := 1.0
                                    
                                    \begin{array}{l}
                                    eps_m = \left|\varepsilon\right|
                                    
                                    \\
                                    1
                                    \end{array}
                                    
                                    Derivation
                                    1. Initial program 76.9%

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

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

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

                                      Reproduce

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