exp-w (used to crash)

Percentage Accurate: 99.4% → 99.4%
Time: 18.0s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \end{array} \]
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
	return exp(-w) * pow(l, exp(w));
}
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(w, l)
use fmin_fmax_functions
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
	return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l):
	return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l)
	return Float64(exp(Float64(-w)) * (l ^ exp(w)))
end
function tmp = code(w, l)
	tmp = exp(-w) * (l ^ exp(w));
end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\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 13 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: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \end{array} \]
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
	return exp(-w) * pow(l, exp(w));
}
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(w, l)
use fmin_fmax_functions
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
	return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l):
	return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l)
	return Float64(exp(Float64(-w)) * (l ^ exp(w)))
end
function tmp = code(w, l)
	tmp = exp(-w) * (l ^ exp(w));
end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}

Alternative 1: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \end{array} \]
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
	return exp(-w) * pow(l, exp(w));
}
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(w, l)
use fmin_fmax_functions
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
	return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l):
	return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l)
	return Float64(exp(Float64(-w)) * (l ^ exp(w)))
end
function tmp = code(w, l)
	tmp = exp(-w) * (l ^ exp(w));
end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
Derivation
  1. Initial program 99.6%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Add Preprocessing
  3. Add Preprocessing

Alternative 2: 99.2% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -7.5 \cdot 10^{-6}:\\ \;\;\;\;e^{\log \ell \cdot e^{w} - w}\\ \mathbf{else}:\\ \;\;\;\;e^{-w} \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\ \end{array} \end{array} \]
(FPCore (w l)
 :precision binary64
 (if (<= w -7.5e-6)
   (exp (- (* (log l) (exp w)) w))
   (* (exp (- w)) (pow l (fma (fma 0.5 w 1.0) w 1.0)))))
double code(double w, double l) {
	double tmp;
	if (w <= -7.5e-6) {
		tmp = exp(((log(l) * exp(w)) - w));
	} else {
		tmp = exp(-w) * pow(l, fma(fma(0.5, w, 1.0), w, 1.0));
	}
	return tmp;
}
function code(w, l)
	tmp = 0.0
	if (w <= -7.5e-6)
		tmp = exp(Float64(Float64(log(l) * exp(w)) - w));
	else
		tmp = Float64(exp(Float64(-w)) * (l ^ fma(fma(0.5, w, 1.0), w, 1.0)));
	end
	return tmp
end
code[w_, l_] := If[LessEqual[w, -7.5e-6], N[Exp[N[(N[(N[Log[l], $MachinePrecision] * N[Exp[w], $MachinePrecision]), $MachinePrecision] - w), $MachinePrecision]], $MachinePrecision], N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[(N[(0.5 * w + 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;w \leq -7.5 \cdot 10^{-6}:\\
\;\;\;\;e^{\log \ell \cdot e^{w} - w}\\

\mathbf{else}:\\
\;\;\;\;e^{-w} \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if w < -7.50000000000000019e-6

    1. Initial program 99.8%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
      2. lift-exp.f64N/A

        \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      3. lift-neg.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
      4. exp-negN/A

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      5. lift-exp.f64N/A

        \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      6. associate-*l/N/A

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

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)} \cdot 1}}{e^{w}} \]
      8. lift-exp.f64N/A

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)} \cdot 1}{\color{blue}{e^{w}}} \]
      9. remove-double-negN/A

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)} \cdot 1}{e^{\color{blue}{\mathsf{neg}\left(\left(\mathsf{neg}\left(w\right)\right)\right)}}} \]
      10. lift-neg.f64N/A

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)} \cdot 1}{e^{\mathsf{neg}\left(\color{blue}{\left(-w\right)}\right)}} \]
      11. *-rgt-identityN/A

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{\mathsf{neg}\left(\left(-w\right)\right)}} \]
      12. lift-pow.f64N/A

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{\mathsf{neg}\left(\left(-w\right)\right)}} \]
      13. pow-to-expN/A

        \[\leadsto \frac{\color{blue}{e^{\log \ell \cdot e^{w}}}}{e^{\mathsf{neg}\left(\left(-w\right)\right)}} \]
      14. lift-neg.f64N/A

        \[\leadsto \frac{e^{\log \ell \cdot e^{w}}}{e^{\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(w\right)\right)}\right)}} \]
      15. remove-double-negN/A

        \[\leadsto \frac{e^{\log \ell \cdot e^{w}}}{e^{\color{blue}{w}}} \]
      16. div-expN/A

        \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
      17. lower-exp.f64N/A

        \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
      18. lower--.f64N/A

        \[\leadsto e^{\color{blue}{\log \ell \cdot e^{w} - w}} \]
      19. lower-*.f64N/A

        \[\leadsto e^{\color{blue}{\log \ell \cdot e^{w}} - w} \]
      20. lower-log.f6499.7

        \[\leadsto e^{\color{blue}{\log \ell} \cdot e^{w} - w} \]
    4. Applied rewrites99.7%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]

    if -7.50000000000000019e-6 < w

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0

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

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

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

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

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

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

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

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w + 1}, w, 1\right)\right)} \]
      9. lower-fma.f6499.2

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.5, w, 1\right)}, w, 1\right)\right)} \]
    5. Applied rewrites99.2%

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

