NMSE Section 6.1 mentioned, A

Percentage Accurate: 73.4% → 99.7%
Time: 16.1s
Alternatives: 14
Speedup: 14.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 14 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.7% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{x + 1}{e^{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eps < 126

    1. Initial program 67.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.4%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. clear-numN/A

        \[\leadsto \frac{x + 1}{\color{blue}{e^{x}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x + 1\right), \color{blue}{\left(e^{x}\right)}\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{\color{blue}{x}}\right)\right) \]
      8. exp-lowering-exp.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right) \]
    7. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{x + 1}{e^{x}}} \]

    if 126 < 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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\left(\varepsilon \cdot x\right)}\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    8. Simplified100.0%

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

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

Alternative 2: 99.0% accurate, 1.1× speedup?

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

\\
\frac{e^{x \cdot \left(-1 + eps\_m\right)} + e^{x \cdot \left(-1 - eps\_m\right)}}{2}
\end{array}
Derivation
  1. Initial program 75.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
  4. Step-by-step derivation
    1. cancel-sign-sub-invN/A

      \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
    2. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
    3. *-lft-identityN/A

      \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
    4. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    5. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    6. distribute-rgt-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    7. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    8. mul-1-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    9. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    10. distribute-neg-inN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    11. mul-1-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    12. remove-double-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    13. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    14. *-lowering-*.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    15. sub-negN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    16. metadata-evalN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    17. +-commutativeN/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    18. +-lowering-+.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
    19. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
  5. Simplified98.6%

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

Alternative 3: 94.6% accurate, 1.7× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 126:\\ \;\;\;\;\frac{x + 1}{e^{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot eps\_m} + \left(1 + x \cdot \left(\left(-1 - eps\_m\right) + 0.5 \cdot \left(\left(eps\_m + 1\right) \cdot \left(x \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)}{2}\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= eps_m 126.0)
   (/ (+ x 1.0) (exp x))
   (/
    (+
     (exp (* x eps_m))
     (+
      1.0
      (* x (+ (- -1.0 eps_m) (* 0.5 (* (+ eps_m 1.0) (* x (+ eps_m 1.0))))))))
    2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (eps_m <= 126.0) {
		tmp = (x + 1.0) / exp(x);
	} else {
		tmp = (exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((eps_m + 1.0) * (x * (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 <= 126.0d0) then
        tmp = (x + 1.0d0) / exp(x)
    else
        tmp = (exp((x * eps_m)) + (1.0d0 + (x * (((-1.0d0) - eps_m) + (0.5d0 * ((eps_m + 1.0d0) * (x * (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 <= 126.0) {
		tmp = (x + 1.0) / Math.exp(x);
	} else {
		tmp = (Math.exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((eps_m + 1.0) * (x * (eps_m + 1.0)))))))) / 2.0;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if eps_m <= 126.0:
		tmp = (x + 1.0) / math.exp(x)
	else:
		tmp = (math.exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((eps_m + 1.0) * (x * (eps_m + 1.0)))))))) / 2.0
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (eps_m <= 126.0)
		tmp = Float64(Float64(x + 1.0) / exp(x));
	else
		tmp = Float64(Float64(exp(Float64(x * eps_m)) + Float64(1.0 + Float64(x * Float64(Float64(-1.0 - eps_m) + Float64(0.5 * Float64(Float64(eps_m + 1.0) * Float64(x * Float64(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 <= 126.0)
		tmp = (x + 1.0) / exp(x);
	else
		tmp = (exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((eps_m + 1.0) * (x * (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, 126.0], N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(x * N[(N[(-1.0 - eps$95$m), $MachinePrecision] + N[(0.5 * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(x * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{x + 1}{e^{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eps < 126

    1. Initial program 67.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.4%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. clear-numN/A

        \[\leadsto \frac{x + 1}{\color{blue}{e^{x}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x + 1\right), \color{blue}{\left(e^{x}\right)}\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{\color{blue}{x}}\right)\right) \]
      8. exp-lowering-exp.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right) \]
    7. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{x + 1}{e^{x}}} \]

    if 126 < 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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\left(\varepsilon \cdot x\right)}\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    8. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \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)}\right), 2\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot \left(1 + \varepsilon\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot 1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 - \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right) \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      18. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(\left(1 + \varepsilon\right) \cdot x\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      19. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(1 + \varepsilon\right), \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
    11. Simplified86.9%

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

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

Alternative 4: 94.6% accurate, 1.8× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 126:\\ \;\;\;\;\frac{x + 1}{e^{x}}\\ \mathbf{else}:\\ \;\;\;\;\frac{e^{x \cdot eps\_m} + \left(1 + x \cdot \left(\left(-1 - eps\_m\right) + 0.5 \cdot \left(\left(x \cdot eps\_m\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)}{2}\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= eps_m 126.0)
   (/ (+ x 1.0) (exp x))
   (/
    (+
     (exp (* x eps_m))
     (+ 1.0 (* x (+ (- -1.0 eps_m) (* 0.5 (* (* x eps_m) (+ eps_m 1.0)))))))
    2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (eps_m <= 126.0) {
		tmp = (x + 1.0) / exp(x);
	} else {
		tmp = (exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((x * eps_m) * (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 <= 126.0d0) then
        tmp = (x + 1.0d0) / exp(x)
    else
        tmp = (exp((x * eps_m)) + (1.0d0 + (x * (((-1.0d0) - eps_m) + (0.5d0 * ((x * eps_m) * (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 <= 126.0) {
		tmp = (x + 1.0) / Math.exp(x);
	} else {
		tmp = (Math.exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((x * eps_m) * (eps_m + 1.0))))))) / 2.0;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if eps_m <= 126.0:
		tmp = (x + 1.0) / math.exp(x)
	else:
		tmp = (math.exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((x * eps_m) * (eps_m + 1.0))))))) / 2.0
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (eps_m <= 126.0)
		tmp = Float64(Float64(x + 1.0) / exp(x));
	else
		tmp = Float64(Float64(exp(Float64(x * eps_m)) + Float64(1.0 + Float64(x * Float64(Float64(-1.0 - eps_m) + Float64(0.5 * Float64(Float64(x * eps_m) * Float64(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 <= 126.0)
		tmp = (x + 1.0) / exp(x);
	else
		tmp = (exp((x * eps_m)) + (1.0 + (x * ((-1.0 - eps_m) + (0.5 * ((x * eps_m) * (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, 126.0], N[(N[(x + 1.0), $MachinePrecision] / N[Exp[x], $MachinePrecision]), $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[(1.0 + N[(x * N[(N[(-1.0 - eps$95$m), $MachinePrecision] + N[(0.5 * N[(N[(x * eps$95$m), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{x + 1}{e^{x}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eps < 126

    1. Initial program 67.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.4%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. clear-numN/A

        \[\leadsto \frac{x + 1}{\color{blue}{e^{x}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x + 1\right), \color{blue}{\left(e^{x}\right)}\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{\color{blue}{x}}\right)\right) \]
      8. exp-lowering-exp.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right) \]
    7. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{x + 1}{e^{x}}} \]

    if 126 < 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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\left(\varepsilon \cdot x\right)}\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    8. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \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)}\right), 2\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot \left(1 + \varepsilon\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot 1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 - \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right) \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      18. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(\left(1 + \varepsilon\right) \cdot x\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      19. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(1 + \varepsilon\right), \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
    11. Simplified86.9%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \varepsilon\right), \color{blue}{\left(\varepsilon \cdot x\right)}\right)\right)\right)\right)\right)\right), 2\right) \]
    13. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \varepsilon\right), \left(x \cdot \varepsilon\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f6486.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \varepsilon\right), \mathsf{*.f64}\left(x, \varepsilon\right)\right)\right)\right)\right)\right)\right), 2\right) \]
    14. Simplified86.9%

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

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

Alternative 5: 89.2% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
t_0 := -1 + \frac{1}{eps\_m}\\
t_1 := 1 + \frac{1}{eps\_m}\\
\mathbf{if}\;eps\_m \leq 0.027:\\
\;\;\;\;\frac{x + 1}{e^{x}}\\

\mathbf{elif}\;eps\_m \leq 9.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(eps\_m + 1\right) \cdot t\_0 + \left(t\_1 \cdot \left(\left(-1 + eps\_m\right) + \left(x \cdot 0.5\right) \cdot \left(\left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right)\right) + x \cdot \left(t\_0 \cdot \left(-0.5 \cdot \left(\left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)\right)}{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{1}{eps\_m} + \left(1 + t\_0\right)\right) \cdot \left(1 + \left(\frac{0}{eps\_m} - -1\right)\right)}{t\_1 + \left(-1 - \frac{-1}{eps\_m}\right)}}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eps < 0.0269999999999999997

    1. Initial program 66.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.1%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. clear-numN/A

        \[\leadsto \frac{x + 1}{\color{blue}{e^{x}}} \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\left(x + 1\right), \color{blue}{\left(e^{x}\right)}\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{\color{blue}{x}}\right)\right) \]
      8. exp-lowering-exp.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right) \]
    7. Applied egg-rr65.1%

      \[\leadsto \color{blue}{\frac{x + 1}{e^{x}}} \]

    if 0.0269999999999999997 < eps < 9.6000000000000002e106

    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 \mathsf{/.f64}\left(\color{blue}{\left(2 + x \cdot \left(\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) + \left(1 + \frac{1}{\varepsilon}\right) \cdot \left(\varepsilon - 1\right)\right) - -1 \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right)\right)}, 2\right) \]
    4. Simplified80.9%

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

    if 9.6000000000000002e106 < 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 \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\varepsilon} - 1\right)}\right), 2\right) \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\frac{1}{\varepsilon} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\frac{1}{\varepsilon} + -1\right)\right), 2\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(-1 + \frac{1}{\varepsilon}\right)\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \left(\frac{1}{\varepsilon}\right)\right)\right), 2\right) \]
      5. /-lowering-/.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    5. Simplified61.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{1}{\varepsilon}\right)}, \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{\varepsilon}\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
      2. /-lowering-/.f6417.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    8. Simplified17.0%

      \[\leadsto \frac{\color{blue}{\left(1 + \frac{1}{\varepsilon}\right)} - \left(-1 + \frac{1}{\varepsilon}\right)}{2} \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + \frac{1}{\varepsilon}\right) + \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)\right), 2\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}\right), 2\right) \]
      3. sqr-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}\right), 2\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)\right), \left(\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)\right)\right), 2\right) \]
    10. Applied egg-rr84.7%

      \[\leadsto \frac{\color{blue}{\frac{\left(\frac{1}{\varepsilon} + \left(1 + \left(-1 + \frac{1}{\varepsilon}\right)\right)\right) \cdot \left(1 + \left(\frac{0}{\varepsilon} - -1\right)\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(1 + \frac{-1}{\varepsilon}\right)}}}{2} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification69.5%

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

Alternative 6: 88.4% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 90000:\\
\;\;\;\;e^{0 - x}\\

\mathbf{elif}\;eps\_m \leq 7.1 \cdot 10^{+106}:\\
\;\;\;\;\frac{2 + \left(x \cdot \left(-1 + x \cdot 0.5\right) + eps\_m \cdot \left(x \cdot x + eps\_m \cdot \left(x \cdot x\right)\right)\right)}{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eps < 9e4

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

      \[\leadsto \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified98.1%

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

      \[\leadsto \color{blue}{e^{-1 \cdot x}} \]
    7. Step-by-step derivation
      1. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot x\right)\right) \]
      2. neg-mul-1N/A

        \[\leadsto \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x\right)\right)\right) \]
      3. neg-sub0N/A

        \[\leadsto \mathsf{exp.f64}\left(\left(0 - x\right)\right) \]
      4. --lowering--.f6475.2%

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, x\right)\right) \]
    8. Simplified75.2%

      \[\leadsto \color{blue}{e^{0 - x}} \]

    if 9e4 < eps < 7.1000000000000003e106

    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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\left(\varepsilon \cdot x\right)}\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    8. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \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)}\right), 2\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot \left(1 + \varepsilon\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot 1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 - \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right) \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      18. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(\left(1 + \varepsilon\right) \cdot x\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      19. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(1 + \varepsilon\right), \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
    11. Simplified82.6%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 + \left(\varepsilon \cdot \left(x + \left(\varepsilon \cdot {x}^{2} + x \cdot \left(x - 1\right)\right)\right) + x \cdot \left(\frac{1}{2} \cdot x - 1\right)\right)\right)}, 2\right) \]
    13. Simplified82.6%

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

    if 7.1000000000000003e106 < 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 \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\varepsilon} - 1\right)}\right), 2\right) \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\frac{1}{\varepsilon} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\frac{1}{\varepsilon} + -1\right)\right), 2\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(-1 + \frac{1}{\varepsilon}\right)\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \left(\frac{1}{\varepsilon}\right)\right)\right), 2\right) \]
      5. /-lowering-/.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    5. Simplified61.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{1}{\varepsilon}\right)}, \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{\varepsilon}\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
      2. /-lowering-/.f6417.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    8. Simplified17.0%

      \[\leadsto \frac{\color{blue}{\left(1 + \frac{1}{\varepsilon}\right)} - \left(-1 + \frac{1}{\varepsilon}\right)}{2} \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + \frac{1}{\varepsilon}\right) + \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)\right), 2\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}\right), 2\right) \]
      3. sqr-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}\right), 2\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)\right), \left(\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)\right)\right), 2\right) \]
    10. Applied egg-rr84.7%

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

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

