NMSE Section 6.1 mentioned, A

Percentage Accurate: 73.6% → 100.0%
Time: 7.8s
Alternatives: 16
Speedup: 3.0×

Specification

?
\[\begin{array}{l} \\ \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (/
  (-
   (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x))))
   (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x)))))
  2.0))
double code(double x, double eps) {
	return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}

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 16 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.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \end{array} \]
(FPCore (x eps)
 :precision binary64
 (/
  (-
   (* (+ 1.0 (/ 1.0 eps)) (exp (- (* (- 1.0 eps) x))))
   (* (- (/ 1.0 eps) 1.0) (exp (- (* (+ 1.0 eps) x)))))
  2.0))
double code(double x, double eps) {
	return (((1.0 + (1.0 / eps)) * exp(-((1.0 - eps) * x))) - (((1.0 / eps) - 1.0) * exp(-((1.0 + eps) * x)))) / 2.0;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

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

\\
\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2}
\end{array}

Alternative 1: 100.0% accurate, 0.7× speedup?

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

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

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


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

    1. Initial program 64.3%

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

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

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

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

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

    if 1.0000000000000001e-15 < eps

    1. Initial program 99.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. Step-by-step derivation
      1. lift-exp.f64N/A

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

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

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

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

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

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

        \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-1 \cdot \color{blue}{\left(\left(1 + \varepsilon\right) \cdot x\right)}}}{2} \]
      8. exp-prodN/A

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

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

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

        \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot {\left(e^{-1}\right)}^{\left(\color{blue}{\left(\varepsilon + 1\right)} \cdot x\right)}}{2} \]
      12. distribute-rgt1-inN/A

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

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

        \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot {\left(e^{-1}\right)}^{\left(\color{blue}{x \cdot \varepsilon} + x\right)}}{2} \]
      15. lower-fma.f6499.9

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

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

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