Alternative 3: 98.7% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{-w}\\ \mathbf{if}\;w \leq -2:\\ \;\;\;\;\frac{-t\_0}{\frac{-1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\ \end{array} \end{array} \]
(FPCore (w l)
 :precision binary64
 (let* ((t_0 (exp (- w))))
   (if (<= w -2.0)
     (/ (- t_0) (/ -1.0 l))
     (* t_0 (pow l (fma (fma 0.5 w 1.0) w 1.0))))))
double code(double w, double l) {
	double t_0 = exp(-w);
	double tmp;
	if (w <= -2.0) {
		tmp = -t_0 / (-1.0 / l);
	} else {
		tmp = t_0 * pow(l, fma(fma(0.5, w, 1.0), w, 1.0));
	}
	return tmp;
}
function code(w, l)
	t_0 = exp(Float64(-w))
	tmp = 0.0
	if (w <= -2.0)
		tmp = Float64(Float64(-t_0) / Float64(-1.0 / l));
	else
		tmp = Float64(t_0 * (l ^ fma(fma(0.5, w, 1.0), w, 1.0)));
	end
	return tmp
end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[w, -2.0], N[((-t$95$0) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision], N[(t$95$0 * N[Power[l, N[(N[(0.5 * w + 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{-w}\\
\mathbf{if}\;w \leq -2:\\
\;\;\;\;\frac{-t\_0}{\frac{-1}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\


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

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-exp.f64N/A

        \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. lift-neg.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
      3. exp-negN/A

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      4. lift-exp.f64N/A

        \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      5. inv-powN/A

        \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
      6. sqr-powN/A

        \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
      7. pow2N/A

        \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
      8. lower-pow.f64N/A

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

        \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
      10. metadata-eval100.0

        \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. lift-pow.f64N/A

        \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
      3. pow-powN/A

        \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
      4. metadata-evalN/A

        \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
      5. inv-powN/A

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      6. lift-exp.f64N/A

        \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      7. exp-negN/A

        \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
      8. lift-neg.f64N/A

        \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      9. lift-exp.f64100.0

        \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
      11. /-rgt-identityN/A

        \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
      12. associate-/r/N/A

        \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
      14. frac-2neg-revN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
      15. distribute-frac-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
      16. lower-neg.f64N/A

        \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
      17. lower-/.f64N/A

        \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
      18. lift-/.f64N/A

        \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
      19. distribute-neg-fracN/A

        \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
      20. metadata-evalN/A

        \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
      21. lower-/.f64100.0

        \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
    6. Applied rewrites100.0%

      \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
    7. Taylor expanded in w around 0

      \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
    8. Step-by-step derivation
      1. lower-/.f6498.5

        \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
    9. Applied rewrites98.5%

      \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]

    if -2 < w

    1. Initial program 99.4%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0

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

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

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

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

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

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

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

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w + 1}, w, 1\right)\right)} \]
      9. lower-fma.f6498.5

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.5, w, 1\right)}, w, 1\right)\right)} \]
    5. Applied rewrites98.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.5%

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

Alternative 4: 98.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -310:\\ \;\;\;\;\frac{-e^{-w}}{\frac{-1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 - w\right) \cdot {\ell}^{\left(e^{w}\right)}\\ \end{array} \end{array} \]
(FPCore (w l)
 :precision binary64
 (if (<= w -310.0)
   (/ (- (exp (- w))) (/ -1.0 l))
   (* (- 1.0 w) (pow l (exp w)))))
double code(double w, double l) {
	double tmp;
	if (w <= -310.0) {
		tmp = -exp(-w) / (-1.0 / l);
	} else {
		tmp = (1.0 - w) * pow(l, exp(w));
	}
	return tmp;
}
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(w, l)
use fmin_fmax_functions
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    real(8) :: tmp
    if (w <= (-310.0d0)) then
        tmp = -exp(-w) / ((-1.0d0) / l)
    else
        tmp = (1.0d0 - w) * (l ** exp(w))
    end if
    code = tmp
end function
public static double code(double w, double l) {
	double tmp;
	if (w <= -310.0) {
		tmp = -Math.exp(-w) / (-1.0 / l);
	} else {
		tmp = (1.0 - w) * Math.pow(l, Math.exp(w));
	}
	return tmp;
}
def code(w, l):
	tmp = 0
	if w <= -310.0:
		tmp = -math.exp(-w) / (-1.0 / l)
	else:
		tmp = (1.0 - w) * math.pow(l, math.exp(w))
	return tmp
function code(w, l)
	tmp = 0.0
	if (w <= -310.0)
		tmp = Float64(Float64(-exp(Float64(-w))) / Float64(-1.0 / l));
	else
		tmp = Float64(Float64(1.0 - w) * (l ^ exp(w)));
	end
	return tmp
end
function tmp_2 = code(w, l)
	tmp = 0.0;
	if (w <= -310.0)
		tmp = -exp(-w) / (-1.0 / l);
	else
		tmp = (1.0 - w) * (l ^ exp(w));
	end
	tmp_2 = tmp;