Alternative 7: 81.6% accurate, 3.5× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := -1 + \frac{1}{eps\_m}\\ t_1 := 1 + \frac{1}{eps\_m}\\ \mathbf{if}\;eps\_m \leq 0.027:\\ \;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\ \mathbf{elif}\;eps\_m \leq 1.1 \cdot 10^{+107}:\\ \;\;\;\;\frac{2 + x \cdot \left(\left(eps\_m + 1\right) \cdot t\_0 + \left(t\_1 \cdot \left(\left(-1 + eps\_m\right) + \left(x \cdot 0.5\right) \cdot \left(\left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right)\right) + x \cdot \left(t\_0 \cdot \left(-0.5 \cdot \left(\left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\frac{1}{eps\_m} + \left(1 + t\_0\right)\right) \cdot \left(1 + \left(\frac{0}{eps\_m} - -1\right)\right)}{t\_1 + \left(-1 - \frac{-1}{eps\_m}\right)}}{2}\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (let* ((t_0 (+ -1.0 (/ 1.0 eps_m))) (t_1 (+ 1.0 (/ 1.0 eps_m))))
   (if (<= eps_m 0.027)
     (/ 1.0 (+ 1.0 (* 0.5 (* x x))))
     (if (<= eps_m 1.1e+107)
       (/
        (+
         2.0
         (*
          x
          (+
           (* (+ eps_m 1.0) t_0)
           (+
            (*
             t_1
             (+ (+ -1.0 eps_m) (* (* x 0.5) (* (- 1.0 eps_m) (- 1.0 eps_m)))))
            (* x (* t_0 (* -0.5 (* (+ eps_m 1.0) (+ eps_m 1.0)))))))))
        2.0)
       (/
        (/
         (* (+ (/ 1.0 eps_m) (+ 1.0 t_0)) (+ 1.0 (- (/ 0.0 eps_m) -1.0)))
         (+ t_1 (- -1.0 (/ -1.0 eps_m))))
        2.0)))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double t_0 = -1.0 + (1.0 / eps_m);
	double t_1 = 1.0 + (1.0 / eps_m);
	double tmp;
	if (eps_m <= 0.027) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else if (eps_m <= 1.1e+107) {
		tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
	} else {
		tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / eps_m)))) / 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) :: t_0
    real(8) :: t_1
    real(8) :: tmp
    t_0 = (-1.0d0) + (1.0d0 / eps_m)
    t_1 = 1.0d0 + (1.0d0 / eps_m)
    if (eps_m <= 0.027d0) then
        tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
    else if (eps_m <= 1.1d+107) then
        tmp = (2.0d0 + (x * (((eps_m + 1.0d0) * t_0) + ((t_1 * (((-1.0d0) + eps_m) + ((x * 0.5d0) * ((1.0d0 - eps_m) * (1.0d0 - eps_m))))) + (x * (t_0 * ((-0.5d0) * ((eps_m + 1.0d0) * (eps_m + 1.0d0))))))))) / 2.0d0
    else
        tmp = ((((1.0d0 / eps_m) + (1.0d0 + t_0)) * (1.0d0 + ((0.0d0 / eps_m) - (-1.0d0)))) / (t_1 + ((-1.0d0) - ((-1.0d0) / eps_m)))) / 2.0d0
    end if
    code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
	double t_0 = -1.0 + (1.0 / eps_m);
	double t_1 = 1.0 + (1.0 / eps_m);
	double tmp;
	if (eps_m <= 0.027) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else if (eps_m <= 1.1e+107) {
		tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
	} else {
		tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / eps_m)))) / 2.0;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	t_0 = -1.0 + (1.0 / eps_m)
	t_1 = 1.0 + (1.0 / eps_m)
	tmp = 0
	if eps_m <= 0.027:
		tmp = 1.0 / (1.0 + (0.5 * (x * x)))
	elif eps_m <= 1.1e+107:
		tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0
	else:
		tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / eps_m)))) / 2.0
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	t_0 = Float64(-1.0 + Float64(1.0 / eps_m))
	t_1 = Float64(1.0 + Float64(1.0 / eps_m))
	tmp = 0.0
	if (eps_m <= 0.027)
		tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x))));
	elseif (eps_m <= 1.1e+107)
		tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(Float64(eps_m + 1.0) * t_0) + Float64(Float64(t_1 * Float64(Float64(-1.0 + eps_m) + Float64(Float64(x * 0.5) * Float64(Float64(1.0 - eps_m) * Float64(1.0 - eps_m))))) + Float64(x * Float64(t_0 * Float64(-0.5 * Float64(Float64(eps_m + 1.0) * Float64(eps_m + 1.0))))))))) / 2.0);
	else
		tmp = Float64(Float64(Float64(Float64(Float64(1.0 / eps_m) + Float64(1.0 + t_0)) * Float64(1.0 + Float64(Float64(0.0 / eps_m) - -1.0))) / Float64(t_1 + Float64(-1.0 - Float64(-1.0 / eps_m)))) / 2.0);
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	t_0 = -1.0 + (1.0 / eps_m);
	t_1 = 1.0 + (1.0 / eps_m);
	tmp = 0.0;
	if (eps_m <= 0.027)
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	elseif (eps_m <= 1.1e+107)
		tmp = (2.0 + (x * (((eps_m + 1.0) * t_0) + ((t_1 * ((-1.0 + eps_m) + ((x * 0.5) * ((1.0 - eps_m) * (1.0 - eps_m))))) + (x * (t_0 * (-0.5 * ((eps_m + 1.0) * (eps_m + 1.0))))))))) / 2.0;
	else
		tmp = ((((1.0 / eps_m) + (1.0 + t_0)) * (1.0 + ((0.0 / eps_m) - -1.0))) / (t_1 + (-1.0 - (-1.0 / eps_m)))) / 2.0;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 0.027], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[eps$95$m, 1.1e+107], N[(N[(2.0 + N[(x * N[(N[(N[(eps$95$m + 1.0), $MachinePrecision] * t$95$0), $MachinePrecision] + N[(N[(t$95$1 * N[(N[(-1.0 + eps$95$m), $MachinePrecision] + N[(N[(x * 0.5), $MachinePrecision] * N[(N[(1.0 - eps$95$m), $MachinePrecision] * N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(t$95$0 * N[(-0.5 * N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(0.0 / eps$95$m), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 + N[(-1.0 - N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
t_0 := -1 + \frac{1}{eps\_m}\\
t_1 := 1 + \frac{1}{eps\_m}\\
\mathbf{if}\;eps\_m \leq 0.027:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\

\mathbf{elif}\;eps\_m \leq 1.1 \cdot 10^{+107}:\\
\;\;\;\;\frac{2 + x \cdot \left(\left(eps\_m + 1\right) \cdot t\_0 + \left(t\_1 \cdot \left(\left(-1 + eps\_m\right) + \left(x \cdot 0.5\right) \cdot \left(\left(1 - eps\_m\right) \cdot \left(1 - eps\_m\right)\right)\right) + x \cdot \left(t\_0 \cdot \left(-0.5 \cdot \left(\left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)\right)\right)}{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\left(\frac{1}{eps\_m} + \left(1 + t\_0\right)\right) \cdot \left(1 + \left(\frac{0}{eps\_m} - -1\right)\right)}{t\_1 + \left(-1 - \frac{-1}{eps\_m}\right)}}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eps < 0.0269999999999999997

    1. Initial program 66.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.1%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{e^{x}}{x + 1}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(e^{x}\right), \color{blue}{\left(x + 1\right)}\right)\right) \]
      7. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \left(\color{blue}{x} + 1\right)\right)\right) \]
      8. +-lowering-+.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
    7. Applied egg-rr65.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{e^{x}}{x + 1}}} \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + \frac{1}{2} \cdot {x}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({x}^{2}\right)}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot \color{blue}{x}\right)\right)\right)\right) \]
      4. *-lowering-*.f6457.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
    10. Simplified57.1%

      \[\leadsto \frac{1}{\color{blue}{1 + 0.5 \cdot \left(x \cdot x\right)}} \]

    if 0.0269999999999999997 < eps < 1.1e107

    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 \mathsf{/.f64}\left(\color{blue}{\left(2 + x \cdot \left(\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) + \left(1 + \frac{1}{\varepsilon}\right) \cdot \left(\varepsilon - 1\right)\right) - -1 \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right)\right)}, 2\right) \]
    4. Simplified80.9%

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

    if 1.1e107 < 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 \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\varepsilon} - 1\right)}\right), 2\right) \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\frac{1}{\varepsilon} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\frac{1}{\varepsilon} + -1\right)\right), 2\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(-1 + \frac{1}{\varepsilon}\right)\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \left(\frac{1}{\varepsilon}\right)\right)\right), 2\right) \]
      5. /-lowering-/.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    5. Simplified61.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{1}{\varepsilon}\right)}, \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{\varepsilon}\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
      2. /-lowering-/.f6417.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    8. Simplified17.0%

      \[\leadsto \frac{\color{blue}{\left(1 + \frac{1}{\varepsilon}\right)} - \left(-1 + \frac{1}{\varepsilon}\right)}{2} \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + \frac{1}{\varepsilon}\right) + \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)\right), 2\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}\right), 2\right) \]
      3. sqr-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}\right), 2\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)\right), \left(\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)\right)\right), 2\right) \]
    10. Applied egg-rr84.7%

      \[\leadsto \frac{\color{blue}{\frac{\left(\frac{1}{\varepsilon} + \left(1 + \left(-1 + \frac{1}{\varepsilon}\right)\right)\right) \cdot \left(1 + \left(\frac{0}{\varepsilon} - -1\right)\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(1 + \frac{-1}{\varepsilon}\right)}}}{2} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.5%

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

Alternative 8: 81.5% accurate, 5.3× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 126:\\ \;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\ \mathbf{elif}\;eps\_m \leq 2.8 \cdot 10^{+106}:\\ \;\;\;\;\frac{2 + \left(x \cdot \left(-1 + x \cdot 0.5\right) + eps\_m \cdot \left(x \cdot x + eps\_m \cdot \left(x \cdot x\right)\right)\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(\frac{1}{eps\_m} + \left(1 + \left(-1 + \frac{1}{eps\_m}\right)\right)\right) \cdot \left(1 + \left(\frac{0}{eps\_m} - -1\right)\right)}{\left(1 + \frac{1}{eps\_m}\right) + \left(-1 - \frac{-1}{eps\_m}\right)}}{2}\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= eps_m 126.0)
   (/ 1.0 (+ 1.0 (* 0.5 (* x x))))
   (if (<= eps_m 2.8e+106)
     (/
      (+
       2.0
       (+ (* x (+ -1.0 (* x 0.5))) (* eps_m (+ (* x x) (* eps_m (* x x))))))
      2.0)
     (/
      (/
       (*
        (+ (/ 1.0 eps_m) (+ 1.0 (+ -1.0 (/ 1.0 eps_m))))
        (+ 1.0 (- (/ 0.0 eps_m) -1.0)))
       (+ (+ 1.0 (/ 1.0 eps_m)) (- -1.0 (/ -1.0 eps_m))))
      2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (eps_m <= 126.0) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else if (eps_m <= 2.8e+106) {
		tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0;
	} else {
		tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((1.0 + (1.0 / eps_m)) + (-1.0 - (-1.0 / eps_m)))) / 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 <= 126.0d0) then
        tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
    else if (eps_m <= 2.8d+106) then
        tmp = (2.0d0 + ((x * ((-1.0d0) + (x * 0.5d0))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0d0
    else
        tmp = ((((1.0d0 / eps_m) + (1.0d0 + ((-1.0d0) + (1.0d0 / eps_m)))) * (1.0d0 + ((0.0d0 / eps_m) - (-1.0d0)))) / ((1.0d0 + (1.0d0 / eps_m)) + ((-1.0d0) - ((-1.0d0) / eps_m)))) / 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 <= 126.0) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else if (eps_m <= 2.8e+106) {
		tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0;
	} else {
		tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((1.0 + (1.0 / eps_m)) + (-1.0 - (-1.0 / eps_m)))) / 2.0;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if eps_m <= 126.0:
		tmp = 1.0 / (1.0 + (0.5 * (x * x)))
	elif eps_m <= 2.8e+106:
		tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0
	else:
		tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((1.0 + (1.0 / eps_m)) + (-1.0 - (-1.0 / eps_m)))) / 2.0
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (eps_m <= 126.0)
		tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x))));
	elseif (eps_m <= 2.8e+106)
		tmp = Float64(Float64(2.0 + Float64(Float64(x * Float64(-1.0 + Float64(x * 0.5))) + Float64(eps_m * Float64(Float64(x * x) + Float64(eps_m * Float64(x * x)))))) / 2.0);
	else
		tmp = Float64(Float64(Float64(Float64(Float64(1.0 / eps_m) + Float64(1.0 + Float64(-1.0 + Float64(1.0 / eps_m)))) * Float64(1.0 + Float64(Float64(0.0 / eps_m) - -1.0))) / Float64(Float64(1.0 + Float64(1.0 / eps_m)) + Float64(-1.0 - Float64(-1.0 / eps_m)))) / 2.0);
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	tmp = 0.0;
	if (eps_m <= 126.0)
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	elseif (eps_m <= 2.8e+106)
		tmp = (2.0 + ((x * (-1.0 + (x * 0.5))) + (eps_m * ((x * x) + (eps_m * (x * x)))))) / 2.0;
	else
		tmp = ((((1.0 / eps_m) + (1.0 + (-1.0 + (1.0 / eps_m)))) * (1.0 + ((0.0 / eps_m) - -1.0))) / ((1.0 + (1.0 / eps_m)) + (-1.0 - (-1.0 / eps_m)))) / 2.0;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 126.0], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[eps$95$m, 2.8e+106], N[(N[(2.0 + N[(N[(x * N[(-1.0 + N[(x * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(eps$95$m * N[(N[(x * x), $MachinePrecision] + N[(eps$95$m * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] + N[(1.0 + N[(-1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(1.0 + N[(N[(0.0 / eps$95$m), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(-1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\

\mathbf{elif}\;eps\_m \leq 2.8 \cdot 10^{+106}:\\
\;\;\;\;\frac{2 + \left(x \cdot \left(-1 + x \cdot 0.5\right) + eps\_m \cdot \left(x \cdot x + eps\_m \cdot \left(x \cdot x\right)\right)\right)}{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eps < 126

    1. Initial program 67.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.4%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{e^{x}}{x + 1}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(e^{x}\right), \color{blue}{\left(x + 1\right)}\right)\right) \]
      7. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \left(\color{blue}{x} + 1\right)\right)\right) \]
      8. +-lowering-+.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
    7. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{1}{\frac{e^{x}}{x + 1}}} \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + \frac{1}{2} \cdot {x}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({x}^{2}\right)}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot \color{blue}{x}\right)\right)\right)\right) \]
      4. *-lowering-*.f6457.5%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
    10. Simplified57.5%

      \[\leadsto \frac{1}{\color{blue}{1 + 0.5 \cdot \left(x \cdot x\right)}} \]

    if 126 < eps < 2.79999999999999993e106

    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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\left(\varepsilon \cdot x\right)}\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    8. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \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)}\right), 2\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot \left(1 + \varepsilon\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot 1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 - \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right) \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      18. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(\left(1 + \varepsilon\right) \cdot x\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      19. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(1 + \varepsilon\right), \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
    11. Simplified79.3%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 + \left(\varepsilon \cdot \left(x + \left(\varepsilon \cdot {x}^{2} + x \cdot \left(x - 1\right)\right)\right) + x \cdot \left(\frac{1}{2} \cdot x - 1\right)\right)\right)}, 2\right) \]
    13. Simplified79.3%

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

    if 2.79999999999999993e106 < 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 \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \color{blue}{\left(\frac{1}{\varepsilon} - 1\right)}\right), 2\right) \]
    4. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\frac{1}{\varepsilon} + \left(\mathsf{neg}\left(1\right)\right)\right)\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\frac{1}{\varepsilon} + -1\right)\right), 2\right) \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(-1 + \frac{1}{\varepsilon}\right)\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \left(\frac{1}{\varepsilon}\right)\right)\right), 2\right) \]
      5. /-lowering-/.f6461.6%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    5. Simplified61.6%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\color{blue}{\left(1 + \frac{1}{\varepsilon}\right)}, \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \left(\frac{1}{\varepsilon}\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
      2. /-lowering-/.f6417.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right), 2\right) \]
    8. Simplified17.0%

      \[\leadsto \frac{\color{blue}{\left(1 + \frac{1}{\varepsilon}\right)} - \left(-1 + \frac{1}{\varepsilon}\right)}{2} \]
    9. Step-by-step derivation
      1. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + \frac{1}{\varepsilon}\right) + \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)\right), 2\right) \]
      2. flip-+N/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right) \cdot \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}\right), 2\right) \]
      3. sqr-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)}\right), 2\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + \frac{1}{\varepsilon}\right) - \left(-1 + \frac{1}{\varepsilon}\right) \cdot \left(-1 + \frac{1}{\varepsilon}\right)\right), \left(\left(1 + \frac{1}{\varepsilon}\right) - \left(\mathsf{neg}\left(\left(-1 + \frac{1}{\varepsilon}\right)\right)\right)\right)\right), 2\right) \]
    10. Applied egg-rr84.7%

      \[\leadsto \frac{\color{blue}{\frac{\left(\frac{1}{\varepsilon} + \left(1 + \left(-1 + \frac{1}{\varepsilon}\right)\right)\right) \cdot \left(1 + \left(\frac{0}{\varepsilon} - -1\right)\right)}{\left(1 + \frac{1}{\varepsilon}\right) - \left(1 + \frac{-1}{\varepsilon}\right)}}}{2} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification63.5%

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

Alternative 9: 81.8% accurate, 7.1× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 126:\\ \;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{2 + x \cdot \left(\left(eps\_m + \left(-1 - eps\_m\right)\right) + x \cdot \left(0.5 \cdot \left(eps\_m \cdot eps\_m + \left(eps\_m + 1\right) \cdot \left(eps\_m + 1\right)\right)\right)\right)}{2}\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= eps_m 126.0)
   (/ 1.0 (+ 1.0 (* 0.5 (* x x))))
   (/
    (+
     2.0
     (*
      x
      (+
       (+ eps_m (- -1.0 eps_m))
       (* x (* 0.5 (+ (* eps_m eps_m) (* (+ eps_m 1.0) (+ eps_m 1.0))))))))
    2.0)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (eps_m <= 126.0) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else {
		tmp = (2.0 + (x * ((eps_m + (-1.0 - eps_m)) + (x * (0.5 * ((eps_m * eps_m) + ((eps_m + 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 <= 126.0d0) then
        tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
    else
        tmp = (2.0d0 + (x * ((eps_m + ((-1.0d0) - eps_m)) + (x * (0.5d0 * ((eps_m * eps_m) + ((eps_m + 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 <= 126.0) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else {
		tmp = (2.0 + (x * ((eps_m + (-1.0 - eps_m)) + (x * (0.5 * ((eps_m * eps_m) + ((eps_m + 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 <= 126.0:
		tmp = 1.0 / (1.0 + (0.5 * (x * x)))
	else:
		tmp = (2.0 + (x * ((eps_m + (-1.0 - eps_m)) + (x * (0.5 * ((eps_m * eps_m) + ((eps_m + 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 <= 126.0)
		tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x))));
	else
		tmp = Float64(Float64(2.0 + Float64(x * Float64(Float64(eps_m + Float64(-1.0 - eps_m)) + Float64(x * Float64(0.5 * Float64(Float64(eps_m * eps_m) + Float64(Float64(eps_m + 1.0) * Float64(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 <= 126.0)
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	else
		tmp = (2.0 + (x * ((eps_m + (-1.0 - eps_m)) + (x * (0.5 * ((eps_m * eps_m) + ((eps_m + 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, 126.0], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 + N[(x * N[(N[(eps$95$m + N[(-1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision] + N[(x * N[(0.5 * N[(N[(eps$95$m * eps$95$m), $MachinePrecision] + N[(N[(eps$95$m + 1.0), $MachinePrecision] * N[(eps$95$m + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 126:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eps < 126

    1. Initial program 67.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.4%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{e^{x}}{x + 1}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(e^{x}\right), \color{blue}{\left(x + 1\right)}\right)\right) \]
      7. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \left(\color{blue}{x} + 1\right)\right)\right) \]
      8. +-lowering-+.f6465.4%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
    7. Applied egg-rr65.4%

      \[\leadsto \color{blue}{\frac{1}{\frac{e^{x}}{x + 1}}} \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + \frac{1}{2} \cdot {x}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({x}^{2}\right)}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot \color{blue}{x}\right)\right)\right)\right) \]
      4. *-lowering-*.f6457.5%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
    10. Simplified57.5%

      \[\leadsto \frac{1}{\color{blue}{1 + 0.5 \cdot \left(x \cdot x\right)}} \]

    if 126 < 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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\left(\varepsilon \cdot x\right)}\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    8. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 + x \cdot \left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)}, 2\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \left(x \cdot \left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \left(\varepsilon + \left(-1 \cdot \left(1 + \varepsilon\right) + x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      3. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \left(\left(\varepsilon + -1 \cdot \left(1 + \varepsilon\right)\right) + x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(\varepsilon + -1 \cdot \left(1 + \varepsilon\right)\right), \left(x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \left(-1 \cdot \left(1 + \varepsilon\right)\right)\right), \left(x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      6. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \left(-1 \cdot 1 + -1 \cdot \varepsilon\right)\right), \left(x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \left(-1 + -1 \cdot \varepsilon\right)\right), \left(x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right), \left(x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      9. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \left(-1 - \varepsilon\right)\right), \left(x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      10. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \left(x \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      11. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \left(\frac{1}{2} \cdot {\varepsilon}^{2} + \frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      12. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \left(\frac{1}{2} \cdot \left({\varepsilon}^{2} + {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      13. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \left({\varepsilon}^{2} + {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      14. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(\left({\varepsilon}^{2}\right), \left({\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      15. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(\left(\varepsilon \cdot \varepsilon\right), \left({\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      16. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\varepsilon, \varepsilon\right), \left({\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\varepsilon, \varepsilon\right), \left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      18. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\varepsilon, \varepsilon\right), \mathsf{*.f64}\left(\left(1 + \varepsilon\right), \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      19. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\varepsilon, \varepsilon\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \varepsilon\right), \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      20. +-lowering-+.f6481.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(2, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\varepsilon, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(\mathsf{*.f64}\left(\varepsilon, \varepsilon\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \varepsilon\right), \mathsf{+.f64}\left(1, \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
    11. Simplified81.1%

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

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

Alternative 10: 71.4% accurate, 11.9× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 0.027:\\ \;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\ \mathbf{elif}\;eps\_m \leq 1.75 \cdot 10^{+120}:\\ \;\;\;\;1 + \frac{x \cdot \left(x \cdot 0.25\right)}{eps\_m}\\ \mathbf{else}:\\ \;\;\;\;eps\_m \cdot \left(eps\_m \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= eps_m 0.027)
   (/ 1.0 (+ 1.0 (* 0.5 (* x x))))
   (if (<= eps_m 1.75e+120)
     (+ 1.0 (/ (* x (* x 0.25)) eps_m))
     (* eps_m (* eps_m (* (* x x) 0.25))))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (eps_m <= 0.027) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else if (eps_m <= 1.75e+120) {
		tmp = 1.0 + ((x * (x * 0.25)) / eps_m);
	} else {
		tmp = eps_m * (eps_m * ((x * x) * 0.25));
	}
	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 <= 0.027d0) then
        tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
    else if (eps_m <= 1.75d+120) then
        tmp = 1.0d0 + ((x * (x * 0.25d0)) / eps_m)
    else
        tmp = eps_m * (eps_m * ((x * x) * 0.25d0))
    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 <= 0.027) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else if (eps_m <= 1.75e+120) {
		tmp = 1.0 + ((x * (x * 0.25)) / eps_m);
	} else {
		tmp = eps_m * (eps_m * ((x * x) * 0.25));
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if eps_m <= 0.027:
		tmp = 1.0 / (1.0 + (0.5 * (x * x)))
	elif eps_m <= 1.75e+120:
		tmp = 1.0 + ((x * (x * 0.25)) / eps_m)
	else:
		tmp = eps_m * (eps_m * ((x * x) * 0.25))
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (eps_m <= 0.027)
		tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x))));
	elseif (eps_m <= 1.75e+120)
		tmp = Float64(1.0 + Float64(Float64(x * Float64(x * 0.25)) / eps_m));
	else
		tmp = Float64(eps_m * Float64(eps_m * Float64(Float64(x * x) * 0.25)));
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	tmp = 0.0;
	if (eps_m <= 0.027)
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	elseif (eps_m <= 1.75e+120)
		tmp = 1.0 + ((x * (x * 0.25)) / eps_m);
	else
		tmp = eps_m * (eps_m * ((x * x) * 0.25));
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.027], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[eps$95$m, 1.75e+120], N[(1.0 + N[(N[(x * N[(x * 0.25), $MachinePrecision]), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision], N[(eps$95$m * N[(eps$95$m * N[(N[(x * x), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 0.027:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\

\mathbf{elif}\;eps\_m \leq 1.75 \cdot 10^{+120}:\\
\;\;\;\;1 + \frac{x \cdot \left(x \cdot 0.25\right)}{eps\_m}\\

\mathbf{else}:\\
\;\;\;\;eps\_m \cdot \left(eps\_m \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if eps < 0.0269999999999999997

    1. Initial program 66.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.1%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{e^{x}}{x + 1}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(e^{x}\right), \color{blue}{\left(x + 1\right)}\right)\right) \]
      7. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \left(\color{blue}{x} + 1\right)\right)\right) \]
      8. +-lowering-+.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
    7. Applied egg-rr65.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{e^{x}}{x + 1}}} \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + \frac{1}{2} \cdot {x}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({x}^{2}\right)}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot \color{blue}{x}\right)\right)\right)\right) \]
      4. *-lowering-*.f6457.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
    10. Simplified57.1%

      \[\leadsto \frac{1}{\color{blue}{1 + 0.5 \cdot \left(x \cdot x\right)}} \]

    if 0.0269999999999999997 < eps < 1.75000000000000004e120

    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 \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \color{blue}{\left(\left(-1 \cdot \left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \frac{1}{\varepsilon}\right) - 1\right)}\right), 2\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(-1 \cdot \left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(\left(x \cdot \left(1 + \varepsilon\right)\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) \cdot \left(\frac{1}{\varepsilon} - 1\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      5. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) + 1\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) + 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(1 + \varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      12. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(-1 - \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      14. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), 2\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} + -1\right)\right)\right), 2\right) \]
      16. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(-1 + \frac{1}{\varepsilon}\right)\right)\right), 2\right) \]
      17. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \mathsf{+.f64}\left(-1, \left(\frac{1}{\varepsilon}\right)\right)\right)\right), 2\right) \]
      18. /-lowering-/.f6470.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right)\right), 2\right) \]
    5. Simplified70.5%

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

      \[\leadsto \color{blue}{1 + x \cdot \left(\frac{1}{4} \cdot \left(x \cdot \left(\left(1 + \frac{1}{\varepsilon}\right) \cdot {\left(\varepsilon - 1\right)}^{2}\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)} \]
    7. Simplified81.4%

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

      \[\leadsto \mathsf{+.f64}\left(1, \color{blue}{\left(\frac{1}{4} \cdot \frac{{x}^{2}}{\varepsilon}\right)}\right) \]
    9. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{\frac{1}{4} \cdot {x}^{2}}{\color{blue}{\varepsilon}}\right)\right) \]
      2. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left({x}^{2} \cdot \frac{1}{4}\right), \varepsilon\right)\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\left(x \cdot x\right) \cdot \frac{1}{4}\right), \varepsilon\right)\right) \]
      5. associate-*l*N/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x \cdot \left(x \cdot \frac{1}{4}\right)\right), \varepsilon\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(x \cdot \left(\frac{1}{4} \cdot x\right)\right), \varepsilon\right)\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(\frac{1}{4} \cdot x\right)\right), \varepsilon\right)\right) \]
      8. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \left(x \cdot \frac{1}{4}\right)\right), \varepsilon\right)\right) \]
      9. *-lowering-*.f6474.1%

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \frac{1}{4}\right)\right), \varepsilon\right)\right) \]
    10. Simplified74.1%

      \[\leadsto 1 + \color{blue}{\frac{x \cdot \left(x \cdot 0.25\right)}{\varepsilon}} \]

    if 1.75000000000000004e120 < 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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\left(\varepsilon \cdot x\right)}\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f64100.0%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    8. Simplified100.0%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \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)}\right), 2\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot \left(1 + \varepsilon\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot 1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 - \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right) \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      18. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(\left(1 + \varepsilon\right) \cdot x\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      19. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(1 + \varepsilon\right), \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
    11. Simplified91.0%

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

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

        \[\leadsto \left({\varepsilon}^{2} \cdot {x}^{2}\right) \cdot \color{blue}{\frac{1}{4}} \]
      2. associate-*r*N/A

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

        \[\leadsto {\varepsilon}^{2} \cdot \left(\frac{1}{4} \cdot \color{blue}{{x}^{2}}\right) \]
      4. unpow2N/A

        \[\leadsto \left(\varepsilon \cdot \varepsilon\right) \cdot \left(\color{blue}{\frac{1}{4}} \cdot {x}^{2}\right) \]
      5. associate-*l*N/A

        \[\leadsto \varepsilon \cdot \color{blue}{\left(\varepsilon \cdot \left(\frac{1}{4} \cdot {x}^{2}\right)\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left(\varepsilon \cdot \left(\frac{1}{4} \cdot {x}^{2}\right)\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left(\frac{1}{4} \cdot {x}^{2}\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\frac{1}{4}, \color{blue}{\left({x}^{2}\right)}\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\frac{1}{4}, \left(x \cdot \color{blue}{x}\right)\right)\right)\right) \]
      10. *-lowering-*.f6459.9%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
    14. Simplified59.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\varepsilon \leq 0.027:\\ \;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\ \mathbf{elif}\;\varepsilon \leq 1.75 \cdot 10^{+120}:\\ \;\;\;\;1 + \frac{x \cdot \left(x \cdot 0.25\right)}{\varepsilon}\\ \mathbf{else}:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 69.6% accurate, 11.9× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := eps\_m \cdot \left(eps\_m \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\ \mathbf{if}\;x \leq -0.00019:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 0.066:\\ \;\;\;\;\frac{2 - x \cdot x}{2}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (let* ((t_0 (* eps_m (* eps_m (* (* x x) 0.25)))))
   (if (<= x -0.00019) t_0 (if (<= x 0.066) (/ (- 2.0 (* x x)) 2.0) t_0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double t_0 = eps_m * (eps_m * ((x * x) * 0.25));
	double tmp;
	if (x <= -0.00019) {
		tmp = t_0;
	} else if (x <= 0.066) {
		tmp = (2.0 - (x * x)) / 2.0;
	} else {
		tmp = t_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) :: t_0
    real(8) :: tmp
    t_0 = eps_m * (eps_m * ((x * x) * 0.25d0))
    if (x <= (-0.00019d0)) then
        tmp = t_0
    else if (x <= 0.066d0) then
        tmp = (2.0d0 - (x * x)) / 2.0d0
    else
        tmp = t_0
    end if
    code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
	double t_0 = eps_m * (eps_m * ((x * x) * 0.25));
	double tmp;
	if (x <= -0.00019) {
		tmp = t_0;
	} else if (x <= 0.066) {
		tmp = (2.0 - (x * x)) / 2.0;
	} else {
		tmp = t_0;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	t_0 = eps_m * (eps_m * ((x * x) * 0.25))
	tmp = 0
	if x <= -0.00019:
		tmp = t_0
	elif x <= 0.066:
		tmp = (2.0 - (x * x)) / 2.0
	else:
		tmp = t_0
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	t_0 = Float64(eps_m * Float64(eps_m * Float64(Float64(x * x) * 0.25)))
	tmp = 0.0
	if (x <= -0.00019)
		tmp = t_0;
	elseif (x <= 0.066)
		tmp = Float64(Float64(2.0 - Float64(x * x)) / 2.0);
	else
		tmp = t_0;
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	t_0 = eps_m * (eps_m * ((x * x) * 0.25));
	tmp = 0.0;
	if (x <= -0.00019)
		tmp = t_0;
	elseif (x <= 0.066)
		tmp = (2.0 - (x * x)) / 2.0;
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(eps$95$m * N[(eps$95$m * N[(N[(x * x), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -0.00019], t$95$0, If[LessEqual[x, 0.066], N[(N[(2.0 - N[(x * x), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], t$95$0]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
t_0 := eps\_m \cdot \left(eps\_m \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\
\mathbf{if}\;x \leq -0.00019:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;x \leq 0.066:\\
\;\;\;\;\frac{2 - x \cdot x}{2}\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.9000000000000001e-4 or 0.066000000000000003 < 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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + \left(\mathsf{neg}\left(-1\right)\right) \cdot e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\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), 2\right) \]
      3. *-lft-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)} + e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right), 2\right) \]
      4. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(e^{\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)}\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      5. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 - \varepsilon\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      6. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 - \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + -1 \cdot \varepsilon\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      9. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(-1 \cdot \varepsilon + 1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(-1 \cdot \varepsilon\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right) + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      12. remove-double-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      14. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon - 1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      15. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      16. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(\varepsilon + -1\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      17. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      18. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \left(e^{\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)}\right)\right), 2\right) \]
      19. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{+.f64}\left(-1, \varepsilon\right)\right)\right), \mathsf{exp.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
    5. Simplified99.1%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\color{blue}{\left(\varepsilon \cdot x\right)}\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\left(x \cdot \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
      2. *-lowering-*.f6475.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right)\right)\right), 2\right) \]
    8. Simplified75.4%

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \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)}\right), 2\right) \]
    10. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right), 2\right) \]
      2. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      4. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \left(x \cdot \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      5. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x + -1 \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right), 2\right) \]
      6. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(-1 \cdot \left(1 + \varepsilon\right) + \left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot \left(1 + \varepsilon\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      8. distribute-lft-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 \cdot 1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + -1 \cdot \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      10. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      11. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\left(-1 - \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      12. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\left(\frac{1}{2} \cdot {\left(1 + \varepsilon\right)}^{2}\right) \cdot x\right)\right)\right)\right)\right), 2\right) \]
      13. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \left(\frac{1}{2} \cdot \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      15. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot {\left(1 + \varepsilon\right)}^{2}\right)\right)\right)\right)\right)\right), 2\right) \]
      16. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left({\left(1 + \varepsilon\right)}^{2} \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      17. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(\left(1 + \varepsilon\right) \cdot \left(1 + \varepsilon\right)\right) \cdot x\right)\right)\right)\right)\right)\right), 2\right) \]
      18. associate-*l*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(\left(1 + \varepsilon\right) \cdot x\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      19. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \left(\left(1 + \varepsilon\right) \cdot \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
      20. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{exp.f64}\left(\mathsf{*.f64}\left(x, \varepsilon\right)\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{+.f64}\left(\mathsf{\_.f64}\left(-1, \varepsilon\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(1 + \varepsilon\right), \left(x \cdot \left(1 + \varepsilon\right)\right)\right)\right)\right)\right)\right)\right), 2\right) \]
    11. Simplified62.5%

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

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

        \[\leadsto \left({\varepsilon}^{2} \cdot {x}^{2}\right) \cdot \color{blue}{\frac{1}{4}} \]
      2. associate-*r*N/A

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

        \[\leadsto {\varepsilon}^{2} \cdot \left(\frac{1}{4} \cdot \color{blue}{{x}^{2}}\right) \]
      4. unpow2N/A

        \[\leadsto \left(\varepsilon \cdot \varepsilon\right) \cdot \left(\color{blue}{\frac{1}{4}} \cdot {x}^{2}\right) \]
      5. associate-*l*N/A

        \[\leadsto \varepsilon \cdot \color{blue}{\left(\varepsilon \cdot \left(\frac{1}{4} \cdot {x}^{2}\right)\right)} \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left(\varepsilon \cdot \left(\frac{1}{4} \cdot {x}^{2}\right)\right)}\right) \]
      7. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left(\frac{1}{4} \cdot {x}^{2}\right)}\right)\right) \]
      8. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\frac{1}{4}, \color{blue}{\left({x}^{2}\right)}\right)\right)\right) \]
      9. unpow2N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\frac{1}{4}, \left(x \cdot \color{blue}{x}\right)\right)\right)\right) \]
      10. *-lowering-*.f6464.2%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
    14. Simplified64.2%

      \[\leadsto \color{blue}{\varepsilon \cdot \left(\varepsilon \cdot \left(0.25 \cdot \left(x \cdot x\right)\right)\right)} \]

    if -1.9000000000000001e-4 < x < 0.066000000000000003

    1. Initial program 57.7%

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

      \[\leadsto \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6472.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified72.4%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\left(2 + -1 \cdot {x}^{2}\right)}, 2\right) \]
    7. Step-by-step derivation
      1. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 + \left(\mathsf{neg}\left({x}^{2}\right)\right)\right), 2\right) \]
      2. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 - {x}^{2}\right), 2\right) \]
      3. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(2, \left({x}^{2}\right)\right), 2\right) \]
      4. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(2, \left(x \cdot x\right)\right), 2\right) \]
      5. *-lowering-*.f6471.9%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(2, \mathsf{*.f64}\left(x, x\right)\right), 2\right) \]
    8. Simplified71.9%

      \[\leadsto \frac{\color{blue}{2 - x \cdot x}}{2} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification68.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -0.00019:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\ \mathbf{elif}\;x \leq 0.066:\\ \;\;\;\;\frac{2 - x \cdot x}{2}\\ \mathbf{else}:\\ \;\;\;\;\varepsilon \cdot \left(\varepsilon \cdot \left(\left(x \cdot x\right) \cdot 0.25\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 81.7% accurate, 14.2× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;eps\_m \leq 0.027:\\ \;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\ \mathbf{else}:\\ \;\;\;\;1 + x \cdot \left(x \cdot \left(\left(eps\_m \cdot eps\_m\right) \cdot 0.25\right)\right)\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= eps_m 0.027)
   (/ 1.0 (+ 1.0 (* 0.5 (* x x))))
   (+ 1.0 (* x (* x (* (* eps_m eps_m) 0.25))))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (eps_m <= 0.027) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else {
		tmp = 1.0 + (x * (x * ((eps_m * eps_m) * 0.25)));
	}
	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 <= 0.027d0) then
        tmp = 1.0d0 / (1.0d0 + (0.5d0 * (x * x)))
    else
        tmp = 1.0d0 + (x * (x * ((eps_m * eps_m) * 0.25d0)))
    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 <= 0.027) {
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	} else {
		tmp = 1.0 + (x * (x * ((eps_m * eps_m) * 0.25)));
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if eps_m <= 0.027:
		tmp = 1.0 / (1.0 + (0.5 * (x * x)))
	else:
		tmp = 1.0 + (x * (x * ((eps_m * eps_m) * 0.25)))
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (eps_m <= 0.027)
		tmp = Float64(1.0 / Float64(1.0 + Float64(0.5 * Float64(x * x))));
	else
		tmp = Float64(1.0 + Float64(x * Float64(x * Float64(Float64(eps_m * eps_m) * 0.25))));
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	tmp = 0.0;
	if (eps_m <= 0.027)
		tmp = 1.0 / (1.0 + (0.5 * (x * x)));
	else
		tmp = 1.0 + (x * (x * ((eps_m * eps_m) * 0.25)));
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[eps$95$m, 0.027], N[(1.0 / N[(1.0 + N[(0.5 * N[(x * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x * N[(x * N[(N[(eps$95$m * eps$95$m), $MachinePrecision] * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;eps\_m \leq 0.027:\\
\;\;\;\;\frac{1}{1 + 0.5 \cdot \left(x \cdot x\right)}\\

\mathbf{else}:\\
\;\;\;\;1 + x \cdot \left(x \cdot \left(\left(eps\_m \cdot eps\_m\right) \cdot 0.25\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eps < 0.0269999999999999997

    1. Initial program 66.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 \mathsf{/.f64}\left(\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)}, 2\right) \]
    4. Step-by-step derivation
      1. distribute-lft-outN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) - -1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      2. cancel-sign-sub-invN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + \left(\mathsf{neg}\left(-1\right)\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      3. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right) + 1 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      4. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\left(\left(1 + 1\right) \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\left(2 \cdot \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(e^{\mathsf{neg}\left(x\right)} + x \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      7. distribute-rgt1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right), 2\right) \]
      8. exp-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\left(x + 1\right) \cdot \frac{1}{e^{x}}\right)\right), 2\right) \]
      9. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{\left(x + 1\right) \cdot 1}{e^{x}}\right)\right), 2\right) \]
      10. *-rgt-identityN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(\frac{x + 1}{e^{x}}\right)\right), 2\right) \]
      11. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\left(x + 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      12. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \left(e^{x}\right)\right)\right), 2\right) \]
      13. exp-lowering-exp.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(x, 1\right), \mathsf{exp.f64}\left(x\right)\right)\right), 2\right) \]
    5. Simplified65.1%

      \[\leadsto \frac{\color{blue}{2 \cdot \frac{x + 1}{e^{x}}}}{2} \]
    6. Step-by-step derivation
      1. clear-numN/A

        \[\leadsto \frac{1}{\color{blue}{\frac{2}{2 \cdot \frac{x + 1}{e^{x}}}}} \]
      2. associate-/r*N/A

        \[\leadsto \frac{1}{\frac{\frac{2}{2}}{\color{blue}{\frac{x + 1}{e^{x}}}}} \]
      3. metadata-evalN/A

        \[\leadsto \frac{1}{\frac{1}{\frac{\color{blue}{x + 1}}{e^{x}}}} \]
      4. clear-numN/A

        \[\leadsto \frac{1}{\frac{e^{x}}{\color{blue}{x + 1}}} \]
      5. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(\frac{e^{x}}{x + 1}\right)}\right) \]
      6. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(e^{x}\right), \color{blue}{\left(x + 1\right)}\right)\right) \]
      7. exp-lowering-exp.f64N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \left(\color{blue}{x} + 1\right)\right)\right) \]
      8. +-lowering-+.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{exp.f64}\left(x\right), \mathsf{+.f64}\left(x, \color{blue}{1}\right)\right)\right) \]
    7. Applied egg-rr65.1%

      \[\leadsto \color{blue}{\frac{1}{\frac{e^{x}}{x + 1}}} \]
    8. Taylor expanded in x around 0

      \[\leadsto \mathsf{/.f64}\left(1, \color{blue}{\left(1 + \frac{1}{2} \cdot {x}^{2}\right)}\right) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left({x}^{2}\right)}\right)\right)\right) \]
      3. unpow2N/A

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \left(x \cdot \color{blue}{x}\right)\right)\right)\right) \]
      4. *-lowering-*.f6457.1%

        \[\leadsto \mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(x, \color{blue}{x}\right)\right)\right)\right) \]
    10. Simplified57.1%

      \[\leadsto \frac{1}{\color{blue}{1 + 0.5 \cdot \left(x \cdot x\right)}} \]

    if 0.0269999999999999997 < 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 \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \color{blue}{\left(\left(-1 \cdot \left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \frac{1}{\varepsilon}\right) - 1\right)}\right), 2\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(-1 \cdot \left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(\left(x \cdot \left(1 + \varepsilon\right)\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) \cdot \left(\frac{1}{\varepsilon} - 1\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      5. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) + 1\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) + 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(1 + \varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      12. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(-1 - \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      14. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), 2\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} + -1\right)\right)\right), 2\right) \]
      16. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(-1 + \frac{1}{\varepsilon}\right)\right)\right), 2\right) \]
      17. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \mathsf{+.f64}\left(-1, \left(\frac{1}{\varepsilon}\right)\right)\right)\right), 2\right) \]
      18. /-lowering-/.f6463.5%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right)\right), 2\right) \]
    5. Simplified63.5%

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

      \[\leadsto \color{blue}{1 + x \cdot \left(\frac{1}{4} \cdot \left(x \cdot \left(\left(1 + \frac{1}{\varepsilon}\right) \cdot {\left(\varepsilon - 1\right)}^{2}\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)} \]
    7. Simplified80.5%

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

      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \color{blue}{\left(\frac{1}{4} \cdot \left({\varepsilon}^{2} \cdot x\right)\right)}\right)\right) \]
    9. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{4} \cdot {\varepsilon}^{2}\right) \cdot \color{blue}{x}\right)\right)\right) \]
      2. metadata-evalN/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\left(\frac{1}{2} \cdot \frac{1}{2}\right) \cdot {\varepsilon}^{2}\right) \cdot x\right)\right)\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2}\right)\right) \cdot x\right)\right)\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \left(x \cdot \color{blue}{\left(\frac{1}{2} \cdot \left(\frac{1}{2} \cdot {\varepsilon}^{2}\right)\right)}\right)\right)\right) \]
      5. *-lowering-*.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \left(\left(\frac{1}{2} \cdot \frac{1}{2}\right) \cdot \color{blue}{{\varepsilon}^{2}}\right)\right)\right)\right) \]
      7. metadata-evalN/A

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

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

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left({\varepsilon}^{2}\right), \color{blue}{\frac{1}{4}}\right)\right)\right)\right) \]
      10. unpow2N/A

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\left(\varepsilon \cdot \varepsilon\right), \frac{1}{4}\right)\right)\right)\right) \]
      11. *-lowering-*.f6481.3%

        \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(x, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\varepsilon, \varepsilon\right), \frac{1}{4}\right)\right)\right)\right) \]
    10. Simplified81.3%

      \[\leadsto 1 + x \cdot \color{blue}{\left(x \cdot \left(\left(\varepsilon \cdot \varepsilon\right) \cdot 0.25\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 13: 50.7% accurate, 22.7× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -0.00019:\\ \;\;\;\;eps\_m \cdot \left(x \cdot -0.5\right)\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= x -0.00019) (* eps_m (* x -0.5)) 1.0))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (x <= -0.00019) {
		tmp = eps_m * (x * -0.5);
	} else {
		tmp = 1.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 (x <= (-0.00019d0)) then
        tmp = eps_m * (x * (-0.5d0))
    else
        tmp = 1.0d0
    end if
    code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
	double tmp;
	if (x <= -0.00019) {
		tmp = eps_m * (x * -0.5);
	} else {
		tmp = 1.0;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if x <= -0.00019:
		tmp = eps_m * (x * -0.5)
	else:
		tmp = 1.0
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (x <= -0.00019)
		tmp = Float64(eps_m * Float64(x * -0.5));
	else
		tmp = 1.0;
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	tmp = 0.0;
	if (x <= -0.00019)
		tmp = eps_m * (x * -0.5);
	else
		tmp = 1.0;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[x, -0.00019], N[(eps$95$m * N[(x * -0.5), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
\mathbf{if}\;x \leq -0.00019:\\
\;\;\;\;eps\_m \cdot \left(x \cdot -0.5\right)\\

\mathbf{else}:\\
\;\;\;\;1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.9000000000000001e-4

    1. Initial program 97.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 x around 0

      \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \color{blue}{\left(\left(-1 \cdot \left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \frac{1}{\varepsilon}\right) - 1\right)}\right), 2\right) \]
    4. Step-by-step derivation
      1. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(-1 \cdot \left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(x \cdot \left(\left(1 + \varepsilon\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      3. associate-*r*N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(\left(x \cdot \left(1 + \varepsilon\right)\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      4. distribute-lft-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) \cdot \left(\frac{1}{\varepsilon} - 1\right) + \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      5. distribute-lft1-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \left(\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) + 1\right) \cdot \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      6. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right) + 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(\mathsf{neg}\left(x \cdot \left(1 + \varepsilon\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      8. distribute-rgt-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\left(x \cdot \left(\mathsf{neg}\left(\left(1 + \varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      9. *-lowering-*.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\mathsf{neg}\left(\left(1 + \varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      10. distribute-neg-inN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(\left(\mathsf{neg}\left(1\right)\right) + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(-1 + \left(\mathsf{neg}\left(\varepsilon\right)\right)\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      12. unsub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \left(-1 - \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      13. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} - 1\right)\right)\right), 2\right) \]
      14. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} + \left(\mathsf{neg}\left(1\right)\right)\right)\right)\right), 2\right) \]
      15. metadata-evalN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(\frac{1}{\varepsilon} + -1\right)\right)\right), 2\right) \]
      16. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \left(-1 + \frac{1}{\varepsilon}\right)\right)\right), 2\right) \]
      17. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \mathsf{+.f64}\left(-1, \left(\frac{1}{\varepsilon}\right)\right)\right)\right), 2\right) \]
      18. /-lowering-/.f6453.8%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{/.f64}\left(1, \varepsilon\right)\right), \mathsf{exp.f64}\left(\mathsf{neg.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, \varepsilon\right), x\right)\right)\right)\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(x, \mathsf{\_.f64}\left(-1, \varepsilon\right)\right), 1\right), \mathsf{+.f64}\left(-1, \mathsf{/.f64}\left(1, \varepsilon\right)\right)\right)\right), 2\right) \]
    5. Simplified53.8%

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

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

        \[\leadsto \left(\varepsilon \cdot x\right) \cdot \color{blue}{\frac{-1}{2}} \]
      2. associate-*r*N/A

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

        \[\leadsto \varepsilon \cdot \left(\frac{-1}{2} \cdot \color{blue}{x}\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \color{blue}{\left(\frac{-1}{2} \cdot x\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \left(x \cdot \color{blue}{\frac{-1}{2}}\right)\right) \]
      6. *-lowering-*.f6419.7%

        \[\leadsto \mathsf{*.f64}\left(\varepsilon, \mathsf{*.f64}\left(x, \color{blue}{\frac{-1}{2}}\right)\right) \]
    8. Simplified19.7%

      \[\leadsto \color{blue}{\varepsilon \cdot \left(x \cdot -0.5\right)} \]

    if -1.9000000000000001e-4 < x

    1. Initial program 71.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} \]
    4. Step-by-step derivation
      1. Simplified50.0%

        \[\leadsto \color{blue}{1} \]
    5. Recombined 2 regimes into one program.
    6. Add Preprocessing

    Alternative 14: 43.5% accurate, 227.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 75.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 \color{blue}{1} \]
    4. Step-by-step derivation
      1. Simplified43.0%

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

      Reproduce

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