Alternative 2: 99.0% accurate, 0.6× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot e^{\left(-1 + eps\_m\right) \cdot x} - \left(\frac{1}{eps\_m} - 1\right) \cdot e^{\left(-1 - eps\_m\right) \cdot x}}{2} \leq 0:\\ \;\;\;\;e^{-x}\\ \mathbf{else}:\\ \;\;\;\;\left(e^{x \cdot eps\_m} + e^{-x \cdot eps\_m}\right) \cdot 0.5\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<=
      (/
       (-
        (* (+ 1.0 (/ 1.0 eps_m)) (exp (* (+ -1.0 eps_m) x)))
        (* (- (/ 1.0 eps_m) 1.0) (exp (* (- -1.0 eps_m) x))))
       2.0)
      0.0)
   (exp (- x))
   (* (+ (exp (* x eps_m)) (exp (- (* x eps_m)))) 0.5)))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (((((1.0 + (1.0 / eps_m)) * exp(((-1.0 + eps_m) * x))) - (((1.0 / eps_m) - 1.0) * exp(((-1.0 - eps_m) * x)))) / 2.0) <= 0.0) {
		tmp = exp(-x);
	} else {
		tmp = (exp((x * eps_m)) + exp(-(x * eps_m))) * 0.5;
	}
	return tmp;
}
eps_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, eps_m)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: eps_m
    real(8) :: tmp
    if (((((1.0d0 + (1.0d0 / eps_m)) * exp((((-1.0d0) + eps_m) * x))) - (((1.0d0 / eps_m) - 1.0d0) * exp((((-1.0d0) - eps_m) * x)))) / 2.0d0) <= 0.0d0) then
        tmp = exp(-x)
    else
        tmp = (exp((x * eps_m)) + exp(-(x * eps_m))) * 0.5d0
    end if
    code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
	double tmp;
	if (((((1.0 + (1.0 / eps_m)) * Math.exp(((-1.0 + eps_m) * x))) - (((1.0 / eps_m) - 1.0) * Math.exp(((-1.0 - eps_m) * x)))) / 2.0) <= 0.0) {
		tmp = Math.exp(-x);
	} else {
		tmp = (Math.exp((x * eps_m)) + Math.exp(-(x * eps_m))) * 0.5;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if ((((1.0 + (1.0 / eps_m)) * math.exp(((-1.0 + eps_m) * x))) - (((1.0 / eps_m) - 1.0) * math.exp(((-1.0 - eps_m) * x)))) / 2.0) <= 0.0:
		tmp = math.exp(-x)
	else:
		tmp = (math.exp((x * eps_m)) + math.exp(-(x * eps_m))) * 0.5
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * exp(Float64(Float64(-1.0 + eps_m) * x))) - Float64(Float64(Float64(1.0 / eps_m) - 1.0) * exp(Float64(Float64(-1.0 - eps_m) * x)))) / 2.0) <= 0.0)
		tmp = exp(Float64(-x));
	else
		tmp = Float64(Float64(exp(Float64(x * eps_m)) + exp(Float64(-Float64(x * eps_m)))) * 0.5);
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	tmp = 0.0;
	if (((((1.0 + (1.0 / eps_m)) * exp(((-1.0 + eps_m) * x))) - (((1.0 / eps_m) - 1.0) * exp(((-1.0 - eps_m) * x)))) / 2.0) <= 0.0)
		tmp = exp(-x);
	else
		tmp = (exp((x * eps_m)) + exp(-(x * eps_m))) * 0.5;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[Exp[N[(N[(-1.0 + eps$95$m), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] * N[Exp[N[(N[(-1.0 - eps$95$m), $MachinePrecision] * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], 0.0], N[Exp[(-x)], $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[Exp[(-N[(x * eps$95$m), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

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

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


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

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

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

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

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

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

      \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
      4. lower-*.f6464.3

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    8. Applied rewrites64.3%

      \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    9. Taylor expanded in eps around 0

      \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
    10. Step-by-step derivation
      1. lift-exp.f64N/A

        \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
      2. lift-neg.f6496.5

        \[\leadsto e^{-x} \]
    11. Applied rewrites96.5%

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

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

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

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

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

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

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

      \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
      4. lower-*.f6499.3

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    8. Applied rewrites99.3%

      \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    9. Taylor expanded in eps around inf

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot \frac{1}{2} \]
      2. lift-*.f6499.3

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot 0.5 \]
    11. Applied rewrites99.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\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} \leq 0:\\ \;\;\;\;e^{-x}\\ \mathbf{else}:\\ \;\;\;\;\left(e^{x \cdot \varepsilon} + e^{-x \cdot \varepsilon}\right) \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 100.0% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 64.3%

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

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

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

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

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

    if 1.0000000000000001e-15 < eps

    1. Initial program 99.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. Step-by-step derivation
      1. lift-exp.f64N/A

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

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

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

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

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

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

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

        \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \frac{1}{e^{\color{blue}{\left(\varepsilon + 1\right)} \cdot x}}}{2} \]
      9. distribute-rgt1-inN/A

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

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

        \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \frac{1}{e^{\color{blue}{x \cdot \varepsilon} + x}}}{2} \]
      12. lower-fma.f6499.9

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

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

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

Alternative 4: 99.2% accurate, 1.2× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := \left(x - -1\right) \cdot e^{-x}\\ \mathbf{if}\;eps\_m \leq 5.1 \cdot 10^{-20}:\\ \;\;\;\;\left(t\_0 + t\_0\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\left(e^{x \cdot eps\_m} + e^{-x \cdot eps\_m}\right) \cdot 0.5\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (let* ((t_0 (* (- x -1.0) (exp (- x)))))
   (if (<= eps_m 5.1e-20)
     (* (+ t_0 t_0) 0.5)
     (* (+ (exp (* x eps_m)) (exp (- (* x eps_m)))) 0.5))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double t_0 = (x - -1.0) * exp(-x);
	double tmp;
	if (eps_m <= 5.1e-20) {
		tmp = (t_0 + t_0) * 0.5;
	} else {
		tmp = (exp((x * eps_m)) + exp(-(x * eps_m))) * 0.5;
	}
	return tmp;
}
eps_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, eps_m)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: eps_m
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (x - (-1.0d0)) * exp(-x)
    if (eps_m <= 5.1d-20) then
        tmp = (t_0 + t_0) * 0.5d0
    else
        tmp = (exp((x * eps_m)) + exp(-(x * eps_m))) * 0.5d0
    end if
    code = tmp
end function
eps_m = Math.abs(eps);
public static double code(double x, double eps_m) {
	double t_0 = (x - -1.0) * Math.exp(-x);
	double tmp;
	if (eps_m <= 5.1e-20) {
		tmp = (t_0 + t_0) * 0.5;
	} else {
		tmp = (Math.exp((x * eps_m)) + Math.exp(-(x * eps_m))) * 0.5;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	t_0 = (x - -1.0) * math.exp(-x)
	tmp = 0
	if eps_m <= 5.1e-20:
		tmp = (t_0 + t_0) * 0.5
	else:
		tmp = (math.exp((x * eps_m)) + math.exp(-(x * eps_m))) * 0.5
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	t_0 = Float64(Float64(x - -1.0) * exp(Float64(-x)))
	tmp = 0.0
	if (eps_m <= 5.1e-20)
		tmp = Float64(Float64(t_0 + t_0) * 0.5);
	else
		tmp = Float64(Float64(exp(Float64(x * eps_m)) + exp(Float64(-Float64(x * eps_m)))) * 0.5);
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	t_0 = (x - -1.0) * exp(-x);
	tmp = 0.0;
	if (eps_m <= 5.1e-20)
		tmp = (t_0 + t_0) * 0.5;
	else
		tmp = (exp((x * eps_m)) + exp(-(x * eps_m))) * 0.5;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(x - -1.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 5.1e-20], N[(N[(t$95$0 + t$95$0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] + N[Exp[(-N[(x * eps$95$m), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

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

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


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

    1. Initial program 64.9%

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

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

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

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

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

    if 5.10000000000000019e-20 < eps

    1. Initial program 97.5%

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

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

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

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

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

      \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
      4. lower-*.f6499.9

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    8. Applied rewrites99.9%

      \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    9. Taylor expanded in eps around inf

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot \frac{1}{2} \]
      2. lift-*.f6499.9

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot 0.5 \]
    11. Applied rewrites99.9%

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

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

Alternative 5: 99.0% accurate, 1.2× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \left(e^{x \cdot \left(-1 + eps\_m\right)} + e^{-\mathsf{fma}\left(x, eps\_m, x\right)}\right) \cdot 0.5 \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (* (+ (exp (* x (+ -1.0 eps_m))) (exp (- (fma x eps_m x)))) 0.5))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	return (exp((x * (-1.0 + eps_m))) + exp(-fma(x, eps_m, x))) * 0.5;
}
eps_m = abs(eps)
function code(x, eps_m)
	return Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) + exp(Float64(-fma(x, eps_m, x)))) * 0.5)
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 * eps$95$m + x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\left(e^{x \cdot \left(-1 + eps\_m\right)} + e^{-\mathsf{fma}\left(x, eps\_m, x\right)}\right) \cdot 0.5
\end{array}
Derivation
  1. Initial program 74.3%

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

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

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

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

    \[\leadsto \color{blue}{\left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5} \]
  6. Final simplification98.1%

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

Alternative 6: 84.1% accurate, 1.8× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-249}:\\ \;\;\;\;\left(1 + e^{-x \cdot eps\_m}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+94}:\\ \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\left({eps\_m}^{-1} - -1\right) - \left(\frac{1}{eps\_m} - 1\right) \cdot 1}{2}\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= x -6.5e-249)
   (* (+ 1.0 (exp (- (* x eps_m)))) 0.5)
   (if (<= x 1.45e+94)
     (* (- (exp (* x eps_m)) -1.0) 0.5)
     (/ (- (- (pow eps_m -1.0) -1.0) (* (- (/ 1.0 eps_m) 1.0) 1.0)) 2.0))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (x <= -6.5e-249) {
		tmp = (1.0 + exp(-(x * eps_m))) * 0.5;
	} else if (x <= 1.45e+94) {
		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
	} else {
		tmp = ((pow(eps_m, -1.0) - -1.0) - (((1.0 / eps_m) - 1.0) * 1.0)) / 2.0;
	}
	return tmp;
}
eps_m =     private
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, eps_m)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: eps_m
    real(8) :: tmp
    if (x <= (-6.5d-249)) then
        tmp = (1.0d0 + exp(-(x * eps_m))) * 0.5d0
    else if (x <= 1.45d+94) then
        tmp = (exp((x * eps_m)) - (-1.0d0)) * 0.5d0
    else
        tmp = (((eps_m ** (-1.0d0)) - (-1.0d0)) - (((1.0d0 / eps_m) - 1.0d0) * 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 (x <= -6.5e-249) {
		tmp = (1.0 + Math.exp(-(x * eps_m))) * 0.5;
	} else if (x <= 1.45e+94) {
		tmp = (Math.exp((x * eps_m)) - -1.0) * 0.5;
	} else {
		tmp = ((Math.pow(eps_m, -1.0) - -1.0) - (((1.0 / eps_m) - 1.0) * 1.0)) / 2.0;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	tmp = 0
	if x <= -6.5e-249:
		tmp = (1.0 + math.exp(-(x * eps_m))) * 0.5
	elif x <= 1.45e+94:
		tmp = (math.exp((x * eps_m)) - -1.0) * 0.5
	else:
		tmp = ((math.pow(eps_m, -1.0) - -1.0) - (((1.0 / eps_m) - 1.0) * 1.0)) / 2.0
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (x <= -6.5e-249)
		tmp = Float64(Float64(1.0 + exp(Float64(-Float64(x * eps_m)))) * 0.5);
	elseif (x <= 1.45e+94)
		tmp = Float64(Float64(exp(Float64(x * eps_m)) - -1.0) * 0.5);
	else
		tmp = Float64(Float64(Float64((eps_m ^ -1.0) - -1.0) - Float64(Float64(Float64(1.0 / eps_m) - 1.0) * 1.0)) / 2.0);
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	tmp = 0.0;
	if (x <= -6.5e-249)
		tmp = (1.0 + exp(-(x * eps_m))) * 0.5;
	elseif (x <= 1.45e+94)
		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
	else
		tmp = (((eps_m ^ -1.0) - -1.0) - (((1.0 / eps_m) - 1.0) * 1.0)) / 2.0;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[x, -6.5e-249], N[(N[(1.0 + N[Exp[(-N[(x * eps$95$m), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.45e+94], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[Power[eps$95$m, -1.0], $MachinePrecision] - -1.0), $MachinePrecision] - N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] * 1.0), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

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

\mathbf{elif}\;x \leq 1.45 \cdot 10^{+94}:\\
\;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.50000000000000016e-249

    1. Initial program 70.8%

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

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

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

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

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

      \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
      4. lower-*.f6498.0

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    8. Applied rewrites98.0%

      \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    9. Taylor expanded in eps around inf

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot \frac{1}{2} \]
      2. lift-*.f6498.4

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot 0.5 \]
    11. Applied rewrites98.4%

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

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

        \[\leadsto \left(1 - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot 0.5 \]

      if -6.50000000000000016e-249 < x < 1.4499999999999999e94

      1. Initial program 64.0%

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

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

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

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

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

        \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
      7. Step-by-step derivation
        1. *-commutativeN/A

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

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

          \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
        4. lower-*.f6490.9

          \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
      8. Applied rewrites90.9%

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
      9. Taylor expanded in x around 0

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

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

          \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\left(\varepsilon + 1\right) \cdot x - 1\right)\right) \cdot \frac{1}{2} \]
        3. distribute-rgt1-inN/A

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

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

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

          \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\left(x \cdot \varepsilon + x\right) - 1\right)\right) \cdot \frac{1}{2} \]
        7. lift-fma.f6470.5

          \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)\right) \cdot 0.5 \]
      11. Applied rewrites70.5%

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot \frac{1}{2} \]
      13. Step-by-step derivation
        1. Applied rewrites70.5%

          \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5 \]

        if 1.4499999999999999e94 < x

        1. Initial program 100.0%

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

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

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

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

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

              \[\leadsto \frac{\left(\frac{1}{\varepsilon} + \color{blue}{1}\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2} \]
            3. inv-powN/A

              \[\leadsto \frac{\left({\varepsilon}^{-1} + 1\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2} \]
            4. lower-pow.f6461.2

              \[\leadsto \frac{\left({\varepsilon}^{-1} + 1\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2} \]
          4. Applied rewrites61.2%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-249}:\\ \;\;\;\;\left(1 + e^{-x \cdot \varepsilon}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.45 \cdot 10^{+94}:\\ \;\;\;\;\left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\left({\varepsilon}^{-1} - -1\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2}\\ \end{array} \]
        7. Add Preprocessing

        Alternative 7: 79.4% accurate, 1.9× speedup?

        \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := \left(eps\_m - 1\right) \cdot x\\ t_1 := e^{-x}\\ \mathbf{if}\;x \leq -950:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\ \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.45:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, eps\_m - -1, \frac{-1 + eps\_m \cdot eps\_m}{eps\_m - -1}\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 8 \cdot 10^{+123}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot \frac{t\_0 \cdot t\_0 - 1}{t\_0 - 1} - \left(\frac{1}{eps\_m} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, eps\_m, x\right), 1\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        eps_m = (fabs.f64 eps)
        (FPCore (x eps_m)
         :precision binary64
         (let* ((t_0 (* (- eps_m 1.0) x)) (t_1 (exp (- x))))
           (if (<= x -950.0)
             t_1
             (if (<= x -7.6e-175)
               (*
                (fma
                 (fma -1.0 (/ (- (* eps_m eps_m) 1.0) (- eps_m 1.0)) (+ -1.0 eps_m))
                 x
                 2.0)
                0.5)
               (if (<= x 1.65e-284)
                 (* (fma (* (* x x) -0.3333333333333333) x 2.0) 0.5)
                 (if (<= x 1.45)
                   (*
                    (fma
                     (fma
                      -1.0
                      (- eps_m -1.0)
                      (/ (+ -1.0 (* eps_m eps_m)) (- eps_m -1.0)))
                     x
                     2.0)
                    0.5)
                   (if (<= x 8e+123)
                     (/
                      (-
                       (* (+ 1.0 (/ 1.0 eps_m)) (/ (- (* t_0 t_0) 1.0) (- t_0 1.0)))
                       (* (- (/ 1.0 eps_m) 1.0) (fma -1.0 (fma x eps_m x) 1.0)))
                      2.0)
                     t_1)))))))
        eps_m = fabs(eps);
        double code(double x, double eps_m) {
        	double t_0 = (eps_m - 1.0) * x;
        	double t_1 = exp(-x);
        	double tmp;
        	if (x <= -950.0) {
        		tmp = t_1;
        	} else if (x <= -7.6e-175) {
        		tmp = fma(fma(-1.0, (((eps_m * eps_m) - 1.0) / (eps_m - 1.0)), (-1.0 + eps_m)), x, 2.0) * 0.5;
        	} else if (x <= 1.65e-284) {
        		tmp = fma(((x * x) * -0.3333333333333333), x, 2.0) * 0.5;
        	} else if (x <= 1.45) {
        		tmp = fma(fma(-1.0, (eps_m - -1.0), ((-1.0 + (eps_m * eps_m)) / (eps_m - -1.0))), x, 2.0) * 0.5;
        	} else if (x <= 8e+123) {
        		tmp = (((1.0 + (1.0 / eps_m)) * (((t_0 * t_0) - 1.0) / (t_0 - 1.0))) - (((1.0 / eps_m) - 1.0) * fma(-1.0, fma(x, eps_m, x), 1.0))) / 2.0;
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        eps_m = abs(eps)
        function code(x, eps_m)
        	t_0 = Float64(Float64(eps_m - 1.0) * x)
        	t_1 = exp(Float64(-x))
        	tmp = 0.0
        	if (x <= -950.0)
        		tmp = t_1;
        	elseif (x <= -7.6e-175)
        		tmp = Float64(fma(fma(-1.0, Float64(Float64(Float64(eps_m * eps_m) - 1.0) / Float64(eps_m - 1.0)), Float64(-1.0 + eps_m)), x, 2.0) * 0.5);
        	elseif (x <= 1.65e-284)
        		tmp = Float64(fma(Float64(Float64(x * x) * -0.3333333333333333), x, 2.0) * 0.5);
        	elseif (x <= 1.45)
        		tmp = Float64(fma(fma(-1.0, Float64(eps_m - -1.0), Float64(Float64(-1.0 + Float64(eps_m * eps_m)) / Float64(eps_m - -1.0))), x, 2.0) * 0.5);
        	elseif (x <= 8e+123)
        		tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * Float64(Float64(Float64(t_0 * t_0) - 1.0) / Float64(t_0 - 1.0))) - Float64(Float64(Float64(1.0 / eps_m) - 1.0) * fma(-1.0, fma(x, eps_m, x), 1.0))) / 2.0);
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        eps_m = N[Abs[eps], $MachinePrecision]
        code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -950.0], t$95$1, If[LessEqual[x, -7.6e-175], N[(N[(N[(-1.0 * N[(N[(N[(eps$95$m * eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] / N[(eps$95$m - 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.65e-284], N[(N[(N[(N[(x * x), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.45], N[(N[(N[(-1.0 * N[(eps$95$m - -1.0), $MachinePrecision] + N[(N[(-1.0 + N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] / N[(eps$95$m - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 8e+123], N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - 1.0), $MachinePrecision] / N[(t$95$0 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] * N[(-1.0 * N[(x * eps$95$m + x), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], t$95$1]]]]]]]
        
        \begin{array}{l}
        eps_m = \left|\varepsilon\right|
        
        \\
        \begin{array}{l}
        t_0 := \left(eps\_m - 1\right) \cdot x\\
        t_1 := e^{-x}\\
        \mathbf{if}\;x \leq -950:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\
        \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\
        
        \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\
        \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\
        
        \mathbf{elif}\;x \leq 1.45:\\
        \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, eps\_m - -1, \frac{-1 + eps\_m \cdot eps\_m}{eps\_m - -1}\right), x, 2\right) \cdot 0.5\\
        
        \mathbf{elif}\;x \leq 8 \cdot 10^{+123}:\\
        \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot \frac{t\_0 \cdot t\_0 - 1}{t\_0 - 1} - \left(\frac{1}{eps\_m} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, eps\_m, x\right), 1\right)}{2}\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 5 regimes
        2. if x < -950 or 7.99999999999999982e123 < x

          1. Initial program 100.0%

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

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

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

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

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

            \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. *-commutativeN/A

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

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

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
            4. lower-*.f6471.2

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
          8. Applied rewrites71.2%

            \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
          9. Taylor expanded in eps around 0

            \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
          10. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
            2. lift-neg.f6476.8

              \[\leadsto e^{-x} \]
          11. Applied rewrites76.8%

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

          if -950 < x < -7.6e-175

          1. Initial program 58.1%

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

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

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

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

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

            \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. +-commutativeN/A

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            6. lower-+.f64N/A

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
          8. Applied rewrites53.9%

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
          9. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1 \cdot 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            3. lower-/.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            6. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            7. unpow2N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            8. lower-*.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
          10. Applied rewrites66.8%

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

          if -7.6e-175 < x < 1.65000000000000004e-284

          1. Initial program 57.6%

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

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

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

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

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

            \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. mul-1-negN/A

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

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

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

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

              \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
            6. lift-neg.f6494.4

              \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
          8. Applied rewrites94.4%

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

            \[\leadsto \left(2 + x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right)\right) \cdot \frac{1}{2} \]
          10. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \left(x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) + 2\right) \cdot \frac{1}{2} \]
            2. *-commutativeN/A

              \[\leadsto \left(\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
            3. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
            4. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
            6. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
            7. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(\left(\frac{-1}{3} \cdot x + 1\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
            8. lower-fma.f6494.4

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 1\right) \cdot x - 2, x, 2\right) \cdot 0.5 \]
          11. Applied rewrites94.4%

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

            \[\leadsto \mathsf{fma}\left(\frac{-1}{3} \cdot {x}^{2}, x, 2\right) \cdot \frac{1}{2} \]
          13. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
            2. lower-*.f64N/A

              \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
            3. unpow2N/A

              \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
            4. lower-*.f6494.4

              \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5 \]
          14. Applied rewrites94.4%

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

          if 1.65000000000000004e-284 < x < 1.44999999999999996

          1. Initial program 49.9%

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

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

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

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

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

            \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. +-commutativeN/A

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            6. lower-+.f64N/A

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
          8. Applied rewrites66.6%

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
          9. Step-by-step derivation
            1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\frac{1 - \varepsilon \cdot \varepsilon}{\varepsilon + 1}\right), x, 2\right) \cdot 0.5 \]
          10. Applied rewrites70.9%

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

          if 1.44999999999999996 < x < 7.99999999999999982e123

          1. Initial program 96.5%

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

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

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

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

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

              \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \left(\varepsilon + 1\right) \cdot x, 1\right)}{2} \]
            5. distribute-rgt1-inN/A

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

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

              \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, x \cdot \varepsilon + x, 1\right)}{2} \]
            8. lower-fma.f6428.0

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

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

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

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

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

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

              \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \mathsf{fma}\left(\varepsilon - 1, x, 1\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, \varepsilon, x\right), 1\right)}{2} \]
          8. Applied rewrites36.7%

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

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

              \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(\left(\varepsilon - 1\right) \cdot x + \color{blue}{1}\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, \varepsilon, x\right), 1\right)}{2} \]
            3. flip-+N/A

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

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

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

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

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

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

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

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

              \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \frac{\left(\left(\varepsilon - 1\right) \cdot x\right) \cdot \left(x \cdot \left(\varepsilon - 1\right)\right) - 1}{\left(\color{blue}{\varepsilon} - 1\right) \cdot x - 1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, \varepsilon, x\right), 1\right)}{2} \]
            12. lift--.f64N/A

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

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

              \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \frac{\left(\left(\varepsilon - 1\right) \cdot x\right) \cdot \left(\left(\varepsilon - 1\right) \cdot x\right) - 1}{\left(\varepsilon - \color{blue}{1}\right) \cdot x - 1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, \varepsilon, x\right), 1\right)}{2} \]
            15. lift--.f64N/A

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

              \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \frac{\left(\left(\varepsilon - 1\right) \cdot x\right) \cdot \left(\left(\varepsilon - 1\right) \cdot x\right) - 1}{x \cdot \left(\varepsilon - 1\right) - 1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, \varepsilon, x\right), 1\right)}{2} \]
            17. lower--.f64N/A

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

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

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

              \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \frac{\left(\left(\varepsilon - 1\right) \cdot x\right) \cdot \left(\left(\varepsilon - 1\right) \cdot x\right) - 1}{\left(\varepsilon - 1\right) \cdot x - 1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, \varepsilon, x\right), 1\right)}{2} \]
          10. Applied rewrites43.5%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -950:\\ \;\;\;\;e^{-x}\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -1 + \varepsilon\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\ \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.45:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon - -1, \frac{-1 + \varepsilon \cdot \varepsilon}{\varepsilon - -1}\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 8 \cdot 10^{+123}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \frac{\left(\left(\varepsilon - 1\right) \cdot x\right) \cdot \left(\left(\varepsilon - 1\right) \cdot x\right) - 1}{\left(\varepsilon - 1\right) \cdot x - 1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, \varepsilon, x\right), 1\right)}{2}\\ \mathbf{else}:\\ \;\;\;\;e^{-x}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 8: 81.1% accurate, 2.1× speedup?

        \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := e^{-x}\\ \mathbf{if}\;x \leq -950:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+94}:\\ \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        eps_m = (fabs.f64 eps)
        (FPCore (x eps_m)
         :precision binary64
         (let* ((t_0 (exp (- x))))
           (if (<= x -950.0)
             t_0
             (if (<= x -7.6e-175)
               (*
                (fma
                 (fma -1.0 (/ (- (* eps_m eps_m) 1.0) (- eps_m 1.0)) (+ -1.0 eps_m))
                 x
                 2.0)
                0.5)
               (if (<= x 1.7e+94) (* (- (exp (* x eps_m)) -1.0) 0.5) t_0)))))
        eps_m = fabs(eps);
        double code(double x, double eps_m) {
        	double t_0 = exp(-x);
        	double tmp;
        	if (x <= -950.0) {
        		tmp = t_0;
        	} else if (x <= -7.6e-175) {
        		tmp = fma(fma(-1.0, (((eps_m * eps_m) - 1.0) / (eps_m - 1.0)), (-1.0 + eps_m)), x, 2.0) * 0.5;
        	} else if (x <= 1.7e+94) {
        		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        eps_m = abs(eps)
        function code(x, eps_m)
        	t_0 = exp(Float64(-x))
        	tmp = 0.0
        	if (x <= -950.0)
        		tmp = t_0;
        	elseif (x <= -7.6e-175)
        		tmp = Float64(fma(fma(-1.0, Float64(Float64(Float64(eps_m * eps_m) - 1.0) / Float64(eps_m - 1.0)), Float64(-1.0 + eps_m)), x, 2.0) * 0.5);
        	elseif (x <= 1.7e+94)
        		tmp = Float64(Float64(exp(Float64(x * eps_m)) - -1.0) * 0.5);
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        eps_m = N[Abs[eps], $MachinePrecision]
        code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -950.0], t$95$0, If[LessEqual[x, -7.6e-175], N[(N[(N[(-1.0 * N[(N[(N[(eps$95$m * eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] / N[(eps$95$m - 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.7e+94], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision], t$95$0]]]]
        
        \begin{array}{l}
        eps_m = \left|\varepsilon\right|
        
        \\
        \begin{array}{l}
        t_0 := e^{-x}\\
        \mathbf{if}\;x \leq -950:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\
        \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\
        
        \mathbf{elif}\;x \leq 1.7 \cdot 10^{+94}:\\
        \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if x < -950 or 1.7000000000000001e94 < x

          1. Initial program 100.0%

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

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

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

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

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

            \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. *-commutativeN/A

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

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

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
            4. lower-*.f6469.9

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
          8. Applied rewrites69.9%

            \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
          9. Taylor expanded in eps around 0

            \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
          10. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
            2. lift-neg.f6476.2

              \[\leadsto e^{-x} \]
          11. Applied rewrites76.2%

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

          if -950 < x < -7.6e-175

          1. Initial program 58.1%

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

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

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

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

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

            \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. +-commutativeN/A

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            6. lower-+.f64N/A

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

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
          8. Applied rewrites53.9%

            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
          9. Step-by-step derivation
            1. lift-+.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1 \cdot 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            3. lower-/.f64N/A

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

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            6. lower--.f64N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            7. unpow2N/A

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
            8. lower-*.f64N/A

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

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
          10. Applied rewrites66.8%

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

          if -7.6e-175 < x < 1.7000000000000001e94

          1. Initial program 60.8%

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

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

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

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

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

            \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. *-commutativeN/A

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

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

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
            4. lower-*.f6492.0

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
          8. Applied rewrites92.0%

            \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
          9. Taylor expanded in x around 0

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

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

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\left(\varepsilon + 1\right) \cdot x - 1\right)\right) \cdot \frac{1}{2} \]
            3. distribute-rgt1-inN/A

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

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

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

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\left(x \cdot \varepsilon + x\right) - 1\right)\right) \cdot \frac{1}{2} \]
            7. lift-fma.f6473.0

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)\right) \cdot 0.5 \]
          11. Applied rewrites73.0%

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

            \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot \frac{1}{2} \]
          13. Step-by-step derivation
            1. Applied rewrites72.8%

              \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5 \]
          14. Recombined 3 regimes into one program.
          15. Final simplification73.0%

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

          Alternative 9: 78.3% accurate, 2.1× speedup?

          \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := e^{-x}\\ \mathbf{if}\;x \leq -950:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\ \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, eps\_m - -1, \frac{-1 + eps\_m \cdot eps\_m}{eps\_m - -1}\right), x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          eps_m = (fabs.f64 eps)
          (FPCore (x eps_m)
           :precision binary64
           (let* ((t_0 (exp (- x))))
             (if (<= x -950.0)
               t_0
               (if (<= x -7.6e-175)
                 (*
                  (fma
                   (fma -1.0 (/ (- (* eps_m eps_m) 1.0) (- eps_m 1.0)) (+ -1.0 eps_m))
                   x
                   2.0)
                  0.5)
                 (if (<= x 1.65e-284)
                   (* (fma (* (* x x) -0.3333333333333333) x 2.0) 0.5)
                   (if (<= x 1.15e-7)
                     (*
                      (fma
                       (fma
                        -1.0
                        (- eps_m -1.0)
                        (/ (+ -1.0 (* eps_m eps_m)) (- eps_m -1.0)))
                       x
                       2.0)
                      0.5)
                     t_0))))))
          eps_m = fabs(eps);
          double code(double x, double eps_m) {
          	double t_0 = exp(-x);
          	double tmp;
          	if (x <= -950.0) {
          		tmp = t_0;
          	} else if (x <= -7.6e-175) {
          		tmp = fma(fma(-1.0, (((eps_m * eps_m) - 1.0) / (eps_m - 1.0)), (-1.0 + eps_m)), x, 2.0) * 0.5;
          	} else if (x <= 1.65e-284) {
          		tmp = fma(((x * x) * -0.3333333333333333), x, 2.0) * 0.5;
          	} else if (x <= 1.15e-7) {
          		tmp = fma(fma(-1.0, (eps_m - -1.0), ((-1.0 + (eps_m * eps_m)) / (eps_m - -1.0))), x, 2.0) * 0.5;
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          eps_m = abs(eps)
          function code(x, eps_m)
          	t_0 = exp(Float64(-x))
          	tmp = 0.0
          	if (x <= -950.0)
          		tmp = t_0;
          	elseif (x <= -7.6e-175)
          		tmp = Float64(fma(fma(-1.0, Float64(Float64(Float64(eps_m * eps_m) - 1.0) / Float64(eps_m - 1.0)), Float64(-1.0 + eps_m)), x, 2.0) * 0.5);
          	elseif (x <= 1.65e-284)
          		tmp = Float64(fma(Float64(Float64(x * x) * -0.3333333333333333), x, 2.0) * 0.5);
          	elseif (x <= 1.15e-7)
          		tmp = Float64(fma(fma(-1.0, Float64(eps_m - -1.0), Float64(Float64(-1.0 + Float64(eps_m * eps_m)) / Float64(eps_m - -1.0))), x, 2.0) * 0.5);
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          eps_m = N[Abs[eps], $MachinePrecision]
          code[x_, eps$95$m_] := Block[{t$95$0 = N[Exp[(-x)], $MachinePrecision]}, If[LessEqual[x, -950.0], t$95$0, If[LessEqual[x, -7.6e-175], N[(N[(N[(-1.0 * N[(N[(N[(eps$95$m * eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] / N[(eps$95$m - 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.65e-284], N[(N[(N[(N[(x * x), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.15e-7], N[(N[(N[(-1.0 * N[(eps$95$m - -1.0), $MachinePrecision] + N[(N[(-1.0 + N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] / N[(eps$95$m - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], t$95$0]]]]]
          
          \begin{array}{l}
          eps_m = \left|\varepsilon\right|
          
          \\
          \begin{array}{l}
          t_0 := e^{-x}\\
          \mathbf{if}\;x \leq -950:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\
          \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\
          
          \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\
          \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\
          
          \mathbf{elif}\;x \leq 1.15 \cdot 10^{-7}:\\
          \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, eps\_m - -1, \frac{-1 + eps\_m \cdot eps\_m}{eps\_m - -1}\right), x, 2\right) \cdot 0.5\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 4 regimes
          2. if x < -950 or 1.14999999999999997e-7 < x

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

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

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

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

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

              \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

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

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

                \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
              4. lower-*.f6468.1

                \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
            8. Applied rewrites68.1%

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
            9. Taylor expanded in eps around 0

              \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
            10. Step-by-step derivation
              1. lift-exp.f64N/A

                \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
              2. lift-neg.f6467.0

                \[\leadsto e^{-x} \]
            11. Applied rewrites67.0%

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

            if -950 < x < -7.6e-175

            1. Initial program 58.1%

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

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

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

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

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

              \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
            7. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
              6. lower-+.f64N/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
            8. Applied rewrites53.9%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
            9. Step-by-step derivation
              1. lift-+.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1 \cdot 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
              3. lower-/.f64N/A

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

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
              6. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
              7. unpow2N/A

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
              8. lower-*.f64N/A

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
            10. Applied rewrites66.8%

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

            if -7.6e-175 < x < 1.65000000000000004e-284

            1. Initial program 57.6%

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

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

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

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

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

              \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
            7. Step-by-step derivation
              1. mul-1-negN/A

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

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

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

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

                \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
              6. lift-neg.f6494.4

                \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
            8. Applied rewrites94.4%

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

              \[\leadsto \left(2 + x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right)\right) \cdot \frac{1}{2} \]
            10. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \left(x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) + 2\right) \cdot \frac{1}{2} \]
              2. *-commutativeN/A

                \[\leadsto \left(\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
              3. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
              4. lower--.f64N/A

                \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
              6. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
              7. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(\left(\frac{-1}{3} \cdot x + 1\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
              8. lower-fma.f6494.4

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 1\right) \cdot x - 2, x, 2\right) \cdot 0.5 \]
            11. Applied rewrites94.4%

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

              \[\leadsto \mathsf{fma}\left(\frac{-1}{3} \cdot {x}^{2}, x, 2\right) \cdot \frac{1}{2} \]
            13. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
              2. lower-*.f64N/A

                \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
              3. unpow2N/A

                \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
              4. lower-*.f6494.4

                \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5 \]
            14. Applied rewrites94.4%

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

            if 1.65000000000000004e-284 < x < 1.14999999999999997e-7

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

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

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

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

              \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
            7. Step-by-step derivation
              1. +-commutativeN/A

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
              6. lower-+.f64N/A

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

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

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
            8. Applied rewrites68.3%

              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
            9. Step-by-step derivation
              1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\frac{1 - \varepsilon \cdot \varepsilon}{\varepsilon + 1}\right), x, 2\right) \cdot 0.5 \]
            10. Applied rewrites72.9%

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -950:\\ \;\;\;\;e^{-x}\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -1 + \varepsilon\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\ \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-7}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon - -1, \frac{-1 + \varepsilon \cdot \varepsilon}{\varepsilon - -1}\right), x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;e^{-x}\\ \end{array} \]
          5. Add Preprocessing

          Alternative 10: 84.3% accurate, 2.2× speedup?

          \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-249}:\\ \;\;\;\;\left(1 + e^{-x \cdot eps\_m}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+94}:\\ \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;e^{-x}\\ \end{array} \end{array} \]
          eps_m = (fabs.f64 eps)
          (FPCore (x eps_m)
           :precision binary64
           (if (<= x -6.5e-249)
             (* (+ 1.0 (exp (- (* x eps_m)))) 0.5)
             (if (<= x 1.7e+94) (* (- (exp (* x eps_m)) -1.0) 0.5) (exp (- x)))))
          eps_m = fabs(eps);
          double code(double x, double eps_m) {
          	double tmp;
          	if (x <= -6.5e-249) {
          		tmp = (1.0 + exp(-(x * eps_m))) * 0.5;
          	} else if (x <= 1.7e+94) {
          		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
          	} else {
          		tmp = exp(-x);
          	}
          	return tmp;
          }
          
          eps_m =     private
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x, eps_m)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8), intent (in) :: eps_m
              real(8) :: tmp
              if (x <= (-6.5d-249)) then
                  tmp = (1.0d0 + exp(-(x * eps_m))) * 0.5d0
              else if (x <= 1.7d+94) then
                  tmp = (exp((x * eps_m)) - (-1.0d0)) * 0.5d0
              else
                  tmp = exp(-x)
              end if
              code = tmp
          end function
          
          eps_m = Math.abs(eps);
          public static double code(double x, double eps_m) {
          	double tmp;
          	if (x <= -6.5e-249) {
          		tmp = (1.0 + Math.exp(-(x * eps_m))) * 0.5;
          	} else if (x <= 1.7e+94) {
          		tmp = (Math.exp((x * eps_m)) - -1.0) * 0.5;
          	} else {
          		tmp = Math.exp(-x);
          	}
          	return tmp;
          }
          
          eps_m = math.fabs(eps)
          def code(x, eps_m):
          	tmp = 0
          	if x <= -6.5e-249:
          		tmp = (1.0 + math.exp(-(x * eps_m))) * 0.5
          	elif x <= 1.7e+94:
          		tmp = (math.exp((x * eps_m)) - -1.0) * 0.5
          	else:
          		tmp = math.exp(-x)
          	return tmp
          
          eps_m = abs(eps)
          function code(x, eps_m)
          	tmp = 0.0
          	if (x <= -6.5e-249)
          		tmp = Float64(Float64(1.0 + exp(Float64(-Float64(x * eps_m)))) * 0.5);
          	elseif (x <= 1.7e+94)
          		tmp = Float64(Float64(exp(Float64(x * eps_m)) - -1.0) * 0.5);
          	else
          		tmp = exp(Float64(-x));
          	end
          	return tmp
          end
          
          eps_m = abs(eps);
          function tmp_2 = code(x, eps_m)
          	tmp = 0.0;
          	if (x <= -6.5e-249)
          		tmp = (1.0 + exp(-(x * eps_m))) * 0.5;
          	elseif (x <= 1.7e+94)
          		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
          	else
          		tmp = exp(-x);
          	end
          	tmp_2 = tmp;
          end
          
          eps_m = N[Abs[eps], $MachinePrecision]
          code[x_, eps$95$m_] := If[LessEqual[x, -6.5e-249], N[(N[(1.0 + N[Exp[(-N[(x * eps$95$m), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.7e+94], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision], N[Exp[(-x)], $MachinePrecision]]]
          
          \begin{array}{l}
          eps_m = \left|\varepsilon\right|
          
          \\
          \begin{array}{l}
          \mathbf{if}\;x \leq -6.5 \cdot 10^{-249}:\\
          \;\;\;\;\left(1 + e^{-x \cdot eps\_m}\right) \cdot 0.5\\
          
          \mathbf{elif}\;x \leq 1.7 \cdot 10^{+94}:\\
          \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\
          
          \mathbf{else}:\\
          \;\;\;\;e^{-x}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if x < -6.50000000000000016e-249

            1. Initial program 70.8%

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

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

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

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

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

              \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

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

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

                \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
              4. lower-*.f6498.0

                \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
            8. Applied rewrites98.0%

              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
            9. Taylor expanded in eps around inf

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

                \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot \frac{1}{2} \]
              2. lift-*.f6498.4

                \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot 0.5 \]
            11. Applied rewrites98.4%

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

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

                \[\leadsto \left(1 - \left(-e^{-x \cdot \varepsilon}\right)\right) \cdot 0.5 \]

              if -6.50000000000000016e-249 < x < 1.7000000000000001e94

              1. Initial program 64.0%

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

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

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

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

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

                \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
              7. Step-by-step derivation
                1. *-commutativeN/A

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

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

                  \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
                4. lower-*.f6490.9

                  \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
              8. Applied rewrites90.9%

                \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
              9. Taylor expanded in x around 0

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

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

                  \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\left(\varepsilon + 1\right) \cdot x - 1\right)\right) \cdot \frac{1}{2} \]
                3. distribute-rgt1-inN/A

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

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

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

                  \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\left(x \cdot \varepsilon + x\right) - 1\right)\right) \cdot \frac{1}{2} \]
                7. lift-fma.f6470.5

                  \[\leadsto \left(e^{x \cdot \varepsilon} - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)\right) \cdot 0.5 \]
              11. Applied rewrites70.5%

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

                \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot \frac{1}{2} \]
              13. Step-by-step derivation
                1. Applied rewrites70.5%

                  \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5 \]

                if 1.7000000000000001e94 < x

                1. Initial program 100.0%

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

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

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

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

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

                  \[\leadsto \left(e^{\varepsilon \cdot x} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. *-commutativeN/A

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

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

                    \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
                  4. lower-*.f6450.2

                    \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                8. Applied rewrites50.2%

                  \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                9. Taylor expanded in eps around 0

                  \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
                10. Step-by-step derivation
                  1. lift-exp.f64N/A

                    \[\leadsto e^{\mathsf{neg}\left(x\right)} \]
                  2. lift-neg.f6460.6

                    \[\leadsto e^{-x} \]
                11. Applied rewrites60.6%

                  \[\leadsto e^{-x} \]
              14. Recombined 3 regimes into one program.
              15. Final simplification69.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.5 \cdot 10^{-249}:\\ \;\;\;\;\left(1 + e^{-x \cdot \varepsilon}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.7 \cdot 10^{+94}:\\ \;\;\;\;\left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;e^{-x}\\ \end{array} \]
              16. Add Preprocessing

              Alternative 11: 75.4% accurate, 3.0× speedup?

              \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{if}\;x \leq -4.3 \cdot 10^{+91}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 8.5:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, eps\_m - -1, \frac{-1 + eps\_m \cdot eps\_m}{eps\_m - -1}\right), x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot \mathsf{fma}\left(eps\_m - 1, x, 1\right) + \left(\frac{-1}{eps\_m} - -1\right) \cdot \mathsf{fma}\left(-1, x, 1\right)}{2}\\ \end{array} \end{array} \]
              eps_m = (fabs.f64 eps)
              (FPCore (x eps_m)
               :precision binary64
               (let* ((t_0 (* (fma (* (* x x) -0.3333333333333333) x 2.0) 0.5)))
                 (if (<= x -4.3e+91)
                   t_0
                   (if (<= x -7.6e-175)
                     (*
                      (fma
                       (fma -1.0 (/ (- (* eps_m eps_m) 1.0) (- eps_m 1.0)) (+ -1.0 eps_m))
                       x
                       2.0)
                      0.5)
                     (if (<= x 1.65e-284)
                       t_0
                       (if (<= x 8.5)
                         (*
                          (fma
                           (fma
                            -1.0
                            (- eps_m -1.0)
                            (/ (+ -1.0 (* eps_m eps_m)) (- eps_m -1.0)))
                           x
                           2.0)
                          0.5)
                         (/
                          (+
                           (* (+ 1.0 (/ 1.0 eps_m)) (fma (- eps_m 1.0) x 1.0))
                           (* (- (/ -1.0 eps_m) -1.0) (fma -1.0 x 1.0)))
                          2.0)))))))
              eps_m = fabs(eps);
              double code(double x, double eps_m) {
              	double t_0 = fma(((x * x) * -0.3333333333333333), x, 2.0) * 0.5;
              	double tmp;
              	if (x <= -4.3e+91) {
              		tmp = t_0;
              	} else if (x <= -7.6e-175) {
              		tmp = fma(fma(-1.0, (((eps_m * eps_m) - 1.0) / (eps_m - 1.0)), (-1.0 + eps_m)), x, 2.0) * 0.5;
              	} else if (x <= 1.65e-284) {
              		tmp = t_0;
              	} else if (x <= 8.5) {
              		tmp = fma(fma(-1.0, (eps_m - -1.0), ((-1.0 + (eps_m * eps_m)) / (eps_m - -1.0))), x, 2.0) * 0.5;
              	} else {
              		tmp = (((1.0 + (1.0 / eps_m)) * fma((eps_m - 1.0), x, 1.0)) + (((-1.0 / eps_m) - -1.0) * fma(-1.0, x, 1.0))) / 2.0;
              	}
              	return tmp;
              }
              
              eps_m = abs(eps)
              function code(x, eps_m)
              	t_0 = Float64(fma(Float64(Float64(x * x) * -0.3333333333333333), x, 2.0) * 0.5)
              	tmp = 0.0
              	if (x <= -4.3e+91)
              		tmp = t_0;
              	elseif (x <= -7.6e-175)
              		tmp = Float64(fma(fma(-1.0, Float64(Float64(Float64(eps_m * eps_m) - 1.0) / Float64(eps_m - 1.0)), Float64(-1.0 + eps_m)), x, 2.0) * 0.5);
              	elseif (x <= 1.65e-284)
              		tmp = t_0;
              	elseif (x <= 8.5)
              		tmp = Float64(fma(fma(-1.0, Float64(eps_m - -1.0), Float64(Float64(-1.0 + Float64(eps_m * eps_m)) / Float64(eps_m - -1.0))), x, 2.0) * 0.5);
              	else
              		tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * fma(Float64(eps_m - 1.0), x, 1.0)) + Float64(Float64(Float64(-1.0 / eps_m) - -1.0) * fma(-1.0, x, 1.0))) / 2.0);
              	end
              	return tmp
              end
              
              eps_m = N[Abs[eps], $MachinePrecision]
              code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(N[(N[(x * x), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[x, -4.3e+91], t$95$0, If[LessEqual[x, -7.6e-175], N[(N[(N[(-1.0 * N[(N[(N[(eps$95$m * eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] / N[(eps$95$m - 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.65e-284], t$95$0, If[LessEqual[x, 8.5], N[(N[(N[(-1.0 * N[(eps$95$m - -1.0), $MachinePrecision] + N[(N[(-1.0 + N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] / N[(eps$95$m - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * N[(N[(eps$95$m - 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(-1.0 / eps$95$m), $MachinePrecision] - -1.0), $MachinePrecision] * N[(-1.0 * x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]]]]
              
              \begin{array}{l}
              eps_m = \left|\varepsilon\right|
              
              \\
              \begin{array}{l}
              t_0 := \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\
              \mathbf{if}\;x \leq -4.3 \cdot 10^{+91}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\
              
              \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq 8.5:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, eps\_m - -1, \frac{-1 + eps\_m \cdot eps\_m}{eps\_m - -1}\right), x, 2\right) \cdot 0.5\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot \mathsf{fma}\left(eps\_m - 1, x, 1\right) + \left(\frac{-1}{eps\_m} - -1\right) \cdot \mathsf{fma}\left(-1, x, 1\right)}{2}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if x < -4.3000000000000001e91 or -7.6e-175 < x < 1.65000000000000004e-284

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

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

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

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

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

                  \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

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

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

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

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

                    \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
                  6. lift-neg.f6496.7

                    \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
                8. Applied rewrites96.7%

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

                  \[\leadsto \left(2 + x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right)\right) \cdot \frac{1}{2} \]
                10. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) + 2\right) \cdot \frac{1}{2} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  7. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\left(\frac{-1}{3} \cdot x + 1\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  8. lower-fma.f6495.4

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 1\right) \cdot x - 2, x, 2\right) \cdot 0.5 \]
                11. Applied rewrites95.4%

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

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{3} \cdot {x}^{2}, x, 2\right) \cdot \frac{1}{2} \]
                13. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  2. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower-*.f6495.4

                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5 \]
                14. Applied rewrites95.4%

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

                if -4.3000000000000001e91 < x < -7.6e-175

                1. Initial program 63.8%

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

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

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

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

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

                  \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. +-commutativeN/A

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-+.f64N/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                8. Applied rewrites46.9%

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                9. Step-by-step derivation
                  1. lift-+.f64N/A

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1 \cdot 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  3. lower-/.f64N/A

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  6. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  7. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  8. lower-*.f64N/A

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                10. Applied rewrites63.7%

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

                if 1.65000000000000004e-284 < x < 8.5

                1. Initial program 49.9%

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

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

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

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

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

                  \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. +-commutativeN/A

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-+.f64N/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                8. Applied rewrites66.6%

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                9. Step-by-step derivation
                  1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\frac{1 - \varepsilon \cdot \varepsilon}{\varepsilon + 1}\right), x, 2\right) \cdot 0.5 \]
                10. Applied rewrites70.9%

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

                if 8.5 < x

                1. Initial program 98.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 x around 0

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

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

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

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

                    \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \left(\varepsilon + 1\right) \cdot x, 1\right)}{2} \]
                  5. distribute-rgt1-inN/A

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

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

                    \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, x \cdot \varepsilon + x, 1\right)}{2} \]
                  8. lower-fma.f6423.1

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

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

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

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

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

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

                    \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \mathsf{fma}\left(\varepsilon - 1, x, 1\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot \mathsf{fma}\left(-1, \mathsf{fma}\left(x, \varepsilon, x\right), 1\right)}{2} \]
                8. Applied rewrites23.9%

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{+91}:\\ \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -1 + \varepsilon\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\ \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 8.5:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon - -1, \frac{-1 + \varepsilon \cdot \varepsilon}{\varepsilon - -1}\right), x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \mathsf{fma}\left(\varepsilon - 1, x, 1\right) + \left(\frac{-1}{\varepsilon} - -1\right) \cdot \mathsf{fma}\left(-1, x, 1\right)}{2}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 12: 72.1% accurate, 4.1× speedup?

              \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{if}\;x \leq -4.3 \cdot 10^{+91}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, eps\_m - -1, \frac{-1 + eps\_m \cdot eps\_m}{eps\_m - -1}\right), x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5\\ \end{array} \end{array} \]
              eps_m = (fabs.f64 eps)
              (FPCore (x eps_m)
               :precision binary64
               (let* ((t_0 (* (fma (* (* x x) -0.3333333333333333) x 2.0) 0.5)))
                 (if (<= x -4.3e+91)
                   t_0
                   (if (<= x -7.6e-175)
                     (*
                      (fma
                       (fma -1.0 (/ (- (* eps_m eps_m) 1.0) (- eps_m 1.0)) (+ -1.0 eps_m))
                       x
                       2.0)
                      0.5)
                     (if (<= x 1.65e-284)
                       t_0
                       (if (<= x 1.4e+154)
                         (*
                          (fma
                           (fma
                            -1.0
                            (- eps_m -1.0)
                            (/ (+ -1.0 (* eps_m eps_m)) (- eps_m -1.0)))
                           x
                           2.0)
                          0.5)
                         (* (fma (- x 2.0) x 2.0) 0.5)))))))
              eps_m = fabs(eps);
              double code(double x, double eps_m) {
              	double t_0 = fma(((x * x) * -0.3333333333333333), x, 2.0) * 0.5;
              	double tmp;
              	if (x <= -4.3e+91) {
              		tmp = t_0;
              	} else if (x <= -7.6e-175) {
              		tmp = fma(fma(-1.0, (((eps_m * eps_m) - 1.0) / (eps_m - 1.0)), (-1.0 + eps_m)), x, 2.0) * 0.5;
              	} else if (x <= 1.65e-284) {
              		tmp = t_0;
              	} else if (x <= 1.4e+154) {
              		tmp = fma(fma(-1.0, (eps_m - -1.0), ((-1.0 + (eps_m * eps_m)) / (eps_m - -1.0))), x, 2.0) * 0.5;
              	} else {
              		tmp = fma((x - 2.0), x, 2.0) * 0.5;
              	}
              	return tmp;
              }
              
              eps_m = abs(eps)
              function code(x, eps_m)
              	t_0 = Float64(fma(Float64(Float64(x * x) * -0.3333333333333333), x, 2.0) * 0.5)
              	tmp = 0.0
              	if (x <= -4.3e+91)
              		tmp = t_0;
              	elseif (x <= -7.6e-175)
              		tmp = Float64(fma(fma(-1.0, Float64(Float64(Float64(eps_m * eps_m) - 1.0) / Float64(eps_m - 1.0)), Float64(-1.0 + eps_m)), x, 2.0) * 0.5);
              	elseif (x <= 1.65e-284)
              		tmp = t_0;
              	elseif (x <= 1.4e+154)
              		tmp = Float64(fma(fma(-1.0, Float64(eps_m - -1.0), Float64(Float64(-1.0 + Float64(eps_m * eps_m)) / Float64(eps_m - -1.0))), x, 2.0) * 0.5);
              	else
              		tmp = Float64(fma(Float64(x - 2.0), x, 2.0) * 0.5);
              	end
              	return tmp
              end
              
              eps_m = N[Abs[eps], $MachinePrecision]
              code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(N[(N[(x * x), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[x, -4.3e+91], t$95$0, If[LessEqual[x, -7.6e-175], N[(N[(N[(-1.0 * N[(N[(N[(eps$95$m * eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] / N[(eps$95$m - 1.0), $MachinePrecision]), $MachinePrecision] + N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.65e-284], t$95$0, If[LessEqual[x, 1.4e+154], N[(N[(N[(-1.0 * N[(eps$95$m - -1.0), $MachinePrecision] + N[(N[(-1.0 + N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] / N[(eps$95$m - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(x - 2.0), $MachinePrecision] * x + 2.0), $MachinePrecision] * 0.5), $MachinePrecision]]]]]]
              
              \begin{array}{l}
              eps_m = \left|\varepsilon\right|
              
              \\
              \begin{array}{l}
              t_0 := \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\
              \mathbf{if}\;x \leq -4.3 \cdot 10^{+91}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{eps\_m \cdot eps\_m - 1}{eps\_m - 1}, -1 + eps\_m\right), x, 2\right) \cdot 0.5\\
              
              \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;x \leq 1.4 \cdot 10^{+154}:\\
              \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, eps\_m - -1, \frac{-1 + eps\_m \cdot eps\_m}{eps\_m - -1}\right), x, 2\right) \cdot 0.5\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 4 regimes
              2. if x < -4.3000000000000001e91 or -7.6e-175 < x < 1.65000000000000004e-284

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

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

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

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

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

                  \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

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

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

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

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

                    \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
                  6. lift-neg.f6496.7

                    \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
                8. Applied rewrites96.7%

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

                  \[\leadsto \left(2 + x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right)\right) \cdot \frac{1}{2} \]
                10. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) + 2\right) \cdot \frac{1}{2} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  7. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\left(\frac{-1}{3} \cdot x + 1\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  8. lower-fma.f6495.4

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 1\right) \cdot x - 2, x, 2\right) \cdot 0.5 \]
                11. Applied rewrites95.4%

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

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{3} \cdot {x}^{2}, x, 2\right) \cdot \frac{1}{2} \]
                13. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  2. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower-*.f6495.4

                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5 \]
                14. Applied rewrites95.4%

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

                if -4.3000000000000001e91 < x < -7.6e-175

                1. Initial program 63.8%

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

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

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

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

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

                  \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. +-commutativeN/A

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-+.f64N/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                8. Applied rewrites46.9%

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                9. Step-by-step derivation
                  1. lift-+.f64N/A

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1 \cdot 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  3. lower-/.f64N/A

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  6. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{{\varepsilon}^{2} - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  7. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  8. lower-*.f64N/A

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                10. Applied rewrites63.7%

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

                if 1.65000000000000004e-284 < x < 1.4e154

                1. Initial program 67.0%

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

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

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

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

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

                  \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. +-commutativeN/A

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-+.f64N/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                8. Applied rewrites43.5%

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                9. Step-by-step derivation
                  1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\frac{1 - \varepsilon \cdot \varepsilon}{\varepsilon + 1}\right), x, 2\right) \cdot 0.5 \]
                10. Applied rewrites48.2%

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

                if 1.4e154 < x

                1. Initial program 100.0%

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

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

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

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

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

                  \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

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

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

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

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

                    \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
                  6. lift-neg.f6457.5

                    \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
                8. Applied rewrites57.5%

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

                  \[\leadsto \left(2 + x \cdot \left(x - 2\right)\right) \cdot \frac{1}{2} \]
                10. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(x \cdot \left(x - 2\right) + 2\right) \cdot \frac{1}{2} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(\left(x - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower--.f6444.1

                    \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5 \]
                11. Applied rewrites44.1%

                  \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5 \]
              3. Recombined 4 regimes into one program.
              4. Final simplification63.5%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -4.3 \cdot 10^{+91}:\\ \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq -7.6 \cdot 10^{-175}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \frac{\varepsilon \cdot \varepsilon - 1}{\varepsilon - 1}, -1 + \varepsilon\right), x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-284}:\\ \;\;\;\;\mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon - -1, \frac{-1 + \varepsilon \cdot \varepsilon}{\varepsilon - -1}\right), x, 2\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5\\ \end{array} \]
              5. Add Preprocessing

              Alternative 13: 66.3% accurate, 5.0× speedup?

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

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

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

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

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

                  \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

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

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

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

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

                    \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
                  6. lift-neg.f6481.3

                    \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
                8. Applied rewrites81.3%

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

                  \[\leadsto \left(2 + x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right)\right) \cdot \frac{1}{2} \]
                10. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) + 2\right) \cdot \frac{1}{2} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  7. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\left(\frac{-1}{3} \cdot x + 1\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  8. lower-fma.f6475.0

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 1\right) \cdot x - 2, x, 2\right) \cdot 0.5 \]
                11. Applied rewrites75.0%

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

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{3} \cdot {x}^{2}, x, 2\right) \cdot \frac{1}{2} \]
                13. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  2. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower-*.f6475.4

                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5 \]
                14. Applied rewrites75.4%

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

                if 1.65000000000000004e-284 < x < 1.4e154

                1. Initial program 67.0%

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

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

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

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

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

                  \[\leadsto \left(2 + x \cdot \left(-1 \cdot \left(1 + \varepsilon\right) + -1 \cdot \left(1 - \varepsilon\right)\right)\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. +-commutativeN/A

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -1 \cdot \left(1 - \varepsilon\right)\right), x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-+.f64N/A

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                8. Applied rewrites43.5%

                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\left(1 - \varepsilon\right)\right), x, 2\right) \cdot 0.5 \]
                9. Step-by-step derivation
                  1. lift--.f64N/A

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

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\frac{1 - \varepsilon \cdot \varepsilon}{\varepsilon + 1}\right), x, 2\right) \cdot 0.5 \]
                10. Applied rewrites48.2%

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

                if 1.4e154 < x

                1. Initial program 100.0%

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

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

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

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

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

                  \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

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

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

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

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

                    \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
                  6. lift-neg.f6457.5

                    \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
                8. Applied rewrites57.5%

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

                  \[\leadsto \left(2 + x \cdot \left(x - 2\right)\right) \cdot \frac{1}{2} \]
                10. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(x \cdot \left(x - 2\right) + 2\right) \cdot \frac{1}{2} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(\left(x - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower--.f6444.1

                    \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5 \]
                11. Applied rewrites44.1%

                  \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5 \]
              3. Recombined 3 regimes into one program.
              4. Final simplification60.3%

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

              Alternative 14: 60.1% accurate, 9.7× speedup?

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

                1. Initial program 63.8%

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

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

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

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

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

                  \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

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

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

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

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

                    \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
                  6. lift-neg.f6476.6

                    \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
                8. Applied rewrites76.6%

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

                  \[\leadsto \left(2 + x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right)\right) \cdot \frac{1}{2} \]
                10. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(x \cdot \left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) + 2\right) \cdot \frac{1}{2} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower--.f64N/A

                    \[\leadsto \mathsf{fma}\left(x \cdot \left(1 + \frac{-1}{3} \cdot x\right) - 2, x, 2\right) \cdot \frac{1}{2} \]
                  5. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  6. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left(\left(1 + \frac{-1}{3} \cdot x\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  7. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(\left(\frac{-1}{3} \cdot x + 1\right) \cdot x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  8. lower-fma.f6472.3

                    \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.3333333333333333, x, 1\right) \cdot x - 2, x, 2\right) \cdot 0.5 \]
                11. Applied rewrites72.3%

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

                  \[\leadsto \mathsf{fma}\left(\frac{-1}{3} \cdot {x}^{2}, x, 2\right) \cdot \frac{1}{2} \]
                13. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  2. lower-*.f64N/A

                    \[\leadsto \mathsf{fma}\left({x}^{2} \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  3. unpow2N/A

                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot \frac{-1}{3}, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower-*.f6472.9

                    \[\leadsto \mathsf{fma}\left(\left(x \cdot x\right) \cdot -0.3333333333333333, x, 2\right) \cdot 0.5 \]
                14. Applied rewrites72.9%

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

                if 1.3500000000000001 < x

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

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

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

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

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

                  \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
                7. Step-by-step derivation
                  1. mul-1-negN/A

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

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

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

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

                    \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
                  6. lift-neg.f6452.9

                    \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
                8. Applied rewrites52.9%

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

                  \[\leadsto \left(2 + x \cdot \left(x - 2\right)\right) \cdot \frac{1}{2} \]
                10. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \left(x \cdot \left(x - 2\right) + 2\right) \cdot \frac{1}{2} \]
                  2. *-commutativeN/A

                    \[\leadsto \left(\left(x - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
                  3. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot \frac{1}{2} \]
                  4. lower--.f6426.8

                    \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5 \]
                11. Applied rewrites26.8%

                  \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5 \]
              3. Recombined 2 regimes into one program.
              4. Add Preprocessing

              Alternative 15: 57.7% accurate, 18.2× speedup?

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

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

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

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

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

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

                \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} + e^{-1 \cdot x}\right) \cdot \frac{1}{2} \]
              7. Step-by-step derivation
                1. mul-1-negN/A

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

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

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

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

                  \[\leadsto \left(e^{-x} + e^{\mathsf{neg}\left(x\right)}\right) \cdot \frac{1}{2} \]
                6. lift-neg.f6469.4

                  \[\leadsto \left(e^{-x} + e^{-x}\right) \cdot 0.5 \]
              8. Applied rewrites69.4%

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

                \[\leadsto \left(2 + x \cdot \left(x - 2\right)\right) \cdot \frac{1}{2} \]
              10. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \left(x \cdot \left(x - 2\right) + 2\right) \cdot \frac{1}{2} \]
                2. *-commutativeN/A

                  \[\leadsto \left(\left(x - 2\right) \cdot x + 2\right) \cdot \frac{1}{2} \]
                3. lower-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot \frac{1}{2} \]
                4. lower--.f6456.4

                  \[\leadsto \mathsf{fma}\left(x - 2, x, 2\right) \cdot 0.5 \]
              11. Applied rewrites56.4%

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

              Alternative 16: 44.4% accurate, 273.0× speedup?

              \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ 1 \end{array} \]
              eps_m = (fabs.f64 eps)
              (FPCore (x eps_m) :precision binary64 1.0)
              eps_m = fabs(eps);
              double code(double x, double eps_m) {
              	return 1.0;
              }
              
              eps_m =     private
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x, eps_m)
              use fmin_fmax_functions
                  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 74.3%

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

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

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

                Reproduce

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