NMSE Section 6.1 mentioned, A

Percentage Accurate: 72.9% → 100.0%
Time: 7.4s
Alternatives: 16
Speedup: 2.8×

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 16 alternatives:

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

Initial Program: 72.9% accurate, 1.0× speedup?

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

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

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

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

Alternative 1: 100.0% accurate, 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 1:\\ \;\;\;\;\left(t\_0 + t\_0\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\left(e^{x \cdot eps\_m} - \frac{-1}{e^{\mathsf{fma}\left(x, eps\_m, x\right)}}\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 1.0)
     (* (+ t_0 t_0) 0.5)
     (* (- (exp (* x eps_m)) (/ -1.0 (exp (fma x eps_m x)))) 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 <= 1.0) {
		tmp = (t_0 + t_0) * 0.5;
	} else {
		tmp = (exp((x * eps_m)) - (-1.0 / exp(fma(x, eps_m, x)))) * 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 <= 1.0)
		tmp = Float64(Float64(t_0 + t_0) * 0.5);
	else
		tmp = Float64(Float64(exp(Float64(x * eps_m)) - Float64(-1.0 / exp(fma(x, eps_m, x)))) * 0.5);
	end
	return tmp
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(x - -1.0), $MachinePrecision] * N[Exp[(-x)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[eps$95$m, 1.0], N[(N[(t$95$0 + t$95$0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - N[(-1.0 / N[Exp[N[(x * eps$95$m + x), $MachinePrecision]], $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 1:\\
\;\;\;\;\left(t\_0 + t\_0\right) \cdot 0.5\\

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


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

    1. Initial program 61.5%

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

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

        \[\leadsto \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 rewrites72.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} \]
    6. Step-by-step derivation
      1. distribute-rgt1-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(\left(x + 1\right) \cdot e^{-x} - \left(-\left(x + 1\right) \cdot e^{\mathsf{neg}\left(x\right)}\right)\right) \cdot \frac{1}{2} \]
      15. lower-neg.f6472.8

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

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

    if 1 < 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. Step-by-step derivation
      1. exp-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.9% accurate, 1.2× speedup?

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

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

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


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

    1. Initial program 61.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 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. Step-by-step derivation
      1. exp-negN/A

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

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

        \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(-\frac{1}{e^{x \cdot \varepsilon + x}}\right)\right) \cdot \frac{1}{2} \]
      4. lower-fma.f6497.6

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

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

      \[\leadsto \left(e^{-1 \cdot x} + \frac{1}{e^{x}}\right) \cdot \frac{1}{2} \]
    9. Step-by-step derivation
      1. rec-expN/A

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

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

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

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

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

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

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

        \[\leadsto \left(e^{-x} \cdot 2\right) \cdot 0.5 \]
    10. Applied rewrites81.6%

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

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

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

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

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

Alternative 3: 98.8% 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 71.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.3%

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

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

\[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := e^{-x} \cdot 2\\ \mathbf{if}\;x \leq -360000000:\\ \;\;\;\;t\_0 \cdot 0.5\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-285}:\\ \;\;\;\;\left(1 - \left(x \cdot \frac{1 - eps\_m \cdot eps\_m}{1 - eps\_m} - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+103} \lor \neg \left(x \leq 2.8 \cdot 10^{+196}\right):\\ \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot t\_0\right) \cdot 0.5\\ \end{array} \end{array} \]
eps_m = (fabs.f64 eps)
(FPCore (x eps_m)
 :precision binary64
 (let* ((t_0 (* (exp (- x)) 2.0)))
   (if (<= x -360000000.0)
     (* t_0 0.5)
     (if (<= x -6e-285)
       (* (- 1.0 (- (* x (/ (- 1.0 (* eps_m eps_m)) (- 1.0 eps_m))) 1.0)) 0.5)
       (if (or (<= x 1.25e+103) (not (<= x 2.8e+196)))
         (* (- (exp (* x eps_m)) -1.0) 0.5)
         (* (* x t_0) 0.5))))))
eps_m = fabs(eps);
double code(double x, double eps_m) {
	double t_0 = exp(-x) * 2.0;
	double tmp;
	if (x <= -360000000.0) {
		tmp = t_0 * 0.5;
	} else if (x <= -6e-285) {
		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5;
	} else if ((x <= 1.25e+103) || !(x <= 2.8e+196)) {
		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
	} else {
		tmp = (x * t_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) :: t_0
    real(8) :: tmp
    t_0 = exp(-x) * 2.0d0
    if (x <= (-360000000.0d0)) then
        tmp = t_0 * 0.5d0
    else if (x <= (-6d-285)) then
        tmp = (1.0d0 - ((x * ((1.0d0 - (eps_m * eps_m)) / (1.0d0 - eps_m))) - 1.0d0)) * 0.5d0
    else if ((x <= 1.25d+103) .or. (.not. (x <= 2.8d+196))) then
        tmp = (exp((x * eps_m)) - (-1.0d0)) * 0.5d0
    else
        tmp = (x * t_0) * 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 = Math.exp(-x) * 2.0;
	double tmp;
	if (x <= -360000000.0) {
		tmp = t_0 * 0.5;
	} else if (x <= -6e-285) {
		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5;
	} else if ((x <= 1.25e+103) || !(x <= 2.8e+196)) {
		tmp = (Math.exp((x * eps_m)) - -1.0) * 0.5;
	} else {
		tmp = (x * t_0) * 0.5;
	}
	return tmp;
}
eps_m = math.fabs(eps)
def code(x, eps_m):
	t_0 = math.exp(-x) * 2.0
	tmp = 0
	if x <= -360000000.0:
		tmp = t_0 * 0.5
	elif x <= -6e-285:
		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5
	elif (x <= 1.25e+103) or not (x <= 2.8e+196):
		tmp = (math.exp((x * eps_m)) - -1.0) * 0.5
	else:
		tmp = (x * t_0) * 0.5
	return tmp
eps_m = abs(eps)
function code(x, eps_m)
	t_0 = Float64(exp(Float64(-x)) * 2.0)
	tmp = 0.0
	if (x <= -360000000.0)
		tmp = Float64(t_0 * 0.5);
	elseif (x <= -6e-285)
		tmp = Float64(Float64(1.0 - Float64(Float64(x * Float64(Float64(1.0 - Float64(eps_m * eps_m)) / Float64(1.0 - eps_m))) - 1.0)) * 0.5);
	elseif ((x <= 1.25e+103) || !(x <= 2.8e+196))
		tmp = Float64(Float64(exp(Float64(x * eps_m)) - -1.0) * 0.5);
	else
		tmp = Float64(Float64(x * t_0) * 0.5);
	end
	return tmp
end
eps_m = abs(eps);
function tmp_2 = code(x, eps_m)
	t_0 = exp(-x) * 2.0;
	tmp = 0.0;
	if (x <= -360000000.0)
		tmp = t_0 * 0.5;
	elseif (x <= -6e-285)
		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5;
	elseif ((x <= 1.25e+103) || ~((x <= 2.8e+196)))
		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
	else
		tmp = (x * t_0) * 0.5;
	end
	tmp_2 = tmp;
end
eps_m = N[Abs[eps], $MachinePrecision]
code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[Exp[(-x)], $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[x, -360000000.0], N[(t$95$0 * 0.5), $MachinePrecision], If[LessEqual[x, -6e-285], N[(N[(1.0 - N[(N[(x * N[(N[(1.0 - N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] / N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[Or[LessEqual[x, 1.25e+103], N[Not[LessEqual[x, 2.8e+196]], $MachinePrecision]], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision], N[(N[(x * t$95$0), $MachinePrecision] * 0.5), $MachinePrecision]]]]]
\begin{array}{l}
eps_m = \left|\varepsilon\right|

\\
\begin{array}{l}
t_0 := e^{-x} \cdot 2\\
\mathbf{if}\;x \leq -360000000:\\
\;\;\;\;t\_0 \cdot 0.5\\

\mathbf{elif}\;x \leq -6 \cdot 10^{-285}:\\
\;\;\;\;\left(1 - \left(x \cdot \frac{1 - eps\_m \cdot eps\_m}{1 - eps\_m} - 1\right)\right) \cdot 0.5\\

\mathbf{elif}\;x \leq 1.25 \cdot 10^{+103} \lor \neg \left(x \leq 2.8 \cdot 10^{+196}\right):\\
\;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\

\mathbf{else}:\\
\;\;\;\;\left(x \cdot t\_0\right) \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.6e8

    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. Step-by-step derivation
      1. exp-negN/A

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

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

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

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

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

      \[\leadsto \left(e^{-1 \cdot x} + \frac{1}{e^{x}}\right) \cdot \frac{1}{2} \]
    9. Step-by-step derivation
      1. rec-expN/A

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

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

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

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

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

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

        \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} \cdot 2\right) \cdot \frac{1}{2} \]
      8. lower-neg.f64100.0

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

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

    if -3.6e8 < x < -6.00000000000000007e-285

    1. Initial program 54.0%

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

      \[\leadsto \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.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)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
    7. Step-by-step derivation
      1. lower--.f64N/A

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

        \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
      3. lower-+.f6481.5

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

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

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

        \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
      2. Step-by-step derivation
        1. flip-+N/A

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

          \[\leadsto \left(1 - \left(x \cdot \frac{1 \cdot 1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
        3. metadata-evalN/A

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

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

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

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

          \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
        8. lower--.f6472.0

          \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5 \]
      3. Applied rewrites72.0%

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

      if -6.00000000000000007e-285 < x < 1.25e103 or 2.8000000000000002e196 < x

      1. Initial program 67.4%

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

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

        \[\leadsto \color{blue}{\left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5} \]
      6. Step-by-step derivation
        1. exp-negN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot \frac{1}{2} \]
      12. Step-by-step derivation
        1. rec-exp68.5

          \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5 \]
      13. Applied rewrites68.5%

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

      if 1.25e103 < x < 2.8000000000000002e196

      1. Initial program 100.0%

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

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

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

        \[\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} \]
      6. Taylor expanded in x around inf

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

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

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

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

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

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

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

          \[\leadsto \left(x \cdot \left(e^{-x} - \left(-e^{\mathsf{neg}\left(x\right)}\right)\right)\right) \cdot \frac{1}{2} \]
        8. lower-neg.f6478.9

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

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

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

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

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

          \[\leadsto \left(x \cdot \left(e^{\mathsf{neg}\left(x\right)} \cdot 2\right)\right) \cdot \frac{1}{2} \]
        4. lower-neg.f6478.9

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -360000000:\\ \;\;\;\;\left(e^{-x} \cdot 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-285}:\\ \;\;\;\;\left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+103} \lor \neg \left(x \leq 2.8 \cdot 10^{+196}\right):\\ \;\;\;\;\left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(e^{-x} \cdot 2\right)\right) \cdot 0.5\\ \end{array} \]
    13. Add Preprocessing

    Alternative 5: 81.1% accurate, 2.0× speedup?

    \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := \left(e^{-x} \cdot 2\right) \cdot 0.5\\ \mathbf{if}\;x \leq -360000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-285}:\\ \;\;\;\;\left(1 - \left(x \cdot \frac{1 - eps\_m \cdot eps\_m}{1 - eps\_m} - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+103} \lor \neg \left(x \leq 8.5 \cdot 10^{+236}\right):\\ \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    eps_m = (fabs.f64 eps)
    (FPCore (x eps_m)
     :precision binary64
     (let* ((t_0 (* (* (exp (- x)) 2.0) 0.5)))
       (if (<= x -360000000.0)
         t_0
         (if (<= x -6e-285)
           (* (- 1.0 (- (* x (/ (- 1.0 (* eps_m eps_m)) (- 1.0 eps_m))) 1.0)) 0.5)
           (if (or (<= x 1.25e+103) (not (<= x 8.5e+236)))
             (* (- (exp (* x eps_m)) -1.0) 0.5)
             t_0)))))
    eps_m = fabs(eps);
    double code(double x, double eps_m) {
    	double t_0 = (exp(-x) * 2.0) * 0.5;
    	double tmp;
    	if (x <= -360000000.0) {
    		tmp = t_0;
    	} else if (x <= -6e-285) {
    		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5;
    	} else if ((x <= 1.25e+103) || !(x <= 8.5e+236)) {
    		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    eps_m =     private
    module fmin_fmax_functions
        implicit none
        private
        public fmax
        public fmin
    
        interface fmax
            module procedure fmax88
            module procedure fmax44
            module procedure fmax84
            module procedure fmax48
        end interface
        interface fmin
            module procedure fmin88
            module procedure fmin44
            module procedure fmin84
            module procedure fmin48
        end interface
    contains
        real(8) function fmax88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(4) function fmax44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
        end function
        real(8) function fmax84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmax48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
        end function
        real(8) function fmin88(x, y) result (res)
            real(8), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(4) function fmin44(x, y) result (res)
            real(4), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
        end function
        real(8) function fmin84(x, y) result(res)
            real(8), intent (in) :: x
            real(4), intent (in) :: y
            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
        end function
        real(8) function fmin48(x, y) result(res)
            real(4), intent (in) :: x
            real(8), intent (in) :: y
            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
        end function
    end module
    
    real(8) function code(x, eps_m)
    use fmin_fmax_functions
        real(8), intent (in) :: x
        real(8), intent (in) :: eps_m
        real(8) :: t_0
        real(8) :: tmp
        t_0 = (exp(-x) * 2.0d0) * 0.5d0
        if (x <= (-360000000.0d0)) then
            tmp = t_0
        else if (x <= (-6d-285)) then
            tmp = (1.0d0 - ((x * ((1.0d0 - (eps_m * eps_m)) / (1.0d0 - eps_m))) - 1.0d0)) * 0.5d0
        else if ((x <= 1.25d+103) .or. (.not. (x <= 8.5d+236))) then
            tmp = (exp((x * eps_m)) - (-1.0d0)) * 0.5d0
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    eps_m = Math.abs(eps);
    public static double code(double x, double eps_m) {
    	double t_0 = (Math.exp(-x) * 2.0) * 0.5;
    	double tmp;
    	if (x <= -360000000.0) {
    		tmp = t_0;
    	} else if (x <= -6e-285) {
    		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5;
    	} else if ((x <= 1.25e+103) || !(x <= 8.5e+236)) {
    		tmp = (Math.exp((x * eps_m)) - -1.0) * 0.5;
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    eps_m = math.fabs(eps)
    def code(x, eps_m):
    	t_0 = (math.exp(-x) * 2.0) * 0.5
    	tmp = 0
    	if x <= -360000000.0:
    		tmp = t_0
    	elif x <= -6e-285:
    		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5
    	elif (x <= 1.25e+103) or not (x <= 8.5e+236):
    		tmp = (math.exp((x * eps_m)) - -1.0) * 0.5
    	else:
    		tmp = t_0
    	return tmp
    
    eps_m = abs(eps)
    function code(x, eps_m)
    	t_0 = Float64(Float64(exp(Float64(-x)) * 2.0) * 0.5)
    	tmp = 0.0
    	if (x <= -360000000.0)
    		tmp = t_0;
    	elseif (x <= -6e-285)
    		tmp = Float64(Float64(1.0 - Float64(Float64(x * Float64(Float64(1.0 - Float64(eps_m * eps_m)) / Float64(1.0 - eps_m))) - 1.0)) * 0.5);
    	elseif ((x <= 1.25e+103) || !(x <= 8.5e+236))
    		tmp = Float64(Float64(exp(Float64(x * eps_m)) - -1.0) * 0.5);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    eps_m = abs(eps);
    function tmp_2 = code(x, eps_m)
    	t_0 = (exp(-x) * 2.0) * 0.5;
    	tmp = 0.0;
    	if (x <= -360000000.0)
    		tmp = t_0;
    	elseif (x <= -6e-285)
    		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5;
    	elseif ((x <= 1.25e+103) || ~((x <= 8.5e+236)))
    		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    eps_m = N[Abs[eps], $MachinePrecision]
    code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(N[Exp[(-x)], $MachinePrecision] * 2.0), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[x, -360000000.0], t$95$0, If[LessEqual[x, -6e-285], N[(N[(1.0 - N[(N[(x * N[(N[(1.0 - N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] / N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[Or[LessEqual[x, 1.25e+103], N[Not[LessEqual[x, 8.5e+236]], $MachinePrecision]], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision], t$95$0]]]]
    
    \begin{array}{l}
    eps_m = \left|\varepsilon\right|
    
    \\
    \begin{array}{l}
    t_0 := \left(e^{-x} \cdot 2\right) \cdot 0.5\\
    \mathbf{if}\;x \leq -360000000:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;x \leq -6 \cdot 10^{-285}:\\
    \;\;\;\;\left(1 - \left(x \cdot \frac{1 - eps\_m \cdot eps\_m}{1 - eps\_m} - 1\right)\right) \cdot 0.5\\
    
    \mathbf{elif}\;x \leq 1.25 \cdot 10^{+103} \lor \neg \left(x \leq 8.5 \cdot 10^{+236}\right):\\
    \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if x < -3.6e8 or 1.25e103 < x < 8.5000000000000008e236

      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. Step-by-step derivation
        1. exp-negN/A

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

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

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

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

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

        \[\leadsto \left(e^{-1 \cdot x} + \frac{1}{e^{x}}\right) \cdot \frac{1}{2} \]
      9. Step-by-step derivation
        1. rec-expN/A

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

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

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

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

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

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

          \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} \cdot 2\right) \cdot \frac{1}{2} \]
        8. lower-neg.f6487.5

          \[\leadsto \left(e^{-x} \cdot 2\right) \cdot 0.5 \]
      10. Applied rewrites87.5%

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

      if -3.6e8 < x < -6.00000000000000007e-285

      1. Initial program 54.0%

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

        \[\leadsto \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.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)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
      7. Step-by-step derivation
        1. lower--.f64N/A

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

          \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
        3. lower-+.f6481.5

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

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

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

          \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
        2. Step-by-step derivation
          1. flip-+N/A

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

            \[\leadsto \left(1 - \left(x \cdot \frac{1 \cdot 1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
          3. metadata-evalN/A

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

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

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

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

            \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
          8. lower--.f6472.0

            \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5 \]
        3. Applied rewrites72.0%

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

        if -6.00000000000000007e-285 < x < 1.25e103 or 8.5000000000000008e236 < x

        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 rewrites98.8%

          \[\leadsto \color{blue}{\left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5} \]
        6. Step-by-step derivation
          1. exp-negN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot \frac{1}{2} \]
        12. Step-by-step derivation
          1. rec-exp71.3

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -360000000:\\ \;\;\;\;\left(e^{-x} \cdot 2\right) \cdot 0.5\\ \mathbf{elif}\;x \leq -6 \cdot 10^{-285}:\\ \;\;\;\;\left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+103} \lor \neg \left(x \leq 8.5 \cdot 10^{+236}\right):\\ \;\;\;\;\left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\left(e^{-x} \cdot 2\right) \cdot 0.5\\ \end{array} \]
      13. Add Preprocessing

      Alternative 6: 84.1% accurate, 2.0× speedup?

      \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-288}:\\ \;\;\;\;\left(1 + e^{-\mathsf{fma}\left(x, eps\_m, x\right)}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 6.8:\\ \;\;\;\;\left(e^{x \cdot eps\_m} - \left(x \cdot \left(1 + eps\_m\right) - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+196}:\\ \;\;\;\;\left(x \cdot \left(e^{-x} \cdot 2\right)\right) \cdot 0.5\\ \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 -2e-288)
         (* (+ 1.0 (exp (- (fma x eps_m x)))) 0.5)
         (if (<= x 6.8)
           (* (- (exp (* x eps_m)) (- (* x (+ 1.0 eps_m)) 1.0)) 0.5)
           (if (<= x 2.8e+196)
             (* (* x (* (exp (- x)) 2.0)) 0.5)
             (* (- (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 <= -2e-288) {
      		tmp = (1.0 + exp(-fma(x, eps_m, x))) * 0.5;
      	} else if (x <= 6.8) {
      		tmp = (exp((x * eps_m)) - ((x * (1.0 + eps_m)) - 1.0)) * 0.5;
      	} else if (x <= 2.8e+196) {
      		tmp = (x * (exp(-x) * 2.0)) * 0.5;
      	} 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 <= -2e-288)
      		tmp = Float64(Float64(1.0 + exp(Float64(-fma(x, eps_m, x)))) * 0.5);
      	elseif (x <= 6.8)
      		tmp = Float64(Float64(exp(Float64(x * eps_m)) - Float64(Float64(x * Float64(1.0 + eps_m)) - 1.0)) * 0.5);
      	elseif (x <= 2.8e+196)
      		tmp = Float64(Float64(x * Float64(exp(Float64(-x)) * 2.0)) * 0.5);
      	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, -2e-288], N[(N[(1.0 + N[Exp[(-N[(x * eps$95$m + x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 6.8], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - N[(N[(x * N[(1.0 + eps$95$m), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 2.8e+196], N[(N[(x * N[(N[Exp[(-x)], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * 0.5), $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 -2 \cdot 10^{-288}:\\
      \;\;\;\;\left(1 + e^{-\mathsf{fma}\left(x, eps\_m, x\right)}\right) \cdot 0.5\\
      
      \mathbf{elif}\;x \leq 6.8:\\
      \;\;\;\;\left(e^{x \cdot eps\_m} - \left(x \cdot \left(1 + eps\_m\right) - 1\right)\right) \cdot 0.5\\
      
      \mathbf{elif}\;x \leq 2.8 \cdot 10^{+196}:\\
      \;\;\;\;\left(x \cdot \left(e^{-x} \cdot 2\right)\right) \cdot 0.5\\
      
      \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 < -2.00000000000000012e-288

        1. Initial program 68.8%

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

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

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

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

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

          \[\leadsto \left(1 - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
        7. Step-by-step derivation
          1. distribute-lft-neg-in69.2

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

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

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

        if -2.00000000000000012e-288 < x < 6.79999999999999982

        1. Initial program 49.5%

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

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

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

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

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

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

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

            \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
          3. lower-+.f6487.0

            \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
        8. Applied rewrites87.0%

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

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

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

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

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

        if 6.79999999999999982 < x < 2.8000000000000002e196

        1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(x \cdot \left(e^{-x} - \left(-e^{\mathsf{neg}\left(x\right)}\right)\right)\right) \cdot \frac{1}{2} \]
          8. lower-neg.f6466.9

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

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

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

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

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

            \[\leadsto \left(x \cdot \left(e^{\mathsf{neg}\left(x\right)} \cdot 2\right)\right) \cdot \frac{1}{2} \]
          4. lower-neg.f6466.9

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

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

        if 2.8000000000000002e196 < 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 rewrites36.8%

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

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

        Alternative 7: 84.0% accurate, 2.0× speedup?

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

          1. Initial program 67.4%

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

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

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

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

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

            \[\leadsto \left(1 - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. distribute-lft-neg-in69.8

              \[\leadsto \left(1 - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
            2. sinh---cosh-rev69.8

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

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

          if -2e-296 < x < 1.25e103 or 2.8000000000000002e196 < x

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

            \[\leadsto \color{blue}{\left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5} \]
          6. Step-by-step derivation
            1. exp-negN/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot \frac{1}{2} \]
          12. Step-by-step derivation
            1. rec-exp67.8

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

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

          if 1.25e103 < x < 2.8000000000000002e196

          1. Initial program 100.0%

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

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

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

            \[\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} \]
          6. Taylor expanded in x around inf

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

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

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

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

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

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

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

              \[\leadsto \left(x \cdot \left(e^{-x} - \left(-e^{\mathsf{neg}\left(x\right)}\right)\right)\right) \cdot \frac{1}{2} \]
            8. lower-neg.f6478.9

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

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

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

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

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

              \[\leadsto \left(x \cdot \left(e^{\mathsf{neg}\left(x\right)} \cdot 2\right)\right) \cdot \frac{1}{2} \]
            4. lower-neg.f6478.9

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-296}:\\ \;\;\;\;\left(1 + e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+103} \lor \neg \left(x \leq 2.8 \cdot 10^{+196}\right):\\ \;\;\;\;\left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot \left(e^{-x} \cdot 2\right)\right) \cdot 0.5\\ \end{array} \]
        5. Add Preprocessing

        Alternative 8: 84.1% accurate, 2.0× speedup?

        \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-296}:\\ \;\;\;\;\left(1 + e^{-\mathsf{fma}\left(x, eps\_m, x\right)}\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 1.25 \cdot 10^{+103}:\\ \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{+196}:\\ \;\;\;\;\left(x \cdot \left(e^{-x} \cdot 2\right)\right) \cdot 0.5\\ \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 -2e-296)
           (* (+ 1.0 (exp (- (fma x eps_m x)))) 0.5)
           (if (<= x 1.25e+103)
             (* (- (exp (* x eps_m)) -1.0) 0.5)
             (if (<= x 2.8e+196)
               (* (* x (* (exp (- x)) 2.0)) 0.5)
               (* (- (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 <= -2e-296) {
        		tmp = (1.0 + exp(-fma(x, eps_m, x))) * 0.5;
        	} else if (x <= 1.25e+103) {
        		tmp = (exp((x * eps_m)) - -1.0) * 0.5;
        	} else if (x <= 2.8e+196) {
        		tmp = (x * (exp(-x) * 2.0)) * 0.5;
        	} 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 <= -2e-296)
        		tmp = Float64(Float64(1.0 + exp(Float64(-fma(x, eps_m, x)))) * 0.5);
        	elseif (x <= 1.25e+103)
        		tmp = Float64(Float64(exp(Float64(x * eps_m)) - -1.0) * 0.5);
        	elseif (x <= 2.8e+196)
        		tmp = Float64(Float64(x * Float64(exp(Float64(-x)) * 2.0)) * 0.5);
        	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, -2e-296], N[(N[(1.0 + N[Exp[(-N[(x * eps$95$m + x), $MachinePrecision])], $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 1.25e+103], N[(N[(N[Exp[N[(x * eps$95$m), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 2.8e+196], N[(N[(x * N[(N[Exp[(-x)], $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision] * 0.5), $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 -2 \cdot 10^{-296}:\\
        \;\;\;\;\left(1 + e^{-\mathsf{fma}\left(x, eps\_m, x\right)}\right) \cdot 0.5\\
        
        \mathbf{elif}\;x \leq 1.25 \cdot 10^{+103}:\\
        \;\;\;\;\left(e^{x \cdot eps\_m} - -1\right) \cdot 0.5\\
        
        \mathbf{elif}\;x \leq 2.8 \cdot 10^{+196}:\\
        \;\;\;\;\left(x \cdot \left(e^{-x} \cdot 2\right)\right) \cdot 0.5\\
        
        \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 < -2e-296

          1. Initial program 67.4%

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

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

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

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

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

            \[\leadsto \left(1 - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot \frac{1}{2} \]
          7. Step-by-step derivation
            1. distribute-lft-neg-in69.8

              \[\leadsto \left(1 - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5 \]
            2. sinh---cosh-rev69.8

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

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

          if -2e-296 < x < 1.25e103

          1. Initial program 60.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.5%

            \[\leadsto \color{blue}{\left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(-e^{-\mathsf{fma}\left(x, \varepsilon, x\right)}\right)\right) \cdot 0.5} \]
          6. Step-by-step derivation
            1. exp-negN/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot \frac{1}{2} \]
          12. Step-by-step derivation
            1. rec-exp76.2

              \[\leadsto \left(e^{x \cdot \varepsilon} - -1\right) \cdot 0.5 \]
          13. Applied rewrites76.2%

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

          if 1.25e103 < x < 2.8000000000000002e196

          1. Initial program 100.0%

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

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

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

            \[\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} \]
          6. Taylor expanded in x around inf

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

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

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

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

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

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

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

              \[\leadsto \left(x \cdot \left(e^{-x} - \left(-e^{\mathsf{neg}\left(x\right)}\right)\right)\right) \cdot \frac{1}{2} \]
            8. lower-neg.f6478.9

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

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

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

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

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

              \[\leadsto \left(x \cdot \left(e^{\mathsf{neg}\left(x\right)} \cdot 2\right)\right) \cdot \frac{1}{2} \]
            4. lower-neg.f6478.9

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

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

          if 2.8000000000000002e196 < 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 rewrites36.8%

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

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

          Alternative 9: 72.7% accurate, 2.3× speedup?

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

            1. Initial program 68.5%

              \[\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot e^{-\left(1 - \varepsilon\right) \cdot x} - \left(\frac{1}{\varepsilon} - 1\right) \cdot e^{-\left(1 + \varepsilon\right) \cdot x}}{2} \]
            2. Add Preprocessing
            3. Taylor expanded in eps around 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. Step-by-step derivation
              1. exp-negN/A

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

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

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

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

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

              \[\leadsto \left(e^{-1 \cdot x} + \frac{1}{e^{x}}\right) \cdot \frac{1}{2} \]
            9. Step-by-step derivation
              1. rec-expN/A

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

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

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

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

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

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

                \[\leadsto \left(e^{\mathsf{neg}\left(x\right)} \cdot 2\right) \cdot \frac{1}{2} \]
              8. lower-neg.f6477.3

                \[\leadsto \left(e^{-x} \cdot 2\right) \cdot 0.5 \]
            10. Applied rewrites77.3%

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

            if 5.2000000000000003e199 < eps

            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
              2. Step-by-step derivation
                1. flip-+N/A

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

                  \[\leadsto \left(1 - \left(x \cdot \frac{1 \cdot 1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
                3. metadata-evalN/A

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

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

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

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

                  \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
                8. lower--.f6456.3

                  \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5 \]
              3. Applied rewrites56.3%

                \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5 \]
            11. Recombined 2 regimes into one program.
            12. Final simplification75.3%

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

            Alternative 10: 73.0% accurate, 2.8× speedup?

            \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \begin{array}{l} t_0 := \left(eps\_m - 1\right) \cdot x\\ t_1 := \left(\frac{1}{eps\_m} - 1\right) \cdot 1\\ t_2 := 1 + \frac{1}{eps\_m}\\ \mathbf{if}\;x \leq -520000000:\\ \;\;\;\;\frac{t\_2 \cdot \frac{1 - t\_0 \cdot t\_0}{1 - \left(-x\right)} - t\_1}{2}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-218}:\\ \;\;\;\;\left(1 - \left(x \cdot \frac{1 - eps\_m \cdot eps\_m}{1 - eps\_m} - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 360:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+206}:\\ \;\;\;\;\frac{t\_2 \cdot 1 - t\_1}{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, x \cdot x, 1\right)\\ \end{array} \end{array} \]
            eps_m = (fabs.f64 eps)
            (FPCore (x eps_m)
             :precision binary64
             (let* ((t_0 (* (- eps_m 1.0) x))
                    (t_1 (* (- (/ 1.0 eps_m) 1.0) 1.0))
                    (t_2 (+ 1.0 (/ 1.0 eps_m))))
               (if (<= x -520000000.0)
                 (/ (- (* t_2 (/ (- 1.0 (* t_0 t_0)) (- 1.0 (- x)))) t_1) 2.0)
                 (if (<= x -2e-218)
                   (* (- 1.0 (- (* x (/ (- 1.0 (* eps_m eps_m)) (- 1.0 eps_m))) 1.0)) 0.5)
                   (if (<= x 360.0)
                     1.0
                     (if (<= x 2.4e+206)
                       (/ (- (* t_2 1.0) t_1) 2.0)
                       (fma (- (* 0.3333333333333333 x) 0.5) (* x x) 1.0)))))))
            eps_m = fabs(eps);
            double code(double x, double eps_m) {
            	double t_0 = (eps_m - 1.0) * x;
            	double t_1 = ((1.0 / eps_m) - 1.0) * 1.0;
            	double t_2 = 1.0 + (1.0 / eps_m);
            	double tmp;
            	if (x <= -520000000.0) {
            		tmp = ((t_2 * ((1.0 - (t_0 * t_0)) / (1.0 - -x))) - t_1) / 2.0;
            	} else if (x <= -2e-218) {
            		tmp = (1.0 - ((x * ((1.0 - (eps_m * eps_m)) / (1.0 - eps_m))) - 1.0)) * 0.5;
            	} else if (x <= 360.0) {
            		tmp = 1.0;
            	} else if (x <= 2.4e+206) {
            		tmp = ((t_2 * 1.0) - t_1) / 2.0;
            	} else {
            		tmp = fma(((0.3333333333333333 * x) - 0.5), (x * x), 1.0);
            	}
            	return tmp;
            }
            
            eps_m = abs(eps)
            function code(x, eps_m)
            	t_0 = Float64(Float64(eps_m - 1.0) * x)
            	t_1 = Float64(Float64(Float64(1.0 / eps_m) - 1.0) * 1.0)
            	t_2 = Float64(1.0 + Float64(1.0 / eps_m))
            	tmp = 0.0
            	if (x <= -520000000.0)
            		tmp = Float64(Float64(Float64(t_2 * Float64(Float64(1.0 - Float64(t_0 * t_0)) / Float64(1.0 - Float64(-x)))) - t_1) / 2.0);
            	elseif (x <= -2e-218)
            		tmp = Float64(Float64(1.0 - Float64(Float64(x * Float64(Float64(1.0 - Float64(eps_m * eps_m)) / Float64(1.0 - eps_m))) - 1.0)) * 0.5);
            	elseif (x <= 360.0)
            		tmp = 1.0;
            	elseif (x <= 2.4e+206)
            		tmp = Float64(Float64(Float64(t_2 * 1.0) - t_1) / 2.0);
            	else
            		tmp = fma(Float64(Float64(0.3333333333333333 * x) - 0.5), Float64(x * x), 1.0);
            	end
            	return tmp
            end
            
            eps_m = N[Abs[eps], $MachinePrecision]
            code[x_, eps$95$m_] := Block[{t$95$0 = N[(N[(eps$95$m - 1.0), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(1.0 / eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision] * 1.0), $MachinePrecision]}, Block[{t$95$2 = N[(1.0 + N[(1.0 / eps$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -520000000.0], N[(N[(N[(t$95$2 * N[(N[(1.0 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(1.0 - (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] / 2.0), $MachinePrecision], If[LessEqual[x, -2e-218], N[(N[(1.0 - N[(N[(x * N[(N[(1.0 - N[(eps$95$m * eps$95$m), $MachinePrecision]), $MachinePrecision] / N[(1.0 - eps$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[x, 360.0], 1.0, If[LessEqual[x, 2.4e+206], N[(N[(N[(t$95$2 * 1.0), $MachinePrecision] - t$95$1), $MachinePrecision] / 2.0), $MachinePrecision], N[(N[(N[(0.3333333333333333 * x), $MachinePrecision] - 0.5), $MachinePrecision] * N[(x * x), $MachinePrecision] + 1.0), $MachinePrecision]]]]]]]]
            
            \begin{array}{l}
            eps_m = \left|\varepsilon\right|
            
            \\
            \begin{array}{l}
            t_0 := \left(eps\_m - 1\right) \cdot x\\
            t_1 := \left(\frac{1}{eps\_m} - 1\right) \cdot 1\\
            t_2 := 1 + \frac{1}{eps\_m}\\
            \mathbf{if}\;x \leq -520000000:\\
            \;\;\;\;\frac{t\_2 \cdot \frac{1 - t\_0 \cdot t\_0}{1 - \left(-x\right)} - t\_1}{2}\\
            
            \mathbf{elif}\;x \leq -2 \cdot 10^{-218}:\\
            \;\;\;\;\left(1 - \left(x \cdot \frac{1 - eps\_m \cdot eps\_m}{1 - eps\_m} - 1\right)\right) \cdot 0.5\\
            
            \mathbf{elif}\;x \leq 360:\\
            \;\;\;\;1\\
            
            \mathbf{elif}\;x \leq 2.4 \cdot 10^{+206}:\\
            \;\;\;\;\frac{t\_2 \cdot 1 - t\_1}{2}\\
            
            \mathbf{else}:\\
            \;\;\;\;\mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, x \cdot x, 1\right)\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 5 regimes
            2. if x < -5.2e8

              1. Initial program 100.0%

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

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

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

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

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

                    \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \left(1 + x \cdot \color{blue}{\left(\varepsilon - 1\right)}\right) - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2} \]
                  3. lower--.f6431.6

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \frac{1 - \left(\left(\varepsilon - 1\right) \cdot x\right) \cdot \left(\left(\varepsilon - 1\right) \cdot x\right)}{1 - \left(\mathsf{neg}\left(x\right)\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2} \]
                  2. lower-neg.f6484.6

                    \[\leadsto \frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \frac{1 - \left(\left(\varepsilon - 1\right) \cdot x\right) \cdot \left(\left(\varepsilon - 1\right) \cdot x\right)}{1 - \left(-x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2} \]
                9. Applied rewrites84.6%

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

                if -5.2e8 < x < -2.0000000000000001e-218

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

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

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

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

                    \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
                8. Applied rewrites80.2%

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

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

                    \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
                  2. Step-by-step derivation
                    1. flip-+N/A

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

                      \[\leadsto \left(1 - \left(x \cdot \frac{1 \cdot 1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
                    3. metadata-evalN/A

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

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

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

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

                      \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
                    8. lower--.f6472.3

                      \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5 \]
                  3. Applied rewrites72.3%

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

                  if -2.0000000000000001e-218 < x < 360

                  1. Initial program 50.4%

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

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

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

                    if 360 < x < 2.4e206

                    1. Initial program 100.0%

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

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

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

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

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

                        if 2.4e206 < x

                        1. Initial program 100.0%

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

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

                            \[\leadsto \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 rewrites40.1%

                          \[\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} \]
                        6. Taylor expanded in x around 0

                          \[\leadsto 1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}} \]
                        7. Step-by-step derivation
                          1. lower-+.f64N/A

                            \[\leadsto 1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}} \]
                          2. lower-*.f64N/A

                            \[\leadsto 1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}} \]
                          3. unpow2N/A

                            \[\leadsto 1 + \frac{-1}{2} \cdot \left(x \cdot x\right) \]
                          4. lower-*.f640.6

                            \[\leadsto 1 + -0.5 \cdot \left(x \cdot x\right) \]
                        8. Applied rewrites0.6%

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, \color{blue}{x \cdot x}, 1\right) \]
                      4. Recombined 5 regimes into one program.
                      5. Final simplification74.4%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -520000000:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot \frac{1 - \left(\left(\varepsilon - 1\right) \cdot x\right) \cdot \left(\left(\varepsilon - 1\right) \cdot x\right)}{1 - \left(-x\right)} - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2}\\ \mathbf{elif}\;x \leq -2 \cdot 10^{-218}:\\ \;\;\;\;\left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 360:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+206}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, x \cdot x, 1\right)\\ \end{array} \]
                      6. Add Preprocessing

                      Alternative 11: 69.5% accurate, 3.8× speedup?

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

                        1. Initial program 69.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 rewrites97.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)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
                        7. Step-by-step derivation
                          1. lower--.f64N/A

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

                            \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
                          3. lower-+.f6466.8

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

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

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

                            \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
                          2. Step-by-step derivation
                            1. flip-+N/A

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

                              \[\leadsto \left(1 - \left(x \cdot \frac{1 \cdot 1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
                            3. metadata-evalN/A

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

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

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

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

                              \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
                            8. lower--.f6454.0

                              \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5 \]
                          3. Applied rewrites54.0%

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

                          if -2.0000000000000001e-218 < x < 360

                          1. Initial program 50.4%

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

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

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

                            if 360 < x < 2.4e206

                            1. Initial program 100.0%

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

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

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

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

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

                                if 2.4e206 < x

                                1. Initial program 100.0%

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

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

                                    \[\leadsto \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 rewrites40.1%

                                  \[\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} \]
                                6. Taylor expanded in x around 0

                                  \[\leadsto 1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}} \]
                                7. Step-by-step derivation
                                  1. lower-+.f64N/A

                                    \[\leadsto 1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}} \]
                                  2. lower-*.f64N/A

                                    \[\leadsto 1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}} \]
                                  3. unpow2N/A

                                    \[\leadsto 1 + \frac{-1}{2} \cdot \left(x \cdot x\right) \]
                                  4. lower-*.f640.6

                                    \[\leadsto 1 + -0.5 \cdot \left(x \cdot x\right) \]
                                8. Applied rewrites0.6%

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, \color{blue}{x \cdot x}, 1\right) \]
                              4. Recombined 4 regimes into one program.
                              5. Final simplification65.1%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2 \cdot 10^{-218}:\\ \;\;\;\;\left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5\\ \mathbf{elif}\;x \leq 360:\\ \;\;\;\;1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{+206}:\\ \;\;\;\;\frac{\left(1 + \frac{1}{\varepsilon}\right) \cdot 1 - \left(\frac{1}{\varepsilon} - 1\right) \cdot 1}{2}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, x \cdot x, 1\right)\\ \end{array} \]
                              6. Add Preprocessing

                              Alternative 12: 66.0% accurate, 6.1× speedup?

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

                                1. Initial program 69.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 rewrites97.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)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
                                7. Step-by-step derivation
                                  1. lower--.f64N/A

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

                                    \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
                                  3. lower-+.f6466.8

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

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

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

                                    \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
                                  2. Step-by-step derivation
                                    1. flip-+N/A

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

                                      \[\leadsto \left(1 - \left(x \cdot \frac{1 \cdot 1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
                                    3. metadata-evalN/A

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

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

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

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

                                      \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot \frac{1}{2} \]
                                    8. lower--.f6454.0

                                      \[\leadsto \left(1 - \left(x \cdot \frac{1 - \varepsilon \cdot \varepsilon}{1 - \varepsilon} - 1\right)\right) \cdot 0.5 \]
                                  3. Applied rewrites54.0%

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

                                  if -2.0000000000000001e-218 < x

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

                                    \[\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} \]
                                  6. Taylor expanded in x around 0

                                    \[\leadsto 1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}} \]
                                  7. Step-by-step derivation
                                    1. lower-+.f64N/A

                                      \[\leadsto 1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}} \]
                                    2. lower-*.f64N/A

                                      \[\leadsto 1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}} \]
                                    3. unpow2N/A

                                      \[\leadsto 1 + \frac{-1}{2} \cdot \left(x \cdot x\right) \]
                                    4. lower-*.f6443.8

                                      \[\leadsto 1 + -0.5 \cdot \left(x \cdot x\right) \]
                                  8. Applied rewrites43.8%

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, \color{blue}{x \cdot x}, 1\right) \]
                                11. Recombined 2 regimes into one program.
                                12. Final simplification56.0%

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

                                Alternative 13: 60.0% accurate, 10.5× speedup?

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

                                  1. Initial program 73.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 rewrites96.6%

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

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

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

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

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

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

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

                                      \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
                                    2. Taylor expanded in eps around inf

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

                                        \[\leadsto \left(1 - \left(x \cdot \varepsilon - 1\right)\right) \cdot 0.5 \]

                                      if -1.2e-179 < x

                                      1. Initial program 70.5%

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

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

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

                                        \[\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} \]
                                      6. Taylor expanded in x around 0

                                        \[\leadsto 1 + \color{blue}{\frac{-1}{2} \cdot {x}^{2}} \]
                                      7. Step-by-step derivation
                                        1. lower-+.f64N/A

                                          \[\leadsto 1 + \frac{-1}{2} \cdot \color{blue}{{x}^{2}} \]
                                        2. lower-*.f64N/A

                                          \[\leadsto 1 + \frac{-1}{2} \cdot {x}^{\color{blue}{2}} \]
                                        3. unpow2N/A

                                          \[\leadsto 1 + \frac{-1}{2} \cdot \left(x \cdot x\right) \]
                                        4. lower-*.f6447.5

                                          \[\leadsto 1 + -0.5 \cdot \left(x \cdot x\right) \]
                                      8. Applied rewrites47.5%

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \mathsf{fma}\left(0.3333333333333333 \cdot x - 0.5, \color{blue}{x \cdot x}, 1\right) \]
                                    4. Recombined 2 regimes into one program.
                                    5. Final simplification53.8%

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

                                    Alternative 14: 50.5% accurate, 13.6× speedup?

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

                                      1. Initial program 97.5%

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

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

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

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

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

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

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

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

                                          \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
                                      8. Applied rewrites41.6%

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

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

                                          \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
                                        2. Taylor expanded in eps around inf

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

                                            \[\leadsto \left(1 - x \cdot \varepsilon\right) \cdot \frac{1}{2} \]
                                          2. lower-*.f6416.6

                                            \[\leadsto \left(1 - x \cdot \varepsilon\right) \cdot 0.5 \]
                                        4. Applied rewrites16.6%

                                          \[\leadsto \left(1 - x \cdot \varepsilon\right) \cdot 0.5 \]

                                        if -0.47999999999999998 < x

                                        1. Initial program 66.8%

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

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

                                            \[\leadsto \color{blue}{1} \]
                                        5. Recombined 2 regimes into one program.
                                        6. Final simplification46.5%

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

                                        Alternative 15: 49.6% accurate, 16.1× speedup?

                                        \[\begin{array}{l} eps_m = \left|\varepsilon\right| \\ \left(1 - \left(x \cdot eps\_m - 1\right)\right) \cdot 0.5 \end{array} \]
                                        eps_m = (fabs.f64 eps)
                                        (FPCore (x eps_m) :precision binary64 (* (- 1.0 (- (* x eps_m) 1.0)) 0.5))
                                        eps_m = fabs(eps);
                                        double code(double x, double eps_m) {
                                        	return (1.0 - ((x * eps_m) - 1.0)) * 0.5;
                                        }
                                        
                                        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 - ((x * eps_m) - 1.0d0)) * 0.5d0
                                        end function
                                        
                                        eps_m = Math.abs(eps);
                                        public static double code(double x, double eps_m) {
                                        	return (1.0 - ((x * eps_m) - 1.0)) * 0.5;
                                        }
                                        
                                        eps_m = math.fabs(eps)
                                        def code(x, eps_m):
                                        	return (1.0 - ((x * eps_m) - 1.0)) * 0.5
                                        
                                        eps_m = abs(eps)
                                        function code(x, eps_m)
                                        	return Float64(Float64(1.0 - Float64(Float64(x * eps_m) - 1.0)) * 0.5)
                                        end
                                        
                                        eps_m = abs(eps);
                                        function tmp = code(x, eps_m)
                                        	tmp = (1.0 - ((x * eps_m) - 1.0)) * 0.5;
                                        end
                                        
                                        eps_m = N[Abs[eps], $MachinePrecision]
                                        code[x_, eps$95$m_] := N[(N[(1.0 - N[(N[(x * eps$95$m), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision]
                                        
                                        \begin{array}{l}
                                        eps_m = \left|\varepsilon\right|
                                        
                                        \\
                                        \left(1 - \left(x \cdot eps\_m - 1\right)\right) \cdot 0.5
                                        \end{array}
                                        
                                        Derivation
                                        1. Initial program 71.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.3%

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

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

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

                                            \[\leadsto \left(e^{\left(-x\right) \cdot \left(1 - \varepsilon\right)} - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot \frac{1}{2} \]
                                          3. lower-+.f6461.8

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

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

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

                                            \[\leadsto \left(1 - \left(x \cdot \left(1 + \varepsilon\right) - 1\right)\right) \cdot 0.5 \]
                                          2. Taylor expanded in eps around inf

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

                                              \[\leadsto \left(1 - \left(x \cdot \varepsilon - 1\right)\right) \cdot 0.5 \]
                                            2. Final simplification48.1%

                                              \[\leadsto \left(1 - \left(x \cdot \varepsilon - 1\right)\right) \cdot 0.5 \]
                                            3. Add Preprocessing

                                            Alternative 16: 43.2% 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 71.6%

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

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

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

                                              Reproduce

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