end
code[w_, l_] := If[LessEqual[w, -310.0], N[((-N[Exp[(-w)], $MachinePrecision]) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - w), $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;w \leq -310:\\
\;\;\;\;\frac{-e^{-w}}{\frac{-1}{\ell}}\\

\mathbf{else}:\\
\;\;\;\;\left(1 - w\right) \cdot {\ell}^{\left(e^{w}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if w < -310

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-exp.f64N/A

        \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. lift-neg.f64N/A

        \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
      3. exp-negN/A

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      4. lift-exp.f64N/A

        \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      5. inv-powN/A

        \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
      6. sqr-powN/A

        \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
      7. pow2N/A

        \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
      8. lower-pow.f64N/A

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

        \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
      10. metadata-eval100.0

        \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
    5. Step-by-step derivation
      1. lift-pow.f64N/A

        \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. lift-pow.f64N/A

        \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
      3. pow-powN/A

        \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
      4. metadata-evalN/A

        \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
      5. inv-powN/A

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      6. lift-exp.f64N/A

        \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      7. exp-negN/A

        \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
      8. lift-neg.f64N/A

        \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      9. lift-exp.f64100.0

        \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      10. lower-*.f64N/A

        \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
      11. /-rgt-identityN/A

        \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
      12. associate-/r/N/A

        \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
      13. lift-/.f64N/A

        \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
      14. frac-2neg-revN/A

        \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
      15. distribute-frac-negN/A

        \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
      16. lower-neg.f64N/A

        \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
      17. lower-/.f64N/A

        \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
      18. lift-/.f64N/A

        \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
      19. distribute-neg-fracN/A

        \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
      20. metadata-evalN/A

        \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
      21. lower-/.f64100.0

        \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
    6. Applied rewrites100.0%

      \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
    7. Taylor expanded in w around 0

      \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
    8. Step-by-step derivation
      1. lower-/.f64100.0

        \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
    9. Applied rewrites100.0%

      \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]

    if -310 < w

    1. Initial program 99.4%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0

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

        \[\leadsto \left(1 + \color{blue}{w \cdot -1}\right) \cdot {\ell}^{\left(e^{w}\right)} \]
      2. fp-cancel-sign-sub-invN/A

        \[\leadsto \color{blue}{\left(1 - \left(\mathsf{neg}\left(w\right)\right) \cdot -1\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
      3. distribute-lft-neg-inN/A

        \[\leadsto \left(1 - \color{blue}{\left(\mathsf{neg}\left(w \cdot -1\right)\right)}\right) \cdot {\ell}^{\left(e^{w}\right)} \]
      4. distribute-rgt-neg-inN/A

        \[\leadsto \left(1 - \color{blue}{w \cdot \left(\mathsf{neg}\left(-1\right)\right)}\right) \cdot {\ell}^{\left(e^{w}\right)} \]
      5. metadata-evalN/A

        \[\leadsto \left(1 - w \cdot \color{blue}{1}\right) \cdot {\ell}^{\left(e^{w}\right)} \]
      6. *-rgt-identityN/A

        \[\leadsto \left(1 - \color{blue}{w}\right) \cdot {\ell}^{\left(e^{w}\right)} \]
      7. lower--.f6497.9

        \[\leadsto \color{blue}{\left(1 - w\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
    5. Applied rewrites97.9%

      \[\leadsto \color{blue}{\left(1 - w\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -310:\\ \;\;\;\;\frac{-e^{-w}}{\frac{-1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\left(1 - w\right) \cdot {\ell}^{\left(e^{w}\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 99.0% accurate, 2.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 0.36:\\ \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, w, 0.5\right), w, 1\right), w, 1\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\ \end{array} \end{array} \]
(FPCore (w l)
 :precision binary64
 (if (<= l 0.36)
   (*
    (fma -1.0 w 1.0)
    (pow l (fma (fma (fma 0.16666666666666666 w 0.5) w 1.0) w 1.0)))
   (* (fma (- (* 0.5 w) 1.0) w 1.0) (pow l (fma (fma 0.5 w 1.0) w 1.0)))))
double code(double w, double l) {
	double tmp;
	if (l <= 0.36) {
		tmp = fma(-1.0, w, 1.0) * pow(l, fma(fma(fma(0.16666666666666666, w, 0.5), w, 1.0), w, 1.0));
	} else {
		tmp = fma(((0.5 * w) - 1.0), w, 1.0) * pow(l, fma(fma(0.5, w, 1.0), w, 1.0));
	}
	return tmp;
}
function code(w, l)
	tmp = 0.0
	if (l <= 0.36)
		tmp = Float64(fma(-1.0, w, 1.0) * (l ^ fma(fma(fma(0.16666666666666666, w, 0.5), w, 1.0), w, 1.0)));
	else
		tmp = Float64(fma(Float64(Float64(0.5 * w) - 1.0), w, 1.0) * (l ^ fma(fma(0.5, w, 1.0), w, 1.0)));
	end
	return tmp
end
code[w_, l_] := If[LessEqual[l, 0.36], N[(N[(-1.0 * w + 1.0), $MachinePrecision] * N[Power[l, N[(N[(N[(0.16666666666666666 * w + 0.5), $MachinePrecision] * w + 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(0.5 * w), $MachinePrecision] - 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision] * N[Power[l, N[(N[(0.5 * w + 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.36:\\
\;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, w, 0.5\right), w, 1\right), w, 1\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\


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

    1. Initial program 99.6%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Taylor expanded in w around 0

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w - 1}, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
      5. lower-*.f6475.2

        \[\leadsto \mathsf{fma}\left(\color{blue}{0.5 \cdot w} - 1, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
    5. Applied rewrites75.2%

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot w + \frac{1}{2}}, w, 1\right), w, 1\right)\right)} \]
      8. lower-fma.f6487.2

        \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, w, 0.5\right)}, w, 1\right), w, 1\right)\right)} \]
    8. Applied rewrites87.2%

      \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, w, 0.5\right), w, 1\right), w, 1\right)\right)}} \]
    9. Taylor expanded in w around 0

      \[\leadsto \mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, w, \frac{1}{2}\right), w, 1\right), w, 1\right)\right)} \]
    10. Step-by-step derivation
      1. Applied rewrites98.0%

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

      if 0.35999999999999999 < l

      1. Initial program 99.6%

        \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in w around 0

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w - 1}, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
        5. lower-*.f6486.6

          \[\leadsto \mathsf{fma}\left(\color{blue}{0.5 \cdot w} - 1, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
      5. Applied rewrites86.6%

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

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

          \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(w \cdot \left(1 + \frac{1}{2} \cdot w\right) + 1\right)}} \]
        2. distribute-lft-inN/A

          \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\color{blue}{\left(w \cdot 1 + w \cdot \left(\frac{1}{2} \cdot w\right)\right)} + 1\right)} \]
        3. *-rgt-identityN/A

          \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\left(\color{blue}{w} + w \cdot \left(\frac{1}{2} \cdot w\right)\right) + 1\right)} \]
        4. associate-+l+N/A

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

          \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(w + \left(\color{blue}{\left(\frac{1}{2} \cdot w\right) \cdot w} + 1\right)\right)} \]
        6. associate-+l+N/A

          \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(\left(w + \left(\frac{1}{2} \cdot w\right) \cdot w\right) + 1\right)}} \]
        7. distribute-rgt1-inN/A

          \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\color{blue}{\left(\frac{1}{2} \cdot w + 1\right) \cdot w} + 1\right)} \]
        8. +-commutativeN/A

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

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

          \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w + 1}, w, 1\right)\right)} \]
        11. lower-fma.f6498.8

          \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.5, w, 1\right)}, w, 1\right)\right)} \]
      8. Applied rewrites98.8%

        \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}} \]
    11. Recombined 2 regimes into one program.
    12. Add Preprocessing

    Alternative 6: 98.5% accurate, 2.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -2.4:\\ \;\;\;\;\frac{-e^{-w}}{\frac{-1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, w, 0.5\right), w, 1\right), w, 1\right)\right)}\\ \end{array} \end{array} \]
    (FPCore (w l)
     :precision binary64
     (if (<= w -2.4)
       (/ (- (exp (- w))) (/ -1.0 l))
       (*
        (fma -1.0 w 1.0)
        (pow l (fma (fma (fma 0.16666666666666666 w 0.5) w 1.0) w 1.0)))))
    double code(double w, double l) {
    	double tmp;
    	if (w <= -2.4) {
    		tmp = -exp(-w) / (-1.0 / l);
    	} else {
    		tmp = fma(-1.0, w, 1.0) * pow(l, fma(fma(fma(0.16666666666666666, w, 0.5), w, 1.0), w, 1.0));
    	}
    	return tmp;
    }
    
    function code(w, l)
    	tmp = 0.0
    	if (w <= -2.4)
    		tmp = Float64(Float64(-exp(Float64(-w))) / Float64(-1.0 / l));
    	else
    		tmp = Float64(fma(-1.0, w, 1.0) * (l ^ fma(fma(fma(0.16666666666666666, w, 0.5), w, 1.0), w, 1.0)));
    	end
    	return tmp
    end
    
    code[w_, l_] := If[LessEqual[w, -2.4], N[((-N[Exp[(-w)], $MachinePrecision]) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * w + 1.0), $MachinePrecision] * N[Power[l, N[(N[(N[(0.16666666666666666 * w + 0.5), $MachinePrecision] * w + 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;w \leq -2.4:\\
    \;\;\;\;\frac{-e^{-w}}{\frac{-1}{\ell}}\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, w, 0.5\right), w, 1\right), w, 1\right)\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if w < -2.39999999999999991

      1. Initial program 100.0%

        \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-exp.f64N/A

          \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
        2. lift-neg.f64N/A

          \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
        3. exp-negN/A

          \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
        4. lift-exp.f64N/A

          \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
        5. inv-powN/A

          \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
        6. sqr-powN/A

          \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
        7. pow2N/A

          \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
        8. lower-pow.f64N/A

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

          \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
        10. metadata-eval100.0

          \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
      4. Applied rewrites100.0%

        \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
      5. Step-by-step derivation
        1. lift-pow.f64N/A

          \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
        2. lift-pow.f64N/A

          \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
        3. pow-powN/A

          \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
        4. metadata-evalN/A

          \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
        5. inv-powN/A

          \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
        6. lift-exp.f64N/A

          \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
        7. exp-negN/A

          \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
        8. lift-neg.f64N/A

          \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
        9. lift-exp.f64100.0

          \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
        10. lower-*.f64N/A

          \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
        11. /-rgt-identityN/A

          \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
        12. associate-/r/N/A

          \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
        13. lift-/.f64N/A

          \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
        14. frac-2neg-revN/A

          \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
        15. distribute-frac-negN/A

          \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
        16. lower-neg.f64N/A

          \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
        17. lower-/.f64N/A

          \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
        18. lift-/.f64N/A

          \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
        19. distribute-neg-fracN/A

          \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
        20. metadata-evalN/A

          \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
        21. lower-/.f64100.0

          \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
      6. Applied rewrites100.0%

        \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
      7. Taylor expanded in w around 0

        \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
      8. Step-by-step derivation
        1. lower-/.f6498.5

          \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
      9. Applied rewrites98.5%

        \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]

      if -2.39999999999999991 < w

      1. Initial program 99.4%

        \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. Add Preprocessing
      3. Taylor expanded in w around 0

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w - 1}, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
        5. lower-*.f6490.9

          \[\leadsto \mathsf{fma}\left(\color{blue}{0.5 \cdot w} - 1, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
      5. Applied rewrites90.9%

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\frac{1}{6} \cdot w + \frac{1}{2}}, w, 1\right), w, 1\right)\right)} \]
        8. lower-fma.f6490.9

          \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.16666666666666666, w, 0.5\right)}, w, 1\right), w, 1\right)\right)} \]
      8. Applied rewrites90.9%

        \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, w, 0.5\right), w, 1\right), w, 1\right)\right)}} \]
      9. Taylor expanded in w around 0

        \[\leadsto \mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{6}, w, \frac{1}{2}\right), w, 1\right), w, 1\right)\right)} \]
      10. Step-by-step derivation
        1. Applied rewrites98.3%

          \[\leadsto \mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, w, 0.5\right), w, 1\right), w, 1\right)\right)} \]
      11. Recombined 2 regimes into one program.
      12. Final simplification98.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -2.4:\\ \;\;\;\;\frac{-e^{-w}}{\frac{-1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.16666666666666666, w, 0.5\right), w, 1\right), w, 1\right)\right)}\\ \end{array} \]
      13. Add Preprocessing

      Alternative 7: 98.5% accurate, 2.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -2:\\ \;\;\;\;\frac{-e^{-w}}{\frac{-1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\ \end{array} \end{array} \]
      (FPCore (w l)
       :precision binary64
       (if (<= w -2.0)
         (/ (- (exp (- w))) (/ -1.0 l))
         (* (fma -1.0 w 1.0) (pow l (fma (fma 0.5 w 1.0) w 1.0)))))
      double code(double w, double l) {
      	double tmp;
      	if (w <= -2.0) {
      		tmp = -exp(-w) / (-1.0 / l);
      	} else {
      		tmp = fma(-1.0, w, 1.0) * pow(l, fma(fma(0.5, w, 1.0), w, 1.0));
      	}
      	return tmp;
      }
      
      function code(w, l)
      	tmp = 0.0
      	if (w <= -2.0)
      		tmp = Float64(Float64(-exp(Float64(-w))) / Float64(-1.0 / l));
      	else
      		tmp = Float64(fma(-1.0, w, 1.0) * (l ^ fma(fma(0.5, w, 1.0), w, 1.0)));
      	end
      	return tmp
      end
      
      code[w_, l_] := If[LessEqual[w, -2.0], N[((-N[Exp[(-w)], $MachinePrecision]) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * w + 1.0), $MachinePrecision] * N[Power[l, N[(N[(0.5 * w + 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;w \leq -2:\\
      \;\;\;\;\frac{-e^{-w}}{\frac{-1}{\ell}}\\
      
      \mathbf{else}:\\
      \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if w < -2

        1. Initial program 100.0%

          \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-exp.f64N/A

            \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
          2. lift-neg.f64N/A

            \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
          3. exp-negN/A

            \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
          4. lift-exp.f64N/A

            \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
          5. inv-powN/A

            \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
          6. sqr-powN/A

            \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
          7. pow2N/A

            \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
          8. lower-pow.f64N/A

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

            \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
          10. metadata-eval100.0

            \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
        4. Applied rewrites100.0%

          \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
        5. Step-by-step derivation
          1. lift-pow.f64N/A

            \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
          2. lift-pow.f64N/A

            \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
          3. pow-powN/A

            \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
          4. metadata-evalN/A

            \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
          5. inv-powN/A

            \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
          6. lift-exp.f64N/A

            \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
          7. exp-negN/A

            \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
          8. lift-neg.f64N/A

            \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
          9. lift-exp.f64100.0

            \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
          10. lower-*.f64N/A

            \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
          11. /-rgt-identityN/A

            \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
          12. associate-/r/N/A

            \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
          13. lift-/.f64N/A

            \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
          14. frac-2neg-revN/A

            \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
          15. distribute-frac-negN/A

            \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
          16. lower-neg.f64N/A

            \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
          17. lower-/.f64N/A

            \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
          18. lift-/.f64N/A

            \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
          19. distribute-neg-fracN/A

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
          20. metadata-evalN/A

            \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
          21. lower-/.f64100.0

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
        6. Applied rewrites100.0%

          \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
        7. Taylor expanded in w around 0

          \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
        8. Step-by-step derivation
          1. lower-/.f6498.5

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
        9. Applied rewrites98.5%

          \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]

        if -2 < w

        1. Initial program 99.4%

          \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
        2. Add Preprocessing
        3. Taylor expanded in w around 0

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

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

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

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

            \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w - 1}, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
          5. lower-*.f6490.9

            \[\leadsto \mathsf{fma}\left(\color{blue}{0.5 \cdot w} - 1, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
        5. Applied rewrites90.9%

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

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

            \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(w \cdot \left(1 + \frac{1}{2} \cdot w\right) + 1\right)}} \]
          2. distribute-lft-inN/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\color{blue}{\left(w \cdot 1 + w \cdot \left(\frac{1}{2} \cdot w\right)\right)} + 1\right)} \]
          3. *-rgt-identityN/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\left(\color{blue}{w} + w \cdot \left(\frac{1}{2} \cdot w\right)\right) + 1\right)} \]
          4. associate-+l+N/A

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

            \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(w + \left(\color{blue}{\left(\frac{1}{2} \cdot w\right) \cdot w} + 1\right)\right)} \]
          6. associate-+l+N/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(\left(w + \left(\frac{1}{2} \cdot w\right) \cdot w\right) + 1\right)}} \]
          7. distribute-rgt1-inN/A

            \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\color{blue}{\left(\frac{1}{2} \cdot w + 1\right) \cdot w} + 1\right)} \]
          8. +-commutativeN/A

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

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

            \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w + 1}, w, 1\right)\right)} \]
          11. lower-fma.f6490.6

            \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.5, w, 1\right)}, w, 1\right)\right)} \]
        8. Applied rewrites90.6%

          \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}} \]
        9. Taylor expanded in w around 0

          \[\leadsto \mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{2}, w, 1\right), w, 1\right)\right)} \]
        10. Step-by-step derivation
          1. Applied rewrites98.3%

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

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

        Alternative 8: 93.9% accurate, 2.4× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -1.55 \cdot 10^{+99}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\ \end{array} \end{array} \]
        (FPCore (w l)
         :precision binary64
         (if (<= w -1.55e+99)
           (/
            (- (fma (- (* (fma -0.16666666666666666 w 0.5) w) 1.0) w 1.0))
            (/ -1.0 l))
           (* (fma -1.0 w 1.0) (pow l (fma (fma 0.5 w 1.0) w 1.0)))))
        double code(double w, double l) {
        	double tmp;
        	if (w <= -1.55e+99) {
        		tmp = -fma(((fma(-0.16666666666666666, w, 0.5) * w) - 1.0), w, 1.0) / (-1.0 / l);
        	} else {
        		tmp = fma(-1.0, w, 1.0) * pow(l, fma(fma(0.5, w, 1.0), w, 1.0));
        	}
        	return tmp;
        }
        
        function code(w, l)
        	tmp = 0.0
        	if (w <= -1.55e+99)
        		tmp = Float64(Float64(-fma(Float64(Float64(fma(-0.16666666666666666, w, 0.5) * w) - 1.0), w, 1.0)) / Float64(-1.0 / l));
        	else
        		tmp = Float64(fma(-1.0, w, 1.0) * (l ^ fma(fma(0.5, w, 1.0), w, 1.0)));
        	end
        	return tmp
        end
        
        code[w_, l_] := If[LessEqual[w, -1.55e+99], N[((-N[(N[(N[(N[(-0.16666666666666666 * w + 0.5), $MachinePrecision] * w), $MachinePrecision] - 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * w + 1.0), $MachinePrecision] * N[Power[l, N[(N[(0.5 * w + 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;w \leq -1.55 \cdot 10^{+99}:\\
        \;\;\;\;\frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}}\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if w < -1.55e99

          1. Initial program 100.0%

            \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. exp-negN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. sqr-powN/A

              \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. pow2N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lower-pow.f64N/A

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

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. metadata-eval100.0

              \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
          4. Applied rewrites100.0%

            \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
          5. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-pow.f64N/A

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. pow-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. metadata-evalN/A

              \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. exp-negN/A

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            9. lift-exp.f64100.0

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. lower-*.f64N/A

              \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
            11. /-rgt-identityN/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            12. associate-/r/N/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            13. lift-/.f64N/A

              \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            14. frac-2neg-revN/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            15. distribute-frac-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
            16. lower-neg.f64N/A

              \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            17. lower-/.f64N/A

              \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            18. lift-/.f64N/A

              \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
            19. distribute-neg-fracN/A

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
            20. metadata-evalN/A

              \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
            21. lower-/.f64100.0

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          6. Applied rewrites100.0%

            \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          7. Taylor expanded in w around 0

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          8. Step-by-step derivation
            1. lower-/.f64100.0

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          9. Applied rewrites100.0%

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          10. Taylor expanded in w around 0

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

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

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

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

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

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

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

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

              \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right)} \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \]
          12. Applied rewrites100.0%

            \[\leadsto -\frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}}{\frac{-1}{\ell}} \]

          if -1.55e99 < w

          1. Initial program 99.5%

            \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
          2. Add Preprocessing
          3. Taylor expanded in w around 0

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

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

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

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

              \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w - 1}, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
            5. lower-*.f6481.2

              \[\leadsto \mathsf{fma}\left(\color{blue}{0.5 \cdot w} - 1, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
          5. Applied rewrites81.2%

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

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

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(w \cdot \left(1 + \frac{1}{2} \cdot w\right) + 1\right)}} \]
            2. distribute-lft-inN/A

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\color{blue}{\left(w \cdot 1 + w \cdot \left(\frac{1}{2} \cdot w\right)\right)} + 1\right)} \]
            3. *-rgt-identityN/A

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\left(\color{blue}{w} + w \cdot \left(\frac{1}{2} \cdot w\right)\right) + 1\right)} \]
            4. associate-+l+N/A

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

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(w + \left(\color{blue}{\left(\frac{1}{2} \cdot w\right) \cdot w} + 1\right)\right)} \]
            6. associate-+l+N/A

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(\left(w + \left(\frac{1}{2} \cdot w\right) \cdot w\right) + 1\right)}} \]
            7. distribute-rgt1-inN/A

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\color{blue}{\left(\frac{1}{2} \cdot w + 1\right) \cdot w} + 1\right)} \]
            8. +-commutativeN/A

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

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

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w + 1}, w, 1\right)\right)} \]
            11. lower-fma.f6486.6

              \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(0.5, w, 1\right)}, w, 1\right)\right)} \]
          8. Applied rewrites86.6%

            \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}} \]
          9. Taylor expanded in w around 0

            \[\leadsto \mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(\frac{1}{2}, w, 1\right), w, 1\right)\right)} \]
          10. Step-by-step derivation
            1. Applied rewrites93.4%

              \[\leadsto \mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)} \]
          11. Recombined 2 regimes into one program.
          12. Final simplification94.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -1.55 \cdot 10^{+99}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-1, w, 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)}\\ \end{array} \]
          13. Add Preprocessing

          Alternative 9: 88.4% accurate, 2.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\ell \leq 780000000:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(1 + w\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}}\\ \end{array} \end{array} \]
          (FPCore (w l)
           :precision binary64
           (if (<= l 780000000.0)
             (* (fma (- (* 0.5 w) 1.0) w 1.0) (pow l (+ 1.0 w)))
             (/
              (- (fma (- (* (fma -0.16666666666666666 w 0.5) w) 1.0) w 1.0))
              (/ -1.0 l))))
          double code(double w, double l) {
          	double tmp;
          	if (l <= 780000000.0) {
          		tmp = fma(((0.5 * w) - 1.0), w, 1.0) * pow(l, (1.0 + w));
          	} else {
          		tmp = -fma(((fma(-0.16666666666666666, w, 0.5) * w) - 1.0), w, 1.0) / (-1.0 / l);
          	}
          	return tmp;
          }
          
          function code(w, l)
          	tmp = 0.0
          	if (l <= 780000000.0)
          		tmp = Float64(fma(Float64(Float64(0.5 * w) - 1.0), w, 1.0) * (l ^ Float64(1.0 + w)));
          	else
          		tmp = Float64(Float64(-fma(Float64(Float64(fma(-0.16666666666666666, w, 0.5) * w) - 1.0), w, 1.0)) / Float64(-1.0 / l));
          	end
          	return tmp
          end
          
          code[w_, l_] := If[LessEqual[l, 780000000.0], N[(N[(N[(N[(0.5 * w), $MachinePrecision] - 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision] * N[Power[l, N[(1.0 + w), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[((-N[(N[(N[(N[(-0.16666666666666666 * w + 0.5), $MachinePrecision] * w), $MachinePrecision] - 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;\ell \leq 780000000:\\
          \;\;\;\;\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(1 + w\right)}\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if l < 7.8e8

            1. Initial program 99.6%

              \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. Add Preprocessing
            3. Taylor expanded in w around 0

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

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

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

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

                \[\leadsto \mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w - 1}, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
              5. lower-*.f6476.2

                \[\leadsto \mathsf{fma}\left(\color{blue}{0.5 \cdot w} - 1, w, 1\right) \cdot {\ell}^{\left(e^{w}\right)} \]
            5. Applied rewrites76.2%

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

              \[\leadsto \mathsf{fma}\left(\frac{1}{2} \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(1 + w\right)}} \]
            7. Step-by-step derivation
              1. lower-+.f6486.9

                \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(1 + w\right)}} \]
            8. Applied rewrites86.9%

              \[\leadsto \mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\color{blue}{\left(1 + w\right)}} \]

            if 7.8e8 < l

            1. Initial program 99.6%

              \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift-exp.f64N/A

                \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
              2. lift-neg.f64N/A

                \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
              3. exp-negN/A

                \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
              4. lift-exp.f64N/A

                \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
              5. inv-powN/A

                \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
              6. sqr-powN/A

                \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
              7. pow2N/A

                \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
              8. lower-pow.f64N/A

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

                \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
              10. metadata-eval99.6

                \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. Applied rewrites99.6%

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. Step-by-step derivation
              1. lift-pow.f64N/A

                \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
              2. lift-pow.f64N/A

                \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
              3. pow-powN/A

                \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
              4. metadata-evalN/A

                \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
              5. inv-powN/A

                \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
              6. lift-exp.f64N/A

                \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
              7. exp-negN/A

                \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
              8. lift-neg.f64N/A

                \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
              9. lift-exp.f6499.6

                \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
              10. lower-*.f64N/A

                \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
              11. /-rgt-identityN/A

                \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
              12. associate-/r/N/A

                \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
              13. lift-/.f64N/A

                \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
              14. frac-2neg-revN/A

                \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
              15. distribute-frac-negN/A

                \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
              16. lower-neg.f64N/A

                \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
              17. lower-/.f64N/A

                \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
              18. lift-/.f64N/A

                \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
              19. distribute-neg-fracN/A

                \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
              20. metadata-evalN/A

                \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
              21. lower-/.f6499.4

                \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
            6. Applied rewrites99.4%

              \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
            7. Taylor expanded in w around 0

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
            8. Step-by-step derivation
              1. lower-/.f6497.7

                \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
            9. Applied rewrites97.7%

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
            10. Taylor expanded in w around 0

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

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

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

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

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

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

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

                \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{6} \cdot w + \frac{1}{2}\right)} \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \]
              8. lower-fma.f6488.1

                \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right)} \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \]
            12. Applied rewrites88.1%

              \[\leadsto -\frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}}{\frac{-1}{\ell}} \]
          3. Recombined 2 regimes into one program.
          4. Final simplification87.5%

            \[\leadsto \begin{array}{l} \mathbf{if}\;\ell \leq 780000000:\\ \;\;\;\;\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right) \cdot {\ell}^{\left(1 + w\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}}\\ \end{array} \]
          5. Add Preprocessing

          Alternative 10: 76.8% accurate, 6.9× speedup?

          \[\begin{array}{l} \\ \frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \end{array} \]
          (FPCore (w l)
           :precision binary64
           (/ (- (fma (- (* (fma -0.16666666666666666 w 0.5) w) 1.0) w 1.0)) (/ -1.0 l)))
          double code(double w, double l) {
          	return -fma(((fma(-0.16666666666666666, w, 0.5) * w) - 1.0), w, 1.0) / (-1.0 / l);
          }
          
          function code(w, l)
          	return Float64(Float64(-fma(Float64(Float64(fma(-0.16666666666666666, w, 0.5) * w) - 1.0), w, 1.0)) / Float64(-1.0 / l))
          end
          
          code[w_, l_] := N[((-N[(N[(N[(N[(-0.16666666666666666 * w + 0.5), $MachinePrecision] * w), $MachinePrecision] - 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}}
          \end{array}
          
          Derivation
          1. Initial program 99.6%

            \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. exp-negN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. sqr-powN/A

              \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. pow2N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lower-pow.f64N/A

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

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. metadata-eval99.6

              \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
          4. Applied rewrites99.6%

            \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
          5. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-pow.f64N/A

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. pow-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. metadata-evalN/A

              \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. exp-negN/A

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            9. lift-exp.f6499.6

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. lower-*.f64N/A

              \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
            11. /-rgt-identityN/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            12. associate-/r/N/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            13. lift-/.f64N/A

              \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            14. frac-2neg-revN/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            15. distribute-frac-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
            16. lower-neg.f64N/A

              \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            17. lower-/.f64N/A

              \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            18. lift-/.f64N/A

              \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
            19. distribute-neg-fracN/A

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
            20. metadata-evalN/A

              \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
            21. lower-/.f6499.5

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          6. Applied rewrites99.5%

            \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          7. Taylor expanded in w around 0

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          8. Step-by-step derivation
            1. lower-/.f6496.6

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          9. Applied rewrites96.6%

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          10. Taylor expanded in w around 0

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

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

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

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

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

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

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

              \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\left(\frac{-1}{6} \cdot w + \frac{1}{2}\right)} \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \]
            8. lower-fma.f6477.0

              \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right)} \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \]
          12. Applied rewrites77.0%

            \[\leadsto -\frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}}{\frac{-1}{\ell}} \]
          13. Final simplification77.0%

            \[\leadsto \frac{-\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right) \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \]
          14. Add Preprocessing

          Alternative 11: 73.7% accurate, 7.9× speedup?

          \[\begin{array}{l} \\ \frac{-\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \end{array} \]
          (FPCore (w l)
           :precision binary64
           (/ (- (fma (- (* 0.5 w) 1.0) w 1.0)) (/ -1.0 l)))
          double code(double w, double l) {
          	return -fma(((0.5 * w) - 1.0), w, 1.0) / (-1.0 / l);
          }
          
          function code(w, l)
          	return Float64(Float64(-fma(Float64(Float64(0.5 * w) - 1.0), w, 1.0)) / Float64(-1.0 / l))
          end
          
          code[w_, l_] := N[((-N[(N[(N[(0.5 * w), $MachinePrecision] - 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{-\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}}
          \end{array}
          
          Derivation
          1. Initial program 99.6%

            \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. exp-negN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. sqr-powN/A

              \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. pow2N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lower-pow.f64N/A

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

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. metadata-eval99.6

              \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
          4. Applied rewrites99.6%

            \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
          5. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-pow.f64N/A

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. pow-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. metadata-evalN/A

              \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. exp-negN/A

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            9. lift-exp.f6499.6

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. lower-*.f64N/A

              \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
            11. /-rgt-identityN/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            12. associate-/r/N/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            13. lift-/.f64N/A

              \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            14. frac-2neg-revN/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            15. distribute-frac-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
            16. lower-neg.f64N/A

              \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            17. lower-/.f64N/A

              \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            18. lift-/.f64N/A

              \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
            19. distribute-neg-fracN/A

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
            20. metadata-evalN/A

              \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
            21. lower-/.f6499.5

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          6. Applied rewrites99.5%

            \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          7. Taylor expanded in w around 0

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          8. Step-by-step derivation
            1. lower-/.f6496.6

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          9. Applied rewrites96.6%

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          10. Taylor expanded in w around 0

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

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

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

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

              \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{\frac{1}{2} \cdot w - 1}, w, 1\right)}{\frac{-1}{\ell}} \]
            5. lower-*.f6474.0

              \[\leadsto -\frac{\mathsf{fma}\left(\color{blue}{0.5 \cdot w} - 1, w, 1\right)}{\frac{-1}{\ell}} \]
          12. Applied rewrites74.0%

            \[\leadsto -\frac{\color{blue}{\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right)}}{\frac{-1}{\ell}} \]
          13. Final simplification74.0%

            \[\leadsto \frac{-\mathsf{fma}\left(0.5 \cdot w - 1, w, 1\right)}{\frac{-1}{\ell}} \]
          14. Add Preprocessing

          Alternative 12: 63.7% accurate, 11.0× speedup?

          \[\begin{array}{l} \\ \frac{-\left(1 - w\right)}{\frac{-1}{\ell}} \end{array} \]
          (FPCore (w l) :precision binary64 (/ (- (- 1.0 w)) (/ -1.0 l)))
          double code(double w, double l) {
          	return -(1.0 - w) / (-1.0 / l);
          }
          
          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(w, l)
          use fmin_fmax_functions
              real(8), intent (in) :: w
              real(8), intent (in) :: l
              code = -(1.0d0 - w) / ((-1.0d0) / l)
          end function
          
          public static double code(double w, double l) {
          	return -(1.0 - w) / (-1.0 / l);
          }
          
          def code(w, l):
          	return -(1.0 - w) / (-1.0 / l)
          
          function code(w, l)
          	return Float64(Float64(-Float64(1.0 - w)) / Float64(-1.0 / l))
          end
          
          function tmp = code(w, l)
          	tmp = -(1.0 - w) / (-1.0 / l);
          end
          
          code[w_, l_] := N[((-N[(1.0 - w), $MachinePrecision]) / N[(-1.0 / l), $MachinePrecision]), $MachinePrecision]
          
          \begin{array}{l}
          
          \\
          \frac{-\left(1 - w\right)}{\frac{-1}{\ell}}
          \end{array}
          
          Derivation
          1. Initial program 99.6%

            \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. exp-negN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. sqr-powN/A

              \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. pow2N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lower-pow.f64N/A

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

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. metadata-eval99.6

              \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
          4. Applied rewrites99.6%

            \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
          5. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-pow.f64N/A

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. pow-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. metadata-evalN/A

              \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. exp-negN/A

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            9. lift-exp.f6499.6

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. lower-*.f64N/A

              \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
            11. /-rgt-identityN/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            12. associate-/r/N/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            13. lift-/.f64N/A

              \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            14. frac-2neg-revN/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            15. distribute-frac-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
            16. lower-neg.f64N/A

              \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            17. lower-/.f64N/A

              \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            18. lift-/.f64N/A

              \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
            19. distribute-neg-fracN/A

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
            20. metadata-evalN/A

              \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
            21. lower-/.f6499.5

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          6. Applied rewrites99.5%

            \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          7. Taylor expanded in w around 0

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          8. Step-by-step derivation
            1. lower-/.f6496.6

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          9. Applied rewrites96.6%

            \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{\ell}}} \]
          10. Taylor expanded in w around 0

            \[\leadsto -\frac{\color{blue}{1 + -1 \cdot w}}{\frac{-1}{\ell}} \]
          11. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto -\frac{1 + \color{blue}{w \cdot -1}}{\frac{-1}{\ell}} \]
            2. fp-cancel-sign-sub-invN/A

              \[\leadsto -\frac{\color{blue}{1 - \left(\mathsf{neg}\left(w\right)\right) \cdot -1}}{\frac{-1}{\ell}} \]
            3. distribute-lft-neg-inN/A

              \[\leadsto -\frac{1 - \color{blue}{\left(\mathsf{neg}\left(w \cdot -1\right)\right)}}{\frac{-1}{\ell}} \]
            4. distribute-rgt-neg-inN/A

              \[\leadsto -\frac{1 - \color{blue}{w \cdot \left(\mathsf{neg}\left(-1\right)\right)}}{\frac{-1}{\ell}} \]
            5. metadata-evalN/A

              \[\leadsto -\frac{1 - w \cdot \color{blue}{1}}{\frac{-1}{\ell}} \]
            6. *-rgt-identityN/A

              \[\leadsto -\frac{1 - \color{blue}{w}}{\frac{-1}{\ell}} \]
            7. lower--.f6466.6

              \[\leadsto -\frac{\color{blue}{1 - w}}{\frac{-1}{\ell}} \]
          12. Applied rewrites66.6%

            \[\leadsto -\frac{\color{blue}{1 - w}}{\frac{-1}{\ell}} \]
          13. Final simplification66.6%

            \[\leadsto \frac{-\left(1 - w\right)}{\frac{-1}{\ell}} \]
          14. Add Preprocessing

          Alternative 13: 57.2% accurate, 61.8× speedup?

          \[\begin{array}{l} \\ -\left(-\ell\right) \end{array} \]
          (FPCore (w l) :precision binary64 (- (- l)))
          double code(double w, double l) {
          	return -(-l);
          }
          
          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(w, l)
          use fmin_fmax_functions
              real(8), intent (in) :: w
              real(8), intent (in) :: l
              code = -(-l)
          end function
          
          public static double code(double w, double l) {
          	return -(-l);
          }
          
          def code(w, l):
          	return -(-l)
          
          function code(w, l)
          	return Float64(-Float64(-l))
          end
          
          function tmp = code(w, l)
          	tmp = -(-l);
          end
          
          code[w_, l_] := (-(-l))
          
          \begin{array}{l}
          
          \\
          -\left(-\ell\right)
          \end{array}
          
          Derivation
          1. Initial program 99.6%

            \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-exp.f64N/A

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. exp-negN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. sqr-powN/A

              \[\leadsto \color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)} \cdot {\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. pow2N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lower-pow.f64N/A

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

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\left(\frac{-1}{2}\right)}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. metadata-eval99.6

              \[\leadsto {\left({\left(e^{w}\right)}^{\color{blue}{-0.5}}\right)}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
          4. Applied rewrites99.6%

            \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{-0.5}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
          5. Step-by-step derivation
            1. lift-pow.f64N/A

              \[\leadsto \color{blue}{{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}^{2}} \cdot {\ell}^{\left(e^{w}\right)} \]
            2. lift-pow.f64N/A

              \[\leadsto {\color{blue}{\left({\left(e^{w}\right)}^{\frac{-1}{2}}\right)}}^{2} \cdot {\ell}^{\left(e^{w}\right)} \]
            3. pow-powN/A

              \[\leadsto \color{blue}{{\left(e^{w}\right)}^{\left(\frac{-1}{2} \cdot 2\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            4. metadata-evalN/A

              \[\leadsto {\left(e^{w}\right)}^{\color{blue}{-1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            5. inv-powN/A

              \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            6. lift-exp.f64N/A

              \[\leadsto \frac{1}{\color{blue}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
            7. exp-negN/A

              \[\leadsto \color{blue}{e^{\mathsf{neg}\left(w\right)}} \cdot {\ell}^{\left(e^{w}\right)} \]
            8. lift-neg.f64N/A

              \[\leadsto e^{\color{blue}{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            9. lift-exp.f6499.6

              \[\leadsto \color{blue}{e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
            10. lower-*.f64N/A

              \[\leadsto \color{blue}{e^{-w} \cdot {\ell}^{\left(e^{w}\right)}} \]
            11. /-rgt-identityN/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
            12. associate-/r/N/A

              \[\leadsto \color{blue}{\frac{e^{-w}}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            13. lift-/.f64N/A

              \[\leadsto \frac{e^{-w}}{\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}} \]
            14. frac-2neg-revN/A

              \[\leadsto \color{blue}{\frac{\mathsf{neg}\left(e^{-w}\right)}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            15. distribute-frac-negN/A

              \[\leadsto \color{blue}{\mathsf{neg}\left(\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}\right)} \]
            16. lower-neg.f64N/A

              \[\leadsto \color{blue}{-\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            17. lower-/.f64N/A

              \[\leadsto -\color{blue}{\frac{e^{-w}}{\mathsf{neg}\left(\frac{1}{{\ell}^{\left(e^{w}\right)}}\right)}} \]
            18. lift-/.f64N/A

              \[\leadsto -\frac{e^{-w}}{\mathsf{neg}\left(\color{blue}{\frac{1}{{\ell}^{\left(e^{w}\right)}}}\right)} \]
            19. distribute-neg-fracN/A

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{\mathsf{neg}\left(1\right)}{{\ell}^{\left(e^{w}\right)}}}} \]
            20. metadata-evalN/A

              \[\leadsto -\frac{e^{-w}}{\frac{\color{blue}{-1}}{{\ell}^{\left(e^{w}\right)}}} \]
            21. lower-/.f6499.5

              \[\leadsto -\frac{e^{-w}}{\color{blue}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          6. Applied rewrites99.5%

            \[\leadsto \color{blue}{-\frac{e^{-w}}{\frac{-1}{{\ell}^{\left(e^{w}\right)}}}} \]
          7. Taylor expanded in w around 0

            \[\leadsto -\color{blue}{-1 \cdot \ell} \]
          8. Step-by-step derivation
            1. mul-1-negN/A

              \[\leadsto -\color{blue}{\left(\mathsf{neg}\left(\ell\right)\right)} \]
            2. lower-neg.f6461.4

              \[\leadsto -\color{blue}{\left(-\ell\right)} \]
          9. Applied rewrites61.4%

            \[\leadsto -\color{blue}{\left(-\ell\right)} \]
          10. Add Preprocessing

          Reproduce

          ?
          herbie shell --seed 2024360 
          (FPCore (w l)
            :name "exp-w (used to crash)"
            :precision binary64
            (* (exp (- w)) (pow l (exp w))))