NMSE Section 6.1 mentioned, A

Percentage Accurate: 73.6% → 99.8%
Time: 6.8s
Alternatives: 15
Speedup: 3.4×

Specification

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

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

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 73.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: 99.8% 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 0.00068:\\ \;\;\;\;\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 0.00068)
     (* (+ 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 <= 0.00068) {
		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 <= 0.00068d0) 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 <= 0.00068) {
		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 <= 0.00068:
		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 <= 0.00068)
		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 <= 0.00068)
		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, 0.00068], 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 0.00068:\\
\;\;\;\;\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 < 6.8e-4

    1. Initial program 63.7%

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

      \[\leadsto \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 rewrites70.8%

      \[\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 6.8e-4 < eps

    1. Initial program 100.0%

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

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

        \[\leadsto \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-*.f64100.0

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    8. Applied rewrites100.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-*.f64100.0

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

      \[\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.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;\varepsilon \leq 0.00068:\\ \;\;\;\;\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 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 37.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 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 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.7

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

      \[\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. lower-exp.f64N/A

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

        \[\leadsto e^{-x} \]
    11. Applied rewrites95.7%

      \[\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 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-*.f64100.0

        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
    8. Applied rewrites100.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-*.f64100.0

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

      \[\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.2%

    \[\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: 98.9% 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 73.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 rewrites98.2%

    \[\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.2%

    \[\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 4: 84.1% accurate, 1.9× speedup?

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-241}:\\ \;\;\;\;\left(1 + e^{-x \cdot eps\_m}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 850000:\\ \;\;\;\;\left(e^{x \cdot eps\_m} - \left(\mathsf{fma}\left(x, eps\_m, x\right) - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.5 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right):\\ \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, eps\_m, 1\right)}{eps\_m}}{2}\\ \mathbf{else}:\\ \;\;\;\;\left(e^{x \cdot \left(-1 + eps\_m\right)} - -1\right) \cdot 0.5\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (if (<= x -8.2e-241)
   (* (+ 1.0 (exp (- (* x eps_m)))) 0.5)
   (if (<= x 850000.0)
     (* (- (exp (* x eps_m)) (- (fma x eps_m x) 1.0)) 0.5)
     (if (or (<= x 8.5e+71) (not (or (<= x 4.5e+123) (not (<= x 2.05e+167)))))
       (/ (- (* (+ 1.0 (/ 1.0 eps_m)) 1.0) (/ (fma -1.0 eps_m 1.0) eps_m)) 2.0)
       (* (- (exp (* x (+ -1.0 eps_m))) -1.0) 0.5)))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double tmp;
	if (x <= -8.2e-241) {
		tmp = (1.0 + exp(-(x * eps_m))) * 0.5;
	} else if (x <= 850000.0) {
		tmp = (exp((x * eps_m)) - (fma(x, eps_m, x) - 1.0)) * 0.5;
	} else if ((x <= 8.5e+71) || !((x <= 4.5e+123) || !(x <= 2.05e+167))) {
		tmp = (((1.0 + (1.0 / eps_m)) * 1.0) - (fma(-1.0, eps_m, 1.0) / eps_m)) / 2.0;
	} else {
		tmp = (exp((x * (-1.0 + eps_m))) - -1.0) * 0.5;
	}
	return tmp;
}
eps_m = abs(eps)
function code(x, eps_m)
	tmp = 0.0
	if (x <= -8.2e-241)
		tmp = Float64(Float64(1.0 + exp(Float64(-Float64(x * eps_m)))) * 0.5);
	elseif (x <= 850000.0)
		tmp = Float64(Float64(exp(Float64(x * eps_m)) - Float64(fma(x, eps_m, x) - 1.0)) * 0.5);
	elseif ((x <= 8.5e+71) || !((x <= 4.5e+123) || !(x <= 2.05e+167)))
		tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * 1.0) - Float64(fma(-1.0, eps_m, 1.0) / eps_m)) / 2.0);
	else
		tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) - -1.0) * 0.5);
	end
	return tmp
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := If[LessEqual[x, -8.2e-241], N[(N[(1.0 + N[Exp[(-N[(x * eps$95$m), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 850000.0], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - N[(N[(x * eps$95$m + x), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[Or[LessEqual[x, 8.5e+71], N[Not[Or[LessEqual[x, 4.5e+123], N[Not[LessEqual[x, 2.05e+167]], $MachinePrecision]]], $MachinePrecision]], N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] - N[(N[(-1.0 * eps$95$m + 1.0), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

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

\mathbf{elif}\;x \leq 850000:\\
\;\;\;\;\left(e^{x \cdot eps\_m} - \left(\mathsf{fma}\left(x, eps\_m, x\right) - 1\right)\right) \cdot 0.5\\

\mathbf{elif}\;x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.5 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right):\\
\;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, eps\_m, 1\right)}{eps\_m}}{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -8.1999999999999997e-241

    1. Initial program 69.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 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-*.f6497.6

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

      \[\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.0

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

      \[\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 rewrites68.3%

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

      if -8.1999999999999997e-241 < x < 8.5e5

      1. Initial program 56.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 rewrites97.4%

        \[\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-*.f6497.4

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

        \[\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-*.f6497.8

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

        \[\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(e^{x \cdot \varepsilon} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
      13. 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(\varepsilon \cdot x + x\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.f6486.1

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

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

      if 8.5e5 < x < 8.4999999999999996e71 or 4.49999999999999983e123 < x < 2.05e167

      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 \color{blue}{1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
      4. Step-by-step derivation
        1. Applied rewrites19.1%

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{-1 \cdot \varepsilon + 1}{\varepsilon}}{2} \]
          5. lower-fma.f6483.3

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

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

        if 8.4999999999999996e71 < x < 4.49999999999999983e123 or 2.05e167 < 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 x around 0

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-241}:\\ \;\;\;\;\left(1 + e^{-x \cdot \varepsilon}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 850000:\\ \;\;\;\;\left(e^{x \cdot \varepsilon} - \left(\mathsf{fma}\left(x, \varepsilon, x\right) - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.5 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right):\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, \varepsilon, 1\right)}{\varepsilon}}{2}\\ \mathbf{else}:\\ \;\;\;\;\left(e^{x \cdot \left(-1 + \varepsilon\right)} - -1\right) \cdot 0.5\\ \end{array} \]
        10. Add Preprocessing

        Alternative 5: 84.1% accurate, 1.9× speedup?

        \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-241}:\\ \;\;\;\;\left(1 + e^{-x \cdot eps\_m}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 850000:\\ \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.5 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right):\\ \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, eps\_m, 1\right)}{eps\_m}}{2}\\ \mathbf{else}:\\ \;\;\;\;\left(e^{x \cdot \left(-1 + eps\_m\right)} - -1\right) \cdot 0.5\\ \end{array} \end{array} \]
        eps_m = (fabs.f64 eps)
        (FPCore (x eps_m)
         :precision binary64
         (if (<= x -8.2e-241)
           (* (+ 1.0 (exp (- (* x eps_m)))) 0.5)
           (if (<= x 850000.0)
             (* (- (exp (* x eps_m)) -1.0) 0.5)
             (if (or (<= x 8.5e+71) (not (or (<= x 4.5e+123) (not (<= x 2.05e+167)))))
               (/ (- (* (+ 1.0 (/ 1.0 eps_m)) 1.0) (/ (fma -1.0 eps_m 1.0) eps_m)) 2.0)
               (* (- (exp (* x (+ -1.0 eps_m))) -1.0) 0.5)))))
        eps_m = fabs(eps);
        double code(double x, double eps_m) {
        	double tmp;
        	if (x <= -8.2e-241) {
        		tmp = (1.0 + exp(-(x * eps_m))) * 0.5;
        	} else if (x <= 850000.0) {
        		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
        	} else if ((x <= 8.5e+71) || !((x <= 4.5e+123) || !(x <= 2.05e+167))) {
        		tmp = (((1.0 + (1.0 / eps_m)) * 1.0) - (fma(-1.0, eps_m, 1.0) / eps_m)) / 2.0;
        	} else {
        		tmp = (exp((x * (-1.0 + eps_m))) - -1.0) * 0.5;
        	}
        	return tmp;
        }
        
        eps_m = abs(eps)
        function code(x, eps_m)
        	tmp = 0.0
        	if (x <= -8.2e-241)
        		tmp = Float64(Float64(1.0 + exp(Float64(-Float64(x * eps_m)))) * 0.5);
        	elseif (x <= 850000.0)
        		tmp = Float64(Float64(exp(Float64(x * eps_m)) - -1.0) * 0.5);
        	elseif ((x <= 8.5e+71) || !((x <= 4.5e+123) || !(x <= 2.05e+167)))
        		tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * 1.0) - Float64(fma(-1.0, eps_m, 1.0) / eps_m)) / 2.0);
        	else
        		tmp = Float64(Float64(exp(Float64(x * Float64(-1.0 + eps_m))) - -1.0) * 0.5);
        	end
        	return tmp
        end
        
        eps_m = N[Abs[eps], $MachinePrecision]
        code[x_, eps$95$m_] := If[LessEqual[x, -8.2e-241], N[(N[(1.0 + N[Exp[(-N[(x * eps$95$m), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 850000.0], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision], If[Or[LessEqual[x, 8.5e+71], N[Not[Or[LessEqual[x, 4.5e+123], N[Not[LessEqual[x, 2.05e+167]], $MachinePrecision]]], $MachinePrecision]], N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] - N[(N[(-1.0 * eps$95$m + 1.0), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[Exp[N[(x * N[(-1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision]]]]
        
        \begin{array}{l}
        eps_m = \left|\varepsilon\right|
        
        \\
        \begin{array}{l}
        \mathbf{if}\;x \leq -8.2 \cdot 10^{-241}:\\
        \;\;\;\;\left(1 + e^{-x \cdot eps\_m}\right) \cdot 0.5\\
        
        \mathbf{elif}\;x \leq 850000:\\
        \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\
        
        \mathbf{elif}\;x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.5 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right):\\
        \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, eps\_m, 1\right)}{eps\_m}}{2}\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(e^{x \cdot \left(-1 + eps\_m\right)} - -1\right) \cdot 0.5\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 4 regimes
        2. if x < -8.1999999999999997e-241

          1. Initial program 69.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 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-*.f6497.6

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

            \[\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.0

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

            \[\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 rewrites68.3%

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

            if -8.1999999999999997e-241 < x < 8.5e5

            1. Initial program 56.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 rewrites97.4%

              \[\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-*.f6497.4

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

              \[\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} - -1\right) \cdot \frac{1}{2} \]
            10. Step-by-step derivation
              1. Applied rewrites85.7%

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

              if 8.5e5 < x < 8.4999999999999996e71 or 4.49999999999999983e123 < x < 2.05e167

              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 \color{blue}{1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
              4. Step-by-step derivation
                1. Applied rewrites19.1%

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{-1 \cdot \varepsilon + 1}{\varepsilon}}{2} \]
                  5. lower-fma.f6483.3

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

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

                if 8.4999999999999996e71 < x < 4.49999999999999983e123 or 2.05e167 < 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 x around 0

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

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

                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-241}:\\ \;\;\;\;\left(1 + e^{-x \cdot \varepsilon}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 850000:\\ \;\;\;\;\left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.5 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right):\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, \varepsilon, 1\right)}{\varepsilon}}{2}\\ \mathbf{else}:\\ \;\;\;\;\left(e^{x \cdot \left(-1 + \varepsilon\right)} - -1\right) \cdot 0.5\\ \end{array} \]
                10. Add Preprocessing

                Alternative 6: 84.0% accurate, 1.9× speedup?

                \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-241}:\\ \;\;\;\;\left(1 + e^{-x \cdot eps\_m}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 850000 \lor \neg \left(x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.4 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right)\right):\\ \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, eps\_m, 1\right)}{eps\_m}}{2}\\ \end{array} \end{array} \]
                eps_m = (fabs.f64 eps)
                (FPCore (x eps_m)
                 :precision binary64
                 (if (<= x -8.2e-241)
                   (* (+ 1.0 (exp (- (* x eps_m)))) 0.5)
                   (if (or (<= x 850000.0)
                           (not
                            (or (<= x 8.5e+71)
                                (not (or (<= x 4.4e+123) (not (<= x 2.05e+167)))))))
                     (* (- (exp (* x eps_m)) -1.0) 0.5)
                     (/
                      (- (* (+ 1.0 (/ 1.0 eps_m)) 1.0) (/ (fma -1.0 eps_m 1.0) eps_m))
                      2.0))))
                eps_m = fabs(eps);
                double code(double x, double eps_m) {
                	double tmp;
                	if (x <= -8.2e-241) {
                		tmp = (1.0 + exp(-(x * eps_m))) * 0.5;
                	} else if ((x <= 850000.0) || !((x <= 8.5e+71) || !((x <= 4.4e+123) || !(x <= 2.05e+167)))) {
                		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
                	} else {
                		tmp = (((1.0 + (1.0 / eps_m)) * 1.0) - (fma(-1.0, eps_m, 1.0) / eps_m)) / 2.0;
                	}
                	return tmp;
                }
                
                eps_m = abs(eps)
                function code(x, eps_m)
                	tmp = 0.0
                	if (x <= -8.2e-241)
                		tmp = Float64(Float64(1.0 + exp(Float64(-Float64(x * eps_m)))) * 0.5);
                	elseif ((x <= 850000.0) || !((x <= 8.5e+71) || !((x <= 4.4e+123) || !(x <= 2.05e+167))))
                		tmp = Float64(Float64(exp(Float64(x * eps_m)) - -1.0) * 0.5);
                	else
                		tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * 1.0) - Float64(fma(-1.0, eps_m, 1.0) / eps_m)) / 2.0);
                	end
                	return tmp
                end
                
                eps_m = N[Abs[eps], $MachinePrecision]
                code[x_, eps$95$m_] := If[LessEqual[x, -8.2e-241], N[(N[(1.0 + N[Exp[(-N[(x * eps$95$m), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[Or[LessEqual[x, 850000.0], N[Not[Or[LessEqual[x, 8.5e+71], N[Not[Or[LessEqual[x, 4.4e+123], N[Not[LessEqual[x, 2.05e+167]], $MachinePrecision]]], $MachinePrecision]]], $MachinePrecision]], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] - N[(N[(-1.0 * eps$95$m + 1.0), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]]
                
                \begin{array}{l}
                eps_m = \left|\varepsilon\right|
                
                \\
                \begin{array}{l}
                \mathbf{if}\;x \leq -8.2 \cdot 10^{-241}:\\
                \;\;\;\;\left(1 + e^{-x \cdot eps\_m}\right) \cdot 0.5\\
                
                \mathbf{elif}\;x \leq 850000 \lor \neg \left(x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.4 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right)\right):\\
                \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\
                
                \mathbf{else}:\\
                \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, eps\_m, 1\right)}{eps\_m}}{2}\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if x < -8.1999999999999997e-241

                  1. Initial program 69.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 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-*.f6497.6

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

                    \[\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.0

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

                    \[\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 rewrites68.3%

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

                    if -8.1999999999999997e-241 < x < 8.5e5 or 8.4999999999999996e71 < x < 4.39999999999999984e123 or 2.05e167 < x

                    1. Initial program 70.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 rewrites98.2%

                      \[\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-*.f6491.3

                        \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                    8. Applied rewrites91.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 x around 0

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

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

                      if 8.5e5 < x < 8.4999999999999996e71 or 4.39999999999999984e123 < x < 2.05e167

                      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 \color{blue}{1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
                      4. Step-by-step derivation
                        1. Applied rewrites19.1%

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{-1 \cdot \varepsilon + 1}{\varepsilon}}{2} \]
                          5. lower-fma.f6483.3

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.2 \cdot 10^{-241}:\\ \;\;\;\;\left(1 + e^{-x \cdot \varepsilon}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 850000 \lor \neg \left(x \leq 8.5 \cdot 10^{+71} \lor \neg \left(x \leq 4.4 \cdot 10^{+123} \lor \neg \left(x \leq 2.05 \cdot 10^{+167}\right)\right)\right):\\ \;\;\;\;\left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, \varepsilon, 1\right)}{\varepsilon}}{2}\\ \end{array} \]
                      7. Add Preprocessing

                      Alternative 7: 77.6% accurate, 2.3× speedup?

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

                        1. Initial program 65.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 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-*.f6483.4

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

                          \[\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. lower-exp.f64N/A

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

                            \[\leadsto e^{-x} \]
                        11. Applied rewrites80.1%

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

                        if 1.0500000000000001e37 < eps

                        1. Initial program 100.0%

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

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

                            \[\leadsto \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-*.f64100.0

                            \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                        8. Applied rewrites100.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} - -1\right) \cdot \frac{1}{2} \]
                        10. Step-by-step derivation
                          1. Applied rewrites61.4%

                            \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5 \]
                        11. Recombined 2 regimes into one program.
                        12. Add Preprocessing

                        Alternative 8: 79.6% accurate, 2.5× speedup?

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

                          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-*.f64100.0

                              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                          8. Applied rewrites100.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 0

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

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

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

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

                          if -720 < x < -5.00000000000000008e-222

                          1. Initial program 53.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.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 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--.f6465.4

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

                            \[\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--.f6471.9

                              \[\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 rewrites71.9%

                            \[\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 -5.00000000000000008e-222 < x < 2.0000000000000002e-208

                          1. Initial program 66.9%

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

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

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

                            if 2.0000000000000002e-208 < x < 750

                            1. Initial program 49.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 rewrites95.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--.f6462.7

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

                              \[\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.0

                                \[\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.0%

                              \[\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 750 < x < 2.05e167

                            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 \color{blue}{1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
                            4. Step-by-step derivation
                              1. Applied rewrites23.3%

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{-1 \cdot \varepsilon + 1}{\varepsilon}}{2} \]
                                5. lower-fma.f6463.1

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

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

                              if 2.05e167 < 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-*.f6475.6

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

                                \[\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. lower-exp.f64N/A

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

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

                                \[\leadsto e^{-x} \]
                              12. Taylor expanded in x around 0

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot x - 1, x, 1\right) \]
                                5. lower-*.f6457.8

                                  \[\leadsto \mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right) \]
                              14. Applied rewrites57.8%

                                \[\leadsto \mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right) \]
                            5. Recombined 6 regimes into one program.
                            6. Final simplification76.6%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -720:\\ \;\;\;\;e^{-x}\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-222}:\\ \;\;\;\;\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 2 \cdot 10^{-208}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 750:\\ \;\;\;\;\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 2.05 \cdot 10^{+167}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, \varepsilon, 1\right)}{\varepsilon}}{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right)\\ \end{array} \]
                            7. Add Preprocessing

                            Alternative 9: 76.9% accurate, 3.4× speedup?

                            \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+122}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right)\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-222}:\\ \;\;\;\;\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 2 \cdot 10^{-208}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 750:\\ \;\;\;\;\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 2.05 \cdot 10^{+167}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, eps\_m, 1\right)}{eps\_m}}{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right)\\ \end{array} \end{array} \]
                            eps_m = (fabs.f64 eps)
                            (FPCore (x eps_m)
                             :precision binary64
                             (if (<= x -1.35e+122)
                               (fma (- (* (fma -0.16666666666666666 x 0.5) x) 1.0) x 1.0)
                               (if (<= x -5e-222)
                                 (*
                                  (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 2e-208)
                                   1.0
                                   (if (<= x 750.0)
                                     (*
                                      (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 2.05e+167)
                                       (/
                                        (- (* (+ 1.0 (/ 1.0 eps_m)) 1.0) (/ (fma -1.0 eps_m 1.0) eps_m))
                                        2.0)
                                       (fma (- (* 0.5 x) 1.0) x 1.0)))))))
                            eps_m = fabs(eps);
                            double code(double x, double eps_m) {
                            	double tmp;
                            	if (x <= -1.35e+122) {
                            		tmp = fma(((fma(-0.16666666666666666, x, 0.5) * x) - 1.0), x, 1.0);
                            	} else if (x <= -5e-222) {
                            		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 <= 2e-208) {
                            		tmp = 1.0;
                            	} else if (x <= 750.0) {
                            		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 <= 2.05e+167) {
                            		tmp = (((1.0 + (1.0 / eps_m)) * 1.0) - (fma(-1.0, eps_m, 1.0) / eps_m)) / 2.0;
                            	} else {
                            		tmp = fma(((0.5 * x) - 1.0), x, 1.0);
                            	}
                            	return tmp;
                            }
                            
                            eps_m = abs(eps)
                            function code(x, eps_m)
                            	tmp = 0.0
                            	if (x <= -1.35e+122)
                            		tmp = fma(Float64(Float64(fma(-0.16666666666666666, x, 0.5) * x) - 1.0), x, 1.0);
                            	elseif (x <= -5e-222)
                            		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 <= 2e-208)
                            		tmp = 1.0;
                            	elseif (x <= 750.0)
                            		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 <= 2.05e+167)
                            		tmp = Float64(Float64(Float64(Float64(1.0 + Float64(1.0 / eps_m)) * 1.0) - Float64(fma(-1.0, eps_m, 1.0) / eps_m)) / 2.0);
                            	else
                            		tmp = fma(Float64(Float64(0.5 * x) - 1.0), x, 1.0);
                            	end
                            	return tmp
                            end
                            
                            eps_m = N[Abs[eps], $MachinePrecision]
                            code[x_, eps$95$m_] := If[LessEqual[x, -1.35e+122], N[(N[(N[(N[(-0.16666666666666666 * x + 0.5), $MachinePrecision] * x), $MachinePrecision] - 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision], If[LessEqual[x, -5e-222], 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, 2e-208], 1.0, If[LessEqual[x, 750.0], 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, 2.05e+167], N[(N[(N[(N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision] - N[(N[(-1.0 * eps$95$m + 1.0), $MachinePrecision] / eps$95$m), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(0.5 * x), $MachinePrecision] - 1.0), $MachinePrecision] * x + 1.0), $MachinePrecision]]]]]]
                            
                            \begin{array}{l}
                            eps_m = \left|\varepsilon\right|
                            
                            \\
                            \begin{array}{l}
                            \mathbf{if}\;x \leq -1.35 \cdot 10^{+122}:\\
                            \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right)\\
                            
                            \mathbf{elif}\;x \leq -5 \cdot 10^{-222}:\\
                            \;\;\;\;\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 2 \cdot 10^{-208}:\\
                            \;\;\;\;1\\
                            
                            \mathbf{elif}\;x \leq 750:\\
                            \;\;\;\;\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 2.05 \cdot 10^{+167}:\\
                            \;\;\;\;\frac{\left(1 + \frac{1}{eps\_m}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, eps\_m, 1\right)}{eps\_m}}{2}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;\mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right)\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 6 regimes
                            2. if x < -1.3499999999999999e122

                              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-*.f64100.0

                                  \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                              8. Applied rewrites100.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 0

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

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

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

                                \[\leadsto e^{-x} \]
                              12. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right) \]
                              14. Applied rewrites100.0%

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

                              if -1.3499999999999999e122 < x < -5.00000000000000008e-222

                              1. Initial program 60.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.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--.f6456.2

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

                                \[\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--.f6465.5

                                  \[\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 rewrites65.5%

                                \[\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 -5.00000000000000008e-222 < x < 2.0000000000000002e-208

                              1. Initial program 66.9%

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

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

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

                                if 2.0000000000000002e-208 < x < 750

                                1. Initial program 49.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 rewrites95.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--.f6462.7

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

                                  \[\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.0

                                    \[\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.0%

                                  \[\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 750 < x < 2.05e167

                                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 \color{blue}{1} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
                                4. Step-by-step derivation
                                  1. Applied rewrites23.3%

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{-1 \cdot \varepsilon + 1}{\varepsilon}}{2} \]
                                    5. lower-fma.f6463.1

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

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

                                  if 2.05e167 < 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-*.f6475.6

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

                                    \[\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. lower-exp.f64N/A

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

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

                                    \[\leadsto e^{-x} \]
                                  12. Taylor expanded in x around 0

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot x - 1, x, 1\right) \]
                                    5. lower-*.f6457.8

                                      \[\leadsto \mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right) \]
                                  14. Applied rewrites57.8%

                                    \[\leadsto \mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right) \]
                                5. Recombined 6 regimes into one program.
                                6. Final simplification73.5%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+122}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right)\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-222}:\\ \;\;\;\;\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 2 \cdot 10^{-208}:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 750:\\ \;\;\;\;\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 2.05 \cdot 10^{+167}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \frac{\mathsf{fma}\left(-1, \varepsilon, 1\right)}{\varepsilon}}{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right)\\ \end{array} \]
                                7. Add Preprocessing

                                Alternative 10: 71.8% accurate, 4.7× speedup?

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

                                  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-*.f64100.0

                                      \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                                  8. Applied rewrites100.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 0

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

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

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

                                    \[\leadsto e^{-x} \]
                                  12. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

                                      \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right) \]
                                  14. Applied rewrites100.0%

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

                                  if -1.3499999999999999e122 < x < -5.00000000000000008e-222

                                  1. Initial program 60.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.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--.f6456.2

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

                                    \[\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--.f6465.5

                                      \[\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 rewrites65.5%

                                    \[\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 -5.00000000000000008e-222 < x < 6.50000000000000004e-195

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

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

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

                                    if 6.50000000000000004e-195 < x

                                    1. Initial program 79.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 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 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--.f6426.4

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

                                      \[\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-+.f6439.3

                                        \[\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 rewrites39.3%

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

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

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

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.35 \cdot 10^{+122}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right)\\ \mathbf{elif}\;x \leq -5 \cdot 10^{-222}:\\ \;\;\;\;\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 6.5 \cdot 10^{-195}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon - -1, \frac{-1 + \varepsilon \cdot \varepsilon}{1}\right), x, 2\right) \cdot 0.5\\ \end{array} \]
                                    15. Add Preprocessing

                                    Alternative 11: 65.9% accurate, 5.9× speedup?

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

                                      1. Initial program 68.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.2%

                                        \[\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.2

                                          \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                                      8. Applied rewrites98.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. lower-exp.f64N/A

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

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

                                        \[\leadsto e^{-x} \]
                                      12. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

                                          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right) \]
                                      14. Applied rewrites77.4%

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

                                      if 6.50000000000000004e-195 < x

                                      1. Initial program 79.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 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 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--.f6426.4

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

                                        \[\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-+.f6439.3

                                          \[\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 rewrites39.3%

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

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

                                          \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-1, \varepsilon + 1, -\frac{1 - \varepsilon \cdot \varepsilon}{1}\right), x, 2\right) \cdot 0.5 \]
                                      13. Recombined 2 regimes into one program.
                                      14. Final simplification67.0%

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

                                      Alternative 12: 59.8% accurate, 10.1× speedup?

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

                                        1. Initial program 63.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 rewrites98.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-*.f6498.6

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

                                          \[\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. lower-exp.f64N/A

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

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

                                          \[\leadsto e^{-x} \]
                                        12. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

                                            \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right) \]
                                        14. Applied rewrites75.8%

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

                                        if 6.19999999999999982e-30 < x

                                        1. Initial program 95.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 rewrites97.2%

                                          \[\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--.f644.8

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

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

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

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

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

                                        Alternative 13: 60.0% accurate, 10.1× speedup?

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

                                          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-*.f64100.0

                                              \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                                          8. Applied rewrites100.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 0

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

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

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

                                            \[\leadsto e^{-x} \]
                                          12. Taylor expanded in x around 0

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

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

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

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

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

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, x, 0.5\right) \cdot x - 1, x, 1\right) \]
                                          14. Applied rewrites73.9%

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

                                          if -155 < x

                                          1. Initial program 69.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.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-*.f6485.4

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

                                            \[\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. lower-exp.f64N/A

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

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

                                            \[\leadsto e^{-x} \]
                                          12. Taylor expanded in x around 0

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

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

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

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

                                              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot x - 1, x, 1\right) \]
                                            5. lower-*.f6458.6

                                              \[\leadsto \mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right) \]
                                          14. Applied rewrites58.6%

                                            \[\leadsto \mathsf{fma}\left(0.5 \cdot x - 1, x, 1\right) \]
                                        3. Recombined 2 regimes into one program.
                                        4. Add Preprocessing

                                        Alternative 14: 57.8% accurate, 18.2× speedup?

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

                                          \[\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-*.f6487.2

                                            \[\leadsto \left(e^{x \cdot \varepsilon} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
                                        8. Applied rewrites87.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. lower-exp.f64N/A

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

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

                                          \[\leadsto e^{-x} \]
                                        12. Taylor expanded in x around 0

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

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

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

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

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

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

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

                                        Alternative 15: 43.8% 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 73.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 \color{blue}{1} \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites45.5%

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

                                          Reproduce

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