exp-w (used to crash)

Percentage Accurate: 99.5% → 99.5%
Time: 21.5s
Alternatives: 18
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));
}
real(8) function code(w, l)
    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 18 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.5% 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));
}
real(8) function code(w, l)
    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.5% accurate, 1.0× speedup?

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

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

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

    \[\leadsto {\ell}^{\left(e^{w}\right)} \cdot e^{0 - w} \]
  4. Add Preprocessing

Alternative 2: 98.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq 3.1 \cdot 10^{-17}:\\ \;\;\;\;\frac{\ell}{e^{w}}\\ \mathbf{else}:\\ \;\;\;\;e^{e^{w} \cdot \log \ell - w}\\ \end{array} \end{array} \]
(FPCore (w l)
 :precision binary64
 (if (<= w 3.1e-17) (/ l (exp w)) (exp (- (* (exp w) (log l)) w))))
double code(double w, double l) {
	double tmp;
	if (w <= 3.1e-17) {
		tmp = l / exp(w);
	} else {
		tmp = exp(((exp(w) * log(l)) - w));
	}
	return tmp;
}
real(8) function code(w, l)
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    real(8) :: tmp
    if (w <= 3.1d-17) then
        tmp = l / exp(w)
    else
        tmp = exp(((exp(w) * log(l)) - w))
    end if
    code = tmp
end function
public static double code(double w, double l) {
	double tmp;
	if (w <= 3.1e-17) {
		tmp = l / Math.exp(w);
	} else {
		tmp = Math.exp(((Math.exp(w) * Math.log(l)) - w));
	}
	return tmp;
}
def code(w, l):
	tmp = 0
	if w <= 3.1e-17:
		tmp = l / math.exp(w)
	else:
		tmp = math.exp(((math.exp(w) * math.log(l)) - w))
	return tmp
function code(w, l)
	tmp = 0.0
	if (w <= 3.1e-17)
		tmp = Float64(l / exp(w));
	else
		tmp = exp(Float64(Float64(exp(w) * log(l)) - w));
	end
	return tmp
end
function tmp_2 = code(w, l)
	tmp = 0.0;
	if (w <= 3.1e-17)
		tmp = l / exp(w);
	else
		tmp = exp(((exp(w) * log(l)) - w));
	end
	tmp_2 = tmp;
end
code[w_, l_] := If[LessEqual[w, 3.1e-17], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(N[Exp[w], $MachinePrecision] * N[Log[l], $MachinePrecision]), $MachinePrecision] - w), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;w \leq 3.1 \cdot 10^{-17}:\\
\;\;\;\;\frac{\ell}{e^{w}}\\

\mathbf{else}:\\
\;\;\;\;e^{e^{w} \cdot \log \ell - w}\\


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

    1. Initial program 99.9%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
    4. Step-by-step derivation
      1. Simplified99.3%

        \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
      2. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \ell \cdot \frac{1}{\color{blue}{e^{w}}} \]
        3. un-div-invN/A

          \[\leadsto \frac{\ell}{\color{blue}{e^{w}}} \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\ell, \color{blue}{\left(e^{w}\right)}\right) \]
        5. exp-lowering-exp.f6499.3%

          \[\leadsto \mathsf{/.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right) \]
      3. Applied egg-rr99.3%

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

      if 3.0999999999999998e-17 < w

      1. Initial program 98.7%

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

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

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

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

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

          \[\leadsto e^{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        5. log-recN/A

          \[\leadsto e^{\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        6. *-commutativeN/A

          \[\leadsto e^{\mathsf{neg}\left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        7. mul-1-negN/A

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

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0} \cdot e^{\mathsf{neg}\left(\color{blue}{w}\right)} \]
        9. exp-sumN/A

          \[\leadsto e^{\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        10. +-rgt-identityN/A

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        11. +-commutativeN/A

          \[\leadsto e^{\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \]
        12. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)\right)\right) \]
        14. unsub-negN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w\right)\right) \]
        15. --lowering--.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      5. Simplified98.8%

        \[\leadsto \color{blue}{e^{\mathsf{fma}\left(\log \ell, e^{w}, 0\right) - w}} \]
      6. Step-by-step derivation
        1. +-rgt-identityN/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\log \ell \cdot e^{w}\right), w\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\log \ell, \left(e^{w}\right)\right), w\right)\right) \]
        3. log-lowering-log.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \left(e^{w}\right)\right), w\right)\right) \]
        4. exp-lowering-exp.f6498.8%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
      7. Applied egg-rr98.8%

        \[\leadsto e^{\color{blue}{\log \ell \cdot e^{w}} - w} \]
    5. Recombined 2 regimes into one program.
    6. Final simplification99.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq 3.1 \cdot 10^{-17}:\\ \;\;\;\;\frac{\ell}{e^{w}}\\ \mathbf{else}:\\ \;\;\;\;e^{e^{w} \cdot \log \ell - w}\\ \end{array} \]
    7. Add Preprocessing

    Alternative 3: 98.6% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -4.5:\\ \;\;\;\;e^{0 - w}\\ \mathbf{else}:\\ \;\;\;\;{\ell}^{\left(e^{w}\right)} \cdot \left(1 - w\right)\\ \end{array} \end{array} \]
    (FPCore (w l)
     :precision binary64
     (if (<= w -4.5) (exp (- 0.0 w)) (* (pow l (exp w)) (- 1.0 w))))
    double code(double w, double l) {
    	double tmp;
    	if (w <= -4.5) {
    		tmp = exp((0.0 - w));
    	} else {
    		tmp = pow(l, exp(w)) * (1.0 - w);
    	}
    	return tmp;
    }
    
    real(8) function code(w, l)
        real(8), intent (in) :: w
        real(8), intent (in) :: l
        real(8) :: tmp
        if (w <= (-4.5d0)) then
            tmp = exp((0.0d0 - w))
        else
            tmp = (l ** exp(w)) * (1.0d0 - w)
        end if
        code = tmp
    end function
    
    public static double code(double w, double l) {
    	double tmp;
    	if (w <= -4.5) {
    		tmp = Math.exp((0.0 - w));
    	} else {
    		tmp = Math.pow(l, Math.exp(w)) * (1.0 - w);
    	}
    	return tmp;
    }
    
    def code(w, l):
    	tmp = 0
    	if w <= -4.5:
    		tmp = math.exp((0.0 - w))
    	else:
    		tmp = math.pow(l, math.exp(w)) * (1.0 - w)
    	return tmp
    
    function code(w, l)
    	tmp = 0.0
    	if (w <= -4.5)
    		tmp = exp(Float64(0.0 - w));
    	else
    		tmp = Float64((l ^ exp(w)) * Float64(1.0 - w));
    	end
    	return tmp
    end
    
    function tmp_2 = code(w, l)
    	tmp = 0.0;
    	if (w <= -4.5)
    		tmp = exp((0.0 - w));
    	else
    		tmp = (l ^ exp(w)) * (1.0 - w);
    	end
    	tmp_2 = tmp;
    end
    
    code[w_, l_] := If[LessEqual[w, -4.5], N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * N[(1.0 - w), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;w \leq -4.5:\\
    \;\;\;\;e^{0 - w}\\
    
    \mathbf{else}:\\
    \;\;\;\;{\ell}^{\left(e^{w}\right)} \cdot \left(1 - w\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if w < -4.5

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto e^{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        5. log-recN/A

          \[\leadsto e^{\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        6. *-commutativeN/A

          \[\leadsto e^{\mathsf{neg}\left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        7. mul-1-negN/A

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

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0} \cdot e^{\mathsf{neg}\left(\color{blue}{w}\right)} \]
        9. exp-sumN/A

          \[\leadsto e^{\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        10. +-rgt-identityN/A

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        11. +-commutativeN/A

          \[\leadsto e^{\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \]
        12. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)\right)\right) \]
        14. unsub-negN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w\right)\right) \]
        15. --lowering--.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      5. Simplified100.0%

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

        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot w\right)}\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto \mathsf{exp.f64}\left(\left(0 - w\right)\right) \]
        3. --lowering--.f64100.0%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, w\right)\right) \]
      8. Simplified100.0%

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

      if -4.5 < 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 \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      4. Step-by-step derivation
        1. neg-mul-1N/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        2. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        3. --lowering--.f6498.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      5. Simplified98.8%

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

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

    Alternative 4: 98.4% accurate, 2.3× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto e^{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        5. log-recN/A

          \[\leadsto e^{\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        6. *-commutativeN/A

          \[\leadsto e^{\mathsf{neg}\left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        7. mul-1-negN/A

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

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0} \cdot e^{\mathsf{neg}\left(\color{blue}{w}\right)} \]
        9. exp-sumN/A

          \[\leadsto e^{\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        10. +-rgt-identityN/A

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        11. +-commutativeN/A

          \[\leadsto e^{\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \]
        12. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)\right)\right) \]
        14. unsub-negN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w\right)\right) \]
        15. --lowering--.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      5. Simplified100.0%

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

        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot w\right)}\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto \mathsf{exp.f64}\left(\left(0 - w\right)\right) \]
        3. --lowering--.f64100.0%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, w\right)\right) \]
      8. Simplified100.0%

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

      if -1500 < 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 \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      4. Step-by-step derivation
        1. neg-mul-1N/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        2. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        3. --lowering--.f6498.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      5. Simplified98.3%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \left(w \cdot \frac{1}{6} + \frac{1}{2}\right), 1\right), 1\right)\right)\right) \]
        7. accelerator-lowering-fma.f6498.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \color{blue}{\frac{1}{6}}, \frac{1}{2}\right), 1\right), 1\right)\right)\right) \]
      8. Simplified98.8%

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

    Alternative 5: 98.6% accurate, 2.4× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto e^{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        5. log-recN/A

          \[\leadsto e^{\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        6. *-commutativeN/A

          \[\leadsto e^{\mathsf{neg}\left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        7. mul-1-negN/A

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

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0} \cdot e^{\mathsf{neg}\left(\color{blue}{w}\right)} \]
        9. exp-sumN/A

          \[\leadsto e^{\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        10. +-rgt-identityN/A

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        11. +-commutativeN/A

          \[\leadsto e^{\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \]
        12. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)\right)\right) \]
        14. unsub-negN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w\right)\right) \]
        15. --lowering--.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      5. Simplified100.0%

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

        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot w\right)}\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto \mathsf{exp.f64}\left(\left(0 - w\right)\right) \]
        3. --lowering--.f64100.0%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, w\right)\right) \]
      8. Simplified100.0%

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

      if -1.30000000000000004 < 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 \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      4. Step-by-step derivation
        1. neg-mul-1N/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        2. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        3. --lowering--.f6498.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      5. Simplified98.8%

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \mathsf{fma.f64}\left(w, \left(w \cdot \frac{1}{2} + 1\right), 1\right)\right)\right) \]
        5. accelerator-lowering-fma.f6498.8%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \color{blue}{\frac{1}{2}}, 1\right), 1\right)\right)\right) \]
      8. Simplified98.8%

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

    Alternative 6: 98.4% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -1500:\\ \;\;\;\;e^{0 - w}\\ \mathbf{else}:\\ \;\;\;\;\left(1 - w\right) \cdot \left(\ell \cdot {\ell}^{w}\right)\\ \end{array} \end{array} \]
    (FPCore (w l)
     :precision binary64
     (if (<= w -1500.0) (exp (- 0.0 w)) (* (- 1.0 w) (* l (pow l w)))))
    double code(double w, double l) {
    	double tmp;
    	if (w <= -1500.0) {
    		tmp = exp((0.0 - w));
    	} else {
    		tmp = (1.0 - w) * (l * pow(l, w));
    	}
    	return tmp;
    }
    
    real(8) function code(w, l)
        real(8), intent (in) :: w
        real(8), intent (in) :: l
        real(8) :: tmp
        if (w <= (-1500.0d0)) then
            tmp = exp((0.0d0 - w))
        else
            tmp = (1.0d0 - w) * (l * (l ** w))
        end if
        code = tmp
    end function
    
    public static double code(double w, double l) {
    	double tmp;
    	if (w <= -1500.0) {
    		tmp = Math.exp((0.0 - w));
    	} else {
    		tmp = (1.0 - w) * (l * Math.pow(l, w));
    	}
    	return tmp;
    }
    
    def code(w, l):
    	tmp = 0
    	if w <= -1500.0:
    		tmp = math.exp((0.0 - w))
    	else:
    		tmp = (1.0 - w) * (l * math.pow(l, w))
    	return tmp
    
    function code(w, l)
    	tmp = 0.0
    	if (w <= -1500.0)
    		tmp = exp(Float64(0.0 - w));
    	else
    		tmp = Float64(Float64(1.0 - w) * Float64(l * (l ^ w)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(w, l)
    	tmp = 0.0;
    	if (w <= -1500.0)
    		tmp = exp((0.0 - w));
    	else
    		tmp = (1.0 - w) * (l * (l ^ w));
    	end
    	tmp_2 = tmp;
    end
    
    code[w_, l_] := If[LessEqual[w, -1500.0], N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision], N[(N[(1.0 - w), $MachinePrecision] * N[(l * N[Power[l, w], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;w \leq -1500:\\
    \;\;\;\;e^{0 - w}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(1 - w\right) \cdot \left(\ell \cdot {\ell}^{w}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if w < -1500

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto e^{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        5. log-recN/A

          \[\leadsto e^{\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        6. *-commutativeN/A

          \[\leadsto e^{\mathsf{neg}\left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        7. mul-1-negN/A

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

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0} \cdot e^{\mathsf{neg}\left(\color{blue}{w}\right)} \]
        9. exp-sumN/A

          \[\leadsto e^{\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        10. +-rgt-identityN/A

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        11. +-commutativeN/A

          \[\leadsto e^{\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \]
        12. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)\right)\right) \]
        14. unsub-negN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w\right)\right) \]
        15. --lowering--.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      5. Simplified100.0%

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

        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot w\right)}\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto \mathsf{exp.f64}\left(\left(0 - w\right)\right) \]
        3. --lowering--.f64100.0%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, w\right)\right) \]
      8. Simplified100.0%

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

      if -1500 < 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 \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      4. Step-by-step derivation
        1. neg-mul-1N/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        2. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        3. --lowering--.f6498.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      5. Simplified98.3%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \color{blue}{\left(1 + w\right)}\right)\right) \]
      7. Step-by-step derivation
        1. +-lowering-+.f6498.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \color{blue}{w}\right)\right)\right) \]
      8. Simplified98.0%

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \left({\ell}^{\left(w + \color{blue}{1}\right)}\right)\right) \]
        2. pow-plusN/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \left({\ell}^{w} \cdot \color{blue}{\ell}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{*.f64}\left(\left({\ell}^{w}\right), \color{blue}{\ell}\right)\right) \]
        4. pow-lowering-pow.f6498.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, w\right), \ell\right)\right) \]
      10. Applied egg-rr98.3%

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

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

    Alternative 7: 98.4% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -1500:\\ \;\;\;\;e^{0 - w}\\ \mathbf{else}:\\ \;\;\;\;\ell \cdot \left(\left(1 - w\right) \cdot {\ell}^{w}\right)\\ \end{array} \end{array} \]
    (FPCore (w l)
     :precision binary64
     (if (<= w -1500.0) (exp (- 0.0 w)) (* l (* (- 1.0 w) (pow l w)))))
    double code(double w, double l) {
    	double tmp;
    	if (w <= -1500.0) {
    		tmp = exp((0.0 - w));
    	} else {
    		tmp = l * ((1.0 - w) * pow(l, w));
    	}
    	return tmp;
    }
    
    real(8) function code(w, l)
        real(8), intent (in) :: w
        real(8), intent (in) :: l
        real(8) :: tmp
        if (w <= (-1500.0d0)) then
            tmp = exp((0.0d0 - w))
        else
            tmp = l * ((1.0d0 - w) * (l ** w))
        end if
        code = tmp
    end function
    
    public static double code(double w, double l) {
    	double tmp;
    	if (w <= -1500.0) {
    		tmp = Math.exp((0.0 - w));
    	} else {
    		tmp = l * ((1.0 - w) * Math.pow(l, w));
    	}
    	return tmp;
    }
    
    def code(w, l):
    	tmp = 0
    	if w <= -1500.0:
    		tmp = math.exp((0.0 - w))
    	else:
    		tmp = l * ((1.0 - w) * math.pow(l, w))
    	return tmp
    
    function code(w, l)
    	tmp = 0.0
    	if (w <= -1500.0)
    		tmp = exp(Float64(0.0 - w));
    	else
    		tmp = Float64(l * Float64(Float64(1.0 - w) * (l ^ w)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(w, l)
    	tmp = 0.0;
    	if (w <= -1500.0)
    		tmp = exp((0.0 - w));
    	else
    		tmp = l * ((1.0 - w) * (l ^ w));
    	end
    	tmp_2 = tmp;
    end
    
    code[w_, l_] := If[LessEqual[w, -1500.0], N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision], N[(l * N[(N[(1.0 - w), $MachinePrecision] * N[Power[l, w], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;w \leq -1500:\\
    \;\;\;\;e^{0 - w}\\
    
    \mathbf{else}:\\
    \;\;\;\;\ell \cdot \left(\left(1 - w\right) \cdot {\ell}^{w}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if w < -1500

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto e^{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        5. log-recN/A

          \[\leadsto e^{\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        6. *-commutativeN/A

          \[\leadsto e^{\mathsf{neg}\left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        7. mul-1-negN/A

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

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0} \cdot e^{\mathsf{neg}\left(\color{blue}{w}\right)} \]
        9. exp-sumN/A

          \[\leadsto e^{\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        10. +-rgt-identityN/A

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        11. +-commutativeN/A

          \[\leadsto e^{\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \]
        12. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)\right)\right) \]
        14. unsub-negN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w\right)\right) \]
        15. --lowering--.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      5. Simplified100.0%

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

        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot w\right)}\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto \mathsf{exp.f64}\left(\left(0 - w\right)\right) \]
        3. --lowering--.f64100.0%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, w\right)\right) \]
      8. Simplified100.0%

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

      if -1500 < 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 \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      4. Step-by-step derivation
        1. neg-mul-1N/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        2. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        3. --lowering--.f6498.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      5. Simplified98.3%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \color{blue}{\left(1 + w\right)}\right)\right) \]
      7. Step-by-step derivation
        1. +-lowering-+.f6498.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \color{blue}{w}\right)\right)\right) \]
      8. Simplified98.0%

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

          \[\leadsto {\ell}^{\left(1 + w\right)} \cdot \color{blue}{\left(1 - w\right)} \]
        2. unpow-prod-upN/A

          \[\leadsto \left({\ell}^{1} \cdot {\ell}^{w}\right) \cdot \left(\color{blue}{1} - w\right) \]
        3. unpow1N/A

          \[\leadsto \left(\ell \cdot {\ell}^{w}\right) \cdot \left(1 - w\right) \]
        4. associate-*l*N/A

          \[\leadsto \ell \cdot \color{blue}{\left({\ell}^{w} \cdot \left(1 - w\right)\right)} \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\ell, \color{blue}{\left({\ell}^{w} \cdot \left(1 - w\right)\right)}\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\left({\ell}^{w}\right), \color{blue}{\left(1 - w\right)}\right)\right) \]
        7. pow-lowering-pow.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, w\right), \left(\color{blue}{1} - w\right)\right)\right) \]
        8. --lowering--.f6498.3%

          \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, w\right), \mathsf{\_.f64}\left(1, \color{blue}{w}\right)\right)\right) \]
      10. Applied egg-rr98.3%

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

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

    Alternative 8: 98.2% accurate, 2.6× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -1500:\\ \;\;\;\;e^{0 - w}\\ \mathbf{else}:\\ \;\;\;\;\left(1 - w\right) \cdot {\ell}^{\left(w + 1\right)}\\ \end{array} \end{array} \]
    (FPCore (w l)
     :precision binary64
     (if (<= w -1500.0) (exp (- 0.0 w)) (* (- 1.0 w) (pow l (+ w 1.0)))))
    double code(double w, double l) {
    	double tmp;
    	if (w <= -1500.0) {
    		tmp = exp((0.0 - w));
    	} else {
    		tmp = (1.0 - w) * pow(l, (w + 1.0));
    	}
    	return tmp;
    }
    
    real(8) function code(w, l)
        real(8), intent (in) :: w
        real(8), intent (in) :: l
        real(8) :: tmp
        if (w <= (-1500.0d0)) then
            tmp = exp((0.0d0 - w))
        else
            tmp = (1.0d0 - w) * (l ** (w + 1.0d0))
        end if
        code = tmp
    end function
    
    public static double code(double w, double l) {
    	double tmp;
    	if (w <= -1500.0) {
    		tmp = Math.exp((0.0 - w));
    	} else {
    		tmp = (1.0 - w) * Math.pow(l, (w + 1.0));
    	}
    	return tmp;
    }
    
    def code(w, l):
    	tmp = 0
    	if w <= -1500.0:
    		tmp = math.exp((0.0 - w))
    	else:
    		tmp = (1.0 - w) * math.pow(l, (w + 1.0))
    	return tmp
    
    function code(w, l)
    	tmp = 0.0
    	if (w <= -1500.0)
    		tmp = exp(Float64(0.0 - w));
    	else
    		tmp = Float64(Float64(1.0 - w) * (l ^ Float64(w + 1.0)));
    	end
    	return tmp
    end
    
    function tmp_2 = code(w, l)
    	tmp = 0.0;
    	if (w <= -1500.0)
    		tmp = exp((0.0 - w));
    	else
    		tmp = (1.0 - w) * (l ^ (w + 1.0));
    	end
    	tmp_2 = tmp;
    end
    
    code[w_, l_] := If[LessEqual[w, -1500.0], N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision], N[(N[(1.0 - w), $MachinePrecision] * N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;w \leq -1500:\\
    \;\;\;\;e^{0 - w}\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(1 - w\right) \cdot {\ell}^{\left(w + 1\right)}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if w < -1500

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto e^{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        5. log-recN/A

          \[\leadsto e^{\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        6. *-commutativeN/A

          \[\leadsto e^{\mathsf{neg}\left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
        7. mul-1-negN/A

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

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0} \cdot e^{\mathsf{neg}\left(\color{blue}{w}\right)} \]
        9. exp-sumN/A

          \[\leadsto e^{\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        10. +-rgt-identityN/A

          \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
        11. +-commutativeN/A

          \[\leadsto e^{\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \]
        12. exp-lowering-exp.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\left(\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right)\right) \]
        13. +-commutativeN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)\right)\right) \]
        14. unsub-negN/A

          \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w\right)\right) \]
        15. --lowering--.f64N/A

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      5. Simplified100.0%

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

        \[\leadsto \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot w\right)}\right) \]
      7. Step-by-step derivation
        1. mul-1-negN/A

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

          \[\leadsto \mathsf{exp.f64}\left(\left(0 - w\right)\right) \]
        3. --lowering--.f64100.0%

          \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, w\right)\right) \]
      8. Simplified100.0%

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

      if -1500 < 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 \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      4. Step-by-step derivation
        1. neg-mul-1N/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        2. unsub-negN/A

          \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        3. --lowering--.f6498.3%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      5. Simplified98.3%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \color{blue}{\left(1 + w\right)}\right)\right) \]
      7. Step-by-step derivation
        1. +-lowering-+.f6498.0%

          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \color{blue}{w}\right)\right)\right) \]
      8. Simplified98.0%

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

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

    Alternative 9: 97.4% accurate, 2.8× speedup?

    \[\begin{array}{l} \\ \frac{\ell}{e^{w}} \end{array} \]
    (FPCore (w l) :precision binary64 (/ l (exp w)))
    double code(double w, double l) {
    	return l / exp(w);
    }
    
    real(8) function code(w, l)
        real(8), intent (in) :: w
        real(8), intent (in) :: l
        code = l / exp(w)
    end function
    
    public static double code(double w, double l) {
    	return l / Math.exp(w);
    }
    
    def code(w, l):
    	return l / math.exp(w)
    
    function code(w, l)
    	return Float64(l / exp(w))
    end
    
    function tmp = code(w, l)
    	tmp = l / exp(w);
    end
    
    code[w_, l_] := N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \frac{\ell}{e^{w}}
    \end{array}
    
    Derivation
    1. Initial program 99.6%

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

      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
    4. Step-by-step derivation
      1. Simplified97.0%

        \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
      2. Step-by-step derivation
        1. *-commutativeN/A

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

          \[\leadsto \ell \cdot \frac{1}{\color{blue}{e^{w}}} \]
        3. un-div-invN/A

          \[\leadsto \frac{\ell}{\color{blue}{e^{w}}} \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(\ell, \color{blue}{\left(e^{w}\right)}\right) \]
        5. exp-lowering-exp.f6497.0%

          \[\leadsto \mathsf{/.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right) \]
      3. Applied egg-rr97.0%

        \[\leadsto \color{blue}{\frac{\ell}{e^{w}}} \]
      4. Add Preprocessing

      Alternative 10: 97.8% accurate, 2.8× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

            \[\leadsto e^{\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
          5. log-recN/A

            \[\leadsto e^{\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
          6. *-commutativeN/A

            \[\leadsto e^{\mathsf{neg}\left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \cdot e^{\mathsf{neg}\left(w\right)} \]
          7. mul-1-negN/A

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

            \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0} \cdot e^{\mathsf{neg}\left(\color{blue}{w}\right)} \]
          9. exp-sumN/A

            \[\leadsto e^{\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + 0\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
          10. +-rgt-identityN/A

            \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)} \]
          11. +-commutativeN/A

            \[\leadsto e^{\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)} \]
          12. exp-lowering-exp.f64N/A

            \[\leadsto \mathsf{exp.f64}\left(\left(\left(\mathsf{neg}\left(w\right)\right) + -1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right)\right) \]
          13. +-commutativeN/A

            \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) + \left(\mathsf{neg}\left(w\right)\right)\right)\right) \]
          14. unsub-negN/A

            \[\leadsto \mathsf{exp.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w\right)\right) \]
          15. --lowering--.f64N/A

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
        5. Simplified100.0%

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

          \[\leadsto \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot w\right)}\right) \]
        7. Step-by-step derivation
          1. mul-1-negN/A

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

            \[\leadsto \mathsf{exp.f64}\left(\left(0 - w\right)\right) \]
          3. --lowering--.f64100.0%

            \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(0, w\right)\right) \]
        8. Simplified100.0%

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

        if -0.69999999999999996 < w < 0.17999999999999999

        1. Initial program 99.3%

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
        4. Step-by-step derivation
          1. Simplified96.5%

            \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
          2. Taylor expanded in w around 0

            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \ell\right) \]
          3. Step-by-step derivation
            1. neg-mul-1N/A

              \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \ell\right) \]
            2. sub-negN/A

              \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \ell\right) \]
            3. --lowering--.f6496.5%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \ell\right) \]
          4. Simplified96.5%

            \[\leadsto \color{blue}{\left(1 - w\right)} \cdot \ell \]
          5. Applied egg-rr96.6%

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

          if 0.17999999999999999 < w

          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)} \]
            14. metadata-evalN/A

              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)} \]
            15. flip--N/A

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

              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{0} \]
            17. metadata-evalN/A

              \[\leadsto \frac{1}{e^{w}} \cdot 1 \]
            18. associate-/r/N/A

              \[\leadsto \frac{1}{\color{blue}{\frac{e^{w}}{1}}} \]
            19. div-invN/A

              \[\leadsto \frac{1}{e^{w} \cdot \color{blue}{\frac{1}{1}}} \]
            20. metadata-evalN/A

              \[\leadsto \frac{1}{e^{w} \cdot 1} \]
            21. metadata-evalN/A

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

              \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{2}\right)} \]
            23. metadata-evalN/A

              \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{\color{blue}{2}}\right)} \]
          4. Applied egg-rr100.0%

            \[\leadsto \color{blue}{0} \]
        5. Recombined 3 regimes into one program.
        6. Final simplification98.2%

          \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -0.7:\\ \;\;\;\;e^{0 - w}\\ \mathbf{elif}\;w \leq 0.18:\\ \;\;\;\;\ell \cdot \frac{1 + w \cdot \mathsf{fma}\left(w, w, 0\right)}{1 + \left(\mathsf{fma}\left(w, w, 0\right) - w\right)}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
        7. Add Preprocessing

        Alternative 11: 97.4% accurate, 2.8× speedup?

        \[\begin{array}{l} \\ \ell \cdot e^{0 - w} \end{array} \]
        (FPCore (w l) :precision binary64 (* l (exp (- 0.0 w))))
        double code(double w, double l) {
        	return l * exp((0.0 - w));
        }
        
        real(8) function code(w, l)
            real(8), intent (in) :: w
            real(8), intent (in) :: l
            code = l * exp((0.0d0 - w))
        end function
        
        public static double code(double w, double l) {
        	return l * Math.exp((0.0 - w));
        }
        
        def code(w, l):
        	return l * math.exp((0.0 - w))
        
        function code(w, l)
        	return Float64(l * exp(Float64(0.0 - w)))
        end
        
        function tmp = code(w, l)
        	tmp = l * exp((0.0 - w));
        end
        
        code[w_, l_] := N[(l * N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \ell \cdot e^{0 - w}
        \end{array}
        
        Derivation
        1. Initial program 99.6%

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

          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
        4. Step-by-step derivation
          1. Simplified97.0%

            \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
          2. Final simplification97.0%

            \[\leadsto \ell \cdot e^{0 - w} \]
          3. Add Preprocessing

          Alternative 12: 93.7% accurate, 3.3× speedup?

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

            1. Initial program 100.0%

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
            4. Step-by-step derivation
              1. Simplified100.0%

                \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
              2. Step-by-step derivation
                1. *-commutativeN/A

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

                  \[\leadsto \ell \cdot \frac{1}{\color{blue}{e^{w}}} \]
                3. un-div-invN/A

                  \[\leadsto \frac{\ell}{\color{blue}{e^{w}}} \]
                4. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(\ell, \color{blue}{\left(e^{w}\right)}\right) \]
                5. exp-lowering-exp.f64100.0%

                  \[\leadsto \mathsf{/.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right) \]
              3. Applied egg-rr100.0%

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

                \[\leadsto \color{blue}{\ell + w \cdot \left(w \cdot \left(-1 \cdot \left(w \cdot \left(-1 \cdot \left(-1 \cdot \ell + \frac{1}{2} \cdot \ell\right) + \left(\frac{-1}{2} \cdot \ell + \frac{1}{6} \cdot \ell\right)\right)\right) - \left(-1 \cdot \ell + \frac{1}{2} \cdot \ell\right)\right) - \ell\right)} \]
              5. Simplified90.5%

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

                \[\leadsto \color{blue}{\frac{-1}{6} \cdot \left(\ell \cdot {w}^{3}\right)} \]
              7. Step-by-step derivation
                1. associate-*r*N/A

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{-1}{6} \cdot {w}^{3}\right)}\right) \]
                5. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \color{blue}{\left({w}^{3}\right)}\right)\right) \]
                6. cube-multN/A

                  \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \left(w \cdot \color{blue}{\left(w \cdot w\right)}\right)\right)\right) \]
                7. unpow2N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(w, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
                9. unpow2N/A

                  \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(w, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
                10. *-lowering-*.f64100.0%

                  \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
              8. Simplified100.0%

                \[\leadsto \color{blue}{\ell \cdot \left(-0.16666666666666666 \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)} \]

              if -2e103 < w < 0.10000000000000001

              1. Initial program 99.4%

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

                \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + w \cdot \left(w \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot w\right) - 1\right)\right)}, \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
              4. Step-by-step derivation
                1. +-commutativeN/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(w \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot w\right) - 1\right), 1\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                3. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(w \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot w\right) + \left(\mathsf{neg}\left(1\right)\right)\right), 1\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                4. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(w \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot w\right) + -1\right), 1\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                5. accelerator-lowering-fma.f64N/A

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \left(w \cdot \frac{-1}{6} + \frac{1}{2}\right), -1\right), 1\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                8. accelerator-lowering-fma.f6483.0%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \frac{-1}{6}, \frac{1}{2}\right), -1\right), 1\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
              5. Simplified83.0%

                \[\leadsto \color{blue}{\mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), -1\right), 1\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
              6. Step-by-step derivation
                1. distribute-rgt-inN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(w \cdot \left(w \cdot \frac{-1}{6} + \frac{1}{2}\right)\right) \cdot w + -1 \cdot w\right) + 1\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                2. neg-mul-1N/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(w \cdot \left(w \cdot \frac{-1}{6} + \frac{1}{2}\right)\right) \cdot w + \left(\mathsf{neg}\left(w\right)\right)\right) + 1\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                3. associate-+l+N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot w\right) \cdot w + \left(\left(\mathsf{neg}\left(w\right)\right) + 1\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                5. associate-*l*N/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right) + \left(\left(\mathsf{neg}\left(w\right)\right) + 1\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                6. +-commutativeN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right) + \left(1 + \left(\mathsf{neg}\left(w\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                7. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right) + \left(1 - w\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                8. accelerator-lowering-fma.f64N/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(\mathsf{fma.f64}\left(w, \frac{-1}{6}, \frac{1}{2}\right), \left(w \cdot w\right), \left(1 - w\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                10. *-lowering-*.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(\mathsf{fma.f64}\left(w, \frac{-1}{6}, \frac{1}{2}\right), \mathsf{*.f64}\left(w, w\right), \left(1 - w\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                11. --lowering--.f6483.0%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(\mathsf{fma.f64}\left(w, \frac{-1}{6}, \frac{1}{2}\right), \mathsf{*.f64}\left(w, w\right), \mathsf{\_.f64}\left(1, w\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
              7. Applied egg-rr83.0%

                \[\leadsto \color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), w \cdot w, 1 - w\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
              8. Step-by-step derivation
                1. associate-+r-N/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right) + 1\right) - w\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                2. sub-negN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right) + 1\right) + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                3. flip-+N/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\frac{\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right)\right) \cdot \left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right)\right) - 1 \cdot 1}{\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right) - 1} + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                4. div-invN/A

                  \[\leadsto \mathsf{*.f64}\left(\left(\left(\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right)\right) \cdot \left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right)\right) - 1 \cdot 1\right) \cdot \frac{1}{\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right) - 1} + \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                5. accelerator-lowering-fma.f64N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(\left(\left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right)\right) \cdot \left(\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right)\right) - 1 \cdot 1\right), \left(\frac{1}{\left(w \cdot \frac{-1}{6} + \frac{1}{2}\right) \cdot \left(w \cdot w\right) - 1}\right), \left(\mathsf{neg}\left(w\right)\right)\right), \mathsf{pow.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right)\right) \]
              9. Applied egg-rr90.3%

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(\mathsf{fma.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, \mathsf{fma.f64}\left(w, \frac{-1}{6}, \frac{1}{2}\right)\right)\right), \mathsf{*.f64}\left(w, w\right)\right), \mathsf{fma.f64}\left(w, \frac{-1}{6}, \frac{1}{2}\right), -1\right), \mathsf{/.f64}\left(1, \mathsf{fma.f64}\left(\mathsf{fma.f64}\left(w, \frac{-1}{6}, \frac{1}{2}\right), \mathsf{*.f64}\left(w, w\right), -1\right)\right), \mathsf{\_.f64}\left(0, w\right)\right), \color{blue}{\ell}\right) \]
              11. Step-by-step derivation
                1. Simplified89.0%

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

                if 0.10000000000000001 < w

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)} \]
                  14. metadata-evalN/A

                    \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)} \]
                  15. flip--N/A

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

                    \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{0} \]
                  17. metadata-evalN/A

                    \[\leadsto \frac{1}{e^{w}} \cdot 1 \]
                  18. associate-/r/N/A

                    \[\leadsto \frac{1}{\color{blue}{\frac{e^{w}}{1}}} \]
                  19. div-invN/A

                    \[\leadsto \frac{1}{e^{w} \cdot \color{blue}{\frac{1}{1}}} \]
                  20. metadata-evalN/A

                    \[\leadsto \frac{1}{e^{w} \cdot 1} \]
                  21. metadata-evalN/A

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

                    \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{2}\right)} \]
                  23. metadata-evalN/A

                    \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{\color{blue}{2}}\right)} \]
                4. Applied egg-rr100.0%

                  \[\leadsto \color{blue}{0} \]
              12. Recombined 3 regimes into one program.
              13. Final simplification92.9%

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

              Alternative 13: 91.2% accurate, 10.3× speedup?

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

                1. Initial program 99.6%

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
                4. Step-by-step derivation
                  1. Simplified97.8%

                    \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
                  2. Taylor expanded in w around 0

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(w \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot w\right) - 1\right), 1\right), \ell\right) \]
                    3. sub-negN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(w \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot w\right) + \left(\mathsf{neg}\left(1\right)\right)\right), 1\right), \ell\right) \]
                    4. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(w \cdot \left(\frac{1}{2} + \frac{-1}{6} \cdot w\right) + -1\right), 1\right), \ell\right) \]
                    5. accelerator-lowering-fma.f64N/A

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \left(w \cdot \frac{-1}{6} + \frac{1}{2}\right), -1\right), 1\right), \ell\right) \]
                    8. accelerator-lowering-fma.f6487.5%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \frac{-1}{6}, \frac{1}{2}\right), -1\right), 1\right), \ell\right) \]
                  4. Simplified87.5%

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

                  if 0.115000000000000005 < w

                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)} \]
                    14. metadata-evalN/A

                      \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)} \]
                    15. flip--N/A

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

                      \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{0} \]
                    17. metadata-evalN/A

                      \[\leadsto \frac{1}{e^{w}} \cdot 1 \]
                    18. associate-/r/N/A

                      \[\leadsto \frac{1}{\color{blue}{\frac{e^{w}}{1}}} \]
                    19. div-invN/A

                      \[\leadsto \frac{1}{e^{w} \cdot \color{blue}{\frac{1}{1}}} \]
                    20. metadata-evalN/A

                      \[\leadsto \frac{1}{e^{w} \cdot 1} \]
                    21. metadata-evalN/A

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

                      \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{2}\right)} \]
                    23. metadata-evalN/A

                      \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{\color{blue}{2}}\right)} \]
                  4. Applied egg-rr100.0%

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

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

                Alternative 14: 91.2% accurate, 11.4× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -0.023:\\ \;\;\;\;\ell \cdot \left(-0.16666666666666666 \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\\ \mathbf{elif}\;w \leq 0.13:\\ \;\;\;\;\ell \cdot \left(w + 1\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                (FPCore (w l)
                 :precision binary64
                 (if (<= w -0.023)
                   (* l (* -0.16666666666666666 (* w (* w w))))
                   (if (<= w 0.13) (* l (+ w 1.0)) 0.0)))
                double code(double w, double l) {
                	double tmp;
                	if (w <= -0.023) {
                		tmp = l * (-0.16666666666666666 * (w * (w * w)));
                	} else if (w <= 0.13) {
                		tmp = l * (w + 1.0);
                	} else {
                		tmp = 0.0;
                	}
                	return tmp;
                }
                
                real(8) function code(w, l)
                    real(8), intent (in) :: w
                    real(8), intent (in) :: l
                    real(8) :: tmp
                    if (w <= (-0.023d0)) then
                        tmp = l * ((-0.16666666666666666d0) * (w * (w * w)))
                    else if (w <= 0.13d0) then
                        tmp = l * (w + 1.0d0)
                    else
                        tmp = 0.0d0
                    end if
                    code = tmp
                end function
                
                public static double code(double w, double l) {
                	double tmp;
                	if (w <= -0.023) {
                		tmp = l * (-0.16666666666666666 * (w * (w * w)));
                	} else if (w <= 0.13) {
                		tmp = l * (w + 1.0);
                	} else {
                		tmp = 0.0;
                	}
                	return tmp;
                }
                
                def code(w, l):
                	tmp = 0
                	if w <= -0.023:
                		tmp = l * (-0.16666666666666666 * (w * (w * w)))
                	elif w <= 0.13:
                		tmp = l * (w + 1.0)
                	else:
                		tmp = 0.0
                	return tmp
                
                function code(w, l)
                	tmp = 0.0
                	if (w <= -0.023)
                		tmp = Float64(l * Float64(-0.16666666666666666 * Float64(w * Float64(w * w))));
                	elseif (w <= 0.13)
                		tmp = Float64(l * Float64(w + 1.0));
                	else
                		tmp = 0.0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(w, l)
                	tmp = 0.0;
                	if (w <= -0.023)
                		tmp = l * (-0.16666666666666666 * (w * (w * w)));
                	elseif (w <= 0.13)
                		tmp = l * (w + 1.0);
                	else
                		tmp = 0.0;
                	end
                	tmp_2 = tmp;
                end
                
                code[w_, l_] := If[LessEqual[w, -0.023], N[(l * N[(-0.16666666666666666 * N[(w * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.13], N[(l * N[(w + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;w \leq -0.023:\\
                \;\;\;\;\ell \cdot \left(-0.16666666666666666 \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\\
                
                \mathbf{elif}\;w \leq 0.13:\\
                \;\;\;\;\ell \cdot \left(w + 1\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if w < -0.023

                  1. Initial program 100.0%

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
                  4. Step-by-step derivation
                    1. Simplified100.0%

                      \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
                    2. Step-by-step derivation
                      1. *-commutativeN/A

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

                        \[\leadsto \ell \cdot \frac{1}{\color{blue}{e^{w}}} \]
                      3. un-div-invN/A

                        \[\leadsto \frac{\ell}{\color{blue}{e^{w}}} \]
                      4. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{/.f64}\left(\ell, \color{blue}{\left(e^{w}\right)}\right) \]
                      5. exp-lowering-exp.f64100.0%

                        \[\leadsto \mathsf{/.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right) \]
                    3. Applied egg-rr100.0%

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

                      \[\leadsto \color{blue}{\ell + w \cdot \left(w \cdot \left(-1 \cdot \left(w \cdot \left(-1 \cdot \left(-1 \cdot \ell + \frac{1}{2} \cdot \ell\right) + \left(\frac{-1}{2} \cdot \ell + \frac{1}{6} \cdot \ell\right)\right)\right) - \left(-1 \cdot \ell + \frac{1}{2} \cdot \ell\right)\right) - \ell\right)} \]
                    5. Simplified65.3%

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

                      \[\leadsto \color{blue}{\frac{-1}{6} \cdot \left(\ell \cdot {w}^{3}\right)} \]
                    7. Step-by-step derivation
                      1. associate-*r*N/A

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

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

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

                        \[\leadsto \mathsf{*.f64}\left(\ell, \color{blue}{\left(\frac{-1}{6} \cdot {w}^{3}\right)}\right) \]
                      5. *-lowering-*.f64N/A

                        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \color{blue}{\left({w}^{3}\right)}\right)\right) \]
                      6. cube-multN/A

                        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \left(w \cdot \color{blue}{\left(w \cdot w\right)}\right)\right)\right) \]
                      7. unpow2N/A

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

                        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(w, \color{blue}{\left({w}^{2}\right)}\right)\right)\right) \]
                      9. unpow2N/A

                        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(w, \left(w \cdot \color{blue}{w}\right)\right)\right)\right) \]
                      10. *-lowering-*.f6471.4%

                        \[\leadsto \mathsf{*.f64}\left(\ell, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, \color{blue}{w}\right)\right)\right)\right) \]
                    8. Simplified71.4%

                      \[\leadsto \color{blue}{\ell \cdot \left(-0.16666666666666666 \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)} \]

                    if -0.023 < w < 0.13

                    1. Initial program 99.3%

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
                    4. Step-by-step derivation
                      1. Simplified96.5%

                        \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
                      2. Taylor expanded in w around 0

                        \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \ell\right) \]
                      3. Step-by-step derivation
                        1. neg-mul-1N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \ell\right) \]
                        2. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \ell\right) \]
                        3. --lowering--.f6496.5%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \ell\right) \]
                      4. Simplified96.5%

                        \[\leadsto \color{blue}{\left(1 - w\right)} \cdot \ell \]
                      5. Step-by-step derivation
                        1. sub-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \ell\right) \]
                        2. sub0-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(0 - w\right)\right), \ell\right) \]
                        3. flip3--N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{0}^{3} - {w}^{3}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        4. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{0 - {w}^{3}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        5. sub0-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{\mathsf{neg}\left({w}^{3}\right)}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        6. cube-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{\left(\mathsf{neg}\left(w\right)\right)}^{3}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        7. sub0-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{\left(0 - w\right)}^{3}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        8. sqr-powN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{\left(0 - w\right)}^{\left(\frac{3}{2}\right)} \cdot {\left(0 - w\right)}^{\left(\frac{3}{2}\right)}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        9. pow-prod-downN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{\left(\left(0 - w\right) \cdot \left(0 - w\right)\right)}^{\left(\frac{3}{2}\right)}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        10. sub0-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{\left(\left(\mathsf{neg}\left(w\right)\right) \cdot \left(0 - w\right)\right)}^{\left(\frac{3}{2}\right)}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        11. sub0-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{\left(\left(\mathsf{neg}\left(w\right)\right) \cdot \left(\mathsf{neg}\left(w\right)\right)\right)}^{\left(\frac{3}{2}\right)}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        12. sqr-negN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{\left(w \cdot w\right)}^{\left(\frac{3}{2}\right)}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        13. pow-prod-downN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{w}^{\left(\frac{3}{2}\right)} \cdot {w}^{\left(\frac{3}{2}\right)}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        14. sqr-powN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{w}^{3}}{0 \cdot 0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        15. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{w}^{3}}{0 + \left(w \cdot w + 0 \cdot w\right)}\right), \ell\right) \]
                        16. +-lft-identityN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{w}^{3}}{w \cdot w + 0 \cdot w}\right), \ell\right) \]
                        17. distribute-rgt-outN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{w}^{3}}{w \cdot \left(w + 0\right)}\right), \ell\right) \]
                        18. +-commutativeN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{w}^{3}}{w \cdot \left(0 + w\right)}\right), \ell\right) \]
                        19. +-lft-identityN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{w}^{3}}{w \cdot w}\right), \ell\right) \]
                        20. pow2N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + \frac{{w}^{3}}{{w}^{2}}\right), \ell\right) \]
                        21. pow-divN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + {w}^{\left(3 - 2\right)}\right), \ell\right) \]
                        22. metadata-evalN/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + {w}^{1}\right), \ell\right) \]
                        23. unpow1N/A

                          \[\leadsto \mathsf{*.f64}\left(\left(1 + w\right), \ell\right) \]
                      6. Applied egg-rr96.6%

                        \[\leadsto \color{blue}{\left(w + 1\right)} \cdot \ell \]

                      if 0.13 < w

                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)} \]
                        14. metadata-evalN/A

                          \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)} \]
                        15. flip--N/A

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

                          \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{0} \]
                        17. metadata-evalN/A

                          \[\leadsto \frac{1}{e^{w}} \cdot 1 \]
                        18. associate-/r/N/A

                          \[\leadsto \frac{1}{\color{blue}{\frac{e^{w}}{1}}} \]
                        19. div-invN/A

                          \[\leadsto \frac{1}{e^{w} \cdot \color{blue}{\frac{1}{1}}} \]
                        20. metadata-evalN/A

                          \[\leadsto \frac{1}{e^{w} \cdot 1} \]
                        21. metadata-evalN/A

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

                          \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{2}\right)} \]
                        23. metadata-evalN/A

                          \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{\color{blue}{2}}\right)} \]
                      4. Applied egg-rr100.0%

                        \[\leadsto \color{blue}{0} \]
                    5. Recombined 3 regimes into one program.
                    6. Final simplification89.5%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -0.023:\\ \;\;\;\;\ell \cdot \left(-0.16666666666666666 \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\\ \mathbf{elif}\;w \leq 0.13:\\ \;\;\;\;\ell \cdot \left(w + 1\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                    7. Add Preprocessing

                    Alternative 15: 88.2% accurate, 12.9× speedup?

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

                      1. Initial program 99.6%

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

                        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
                      4. Step-by-step derivation
                        1. Simplified97.8%

                          \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
                        2. Taylor expanded in w around 0

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

                            \[\leadsto \mathsf{*.f64}\left(\left(w \cdot \left(\frac{1}{2} \cdot w - 1\right) + 1\right), \ell\right) \]
                          2. accelerator-lowering-fma.f64N/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(\frac{1}{2} \cdot w - 1\right), 1\right), \ell\right) \]
                          3. sub-negN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(\frac{1}{2} \cdot w + \left(\mathsf{neg}\left(1\right)\right)\right), 1\right), \ell\right) \]
                          4. *-commutativeN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(w \cdot \frac{1}{2} + \left(\mathsf{neg}\left(1\right)\right)\right), 1\right), \ell\right) \]
                          5. metadata-evalN/A

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \left(w \cdot \frac{1}{2} + -1\right), 1\right), \ell\right) \]
                          6. accelerator-lowering-fma.f6484.3%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{fma.f64}\left(w, \mathsf{fma.f64}\left(w, \frac{1}{2}, -1\right), 1\right), \ell\right) \]
                        4. Simplified84.3%

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

                        if 0.0850000000000000061 < w

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)} \]
                          14. metadata-evalN/A

                            \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)} \]
                          15. flip--N/A

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

                            \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{0} \]
                          17. metadata-evalN/A

                            \[\leadsto \frac{1}{e^{w}} \cdot 1 \]
                          18. associate-/r/N/A

                            \[\leadsto \frac{1}{\color{blue}{\frac{e^{w}}{1}}} \]
                          19. div-invN/A

                            \[\leadsto \frac{1}{e^{w} \cdot \color{blue}{\frac{1}{1}}} \]
                          20. metadata-evalN/A

                            \[\leadsto \frac{1}{e^{w} \cdot 1} \]
                          21. metadata-evalN/A

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

                            \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{2}\right)} \]
                          23. metadata-evalN/A

                            \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{\color{blue}{2}}\right)} \]
                        4. Applied egg-rr100.0%

                          \[\leadsto \color{blue}{0} \]
                      5. Recombined 2 regimes into one program.
                      6. Final simplification86.9%

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

                      Alternative 16: 77.7% accurate, 20.6× speedup?

                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq 0.075:\\ \;\;\;\;\ell \cdot \left(1 - w\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                      (FPCore (w l) :precision binary64 (if (<= w 0.075) (* l (- 1.0 w)) 0.0))
                      double code(double w, double l) {
                      	double tmp;
                      	if (w <= 0.075) {
                      		tmp = l * (1.0 - w);
                      	} else {
                      		tmp = 0.0;
                      	}
                      	return tmp;
                      }
                      
                      real(8) function code(w, l)
                          real(8), intent (in) :: w
                          real(8), intent (in) :: l
                          real(8) :: tmp
                          if (w <= 0.075d0) then
                              tmp = l * (1.0d0 - w)
                          else
                              tmp = 0.0d0
                          end if
                          code = tmp
                      end function
                      
                      public static double code(double w, double l) {
                      	double tmp;
                      	if (w <= 0.075) {
                      		tmp = l * (1.0 - w);
                      	} else {
                      		tmp = 0.0;
                      	}
                      	return tmp;
                      }
                      
                      def code(w, l):
                      	tmp = 0
                      	if w <= 0.075:
                      		tmp = l * (1.0 - w)
                      	else:
                      		tmp = 0.0
                      	return tmp
                      
                      function code(w, l)
                      	tmp = 0.0
                      	if (w <= 0.075)
                      		tmp = Float64(l * Float64(1.0 - w));
                      	else
                      		tmp = 0.0;
                      	end
                      	return tmp
                      end
                      
                      function tmp_2 = code(w, l)
                      	tmp = 0.0;
                      	if (w <= 0.075)
                      		tmp = l * (1.0 - w);
                      	else
                      		tmp = 0.0;
                      	end
                      	tmp_2 = tmp;
                      end
                      
                      code[w_, l_] := If[LessEqual[w, 0.075], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]
                      
                      \begin{array}{l}
                      
                      \\
                      \begin{array}{l}
                      \mathbf{if}\;w \leq 0.075:\\
                      \;\;\;\;\ell \cdot \left(1 - w\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;0\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if w < 0.0749999999999999972

                        1. Initial program 99.6%

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
                        4. Step-by-step derivation
                          1. Simplified97.8%

                            \[\leadsto e^{-w} \cdot \color{blue}{\ell} \]
                          2. Taylor expanded in w around 0

                            \[\leadsto \mathsf{*.f64}\left(\color{blue}{\left(1 + -1 \cdot w\right)}, \ell\right) \]
                          3. Step-by-step derivation
                            1. neg-mul-1N/A

                              \[\leadsto \mathsf{*.f64}\left(\left(1 + \left(\mathsf{neg}\left(w\right)\right)\right), \ell\right) \]
                            2. sub-negN/A

                              \[\leadsto \mathsf{*.f64}\left(\left(1 - w\right), \ell\right) \]
                            3. --lowering--.f6474.1%

                              \[\leadsto \mathsf{*.f64}\left(\mathsf{\_.f64}\left(1, w\right), \ell\right) \]
                          4. Simplified74.1%

                            \[\leadsto \color{blue}{\left(1 - w\right)} \cdot \ell \]

                          if 0.0749999999999999972 < w

                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)} \]
                            14. metadata-evalN/A

                              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)} \]
                            15. flip--N/A

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

                              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{0} \]
                            17. metadata-evalN/A

                              \[\leadsto \frac{1}{e^{w}} \cdot 1 \]
                            18. associate-/r/N/A

                              \[\leadsto \frac{1}{\color{blue}{\frac{e^{w}}{1}}} \]
                            19. div-invN/A

                              \[\leadsto \frac{1}{e^{w} \cdot \color{blue}{\frac{1}{1}}} \]
                            20. metadata-evalN/A

                              \[\leadsto \frac{1}{e^{w} \cdot 1} \]
                            21. metadata-evalN/A

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

                              \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{2}\right)} \]
                            23. metadata-evalN/A

                              \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{\color{blue}{2}}\right)} \]
                          4. Applied egg-rr100.0%

                            \[\leadsto \color{blue}{0} \]
                        5. Recombined 2 regimes into one program.
                        6. Final simplification78.4%

                          \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq 0.075:\\ \;\;\;\;\ell \cdot \left(1 - w\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                        7. Add Preprocessing

                        Alternative 17: 70.8% accurate, 44.0× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq 0.14:\\ \;\;\;\;\ell\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                        (FPCore (w l) :precision binary64 (if (<= w 0.14) l 0.0))
                        double code(double w, double l) {
                        	double tmp;
                        	if (w <= 0.14) {
                        		tmp = l;
                        	} else {
                        		tmp = 0.0;
                        	}
                        	return tmp;
                        }
                        
                        real(8) function code(w, l)
                            real(8), intent (in) :: w
                            real(8), intent (in) :: l
                            real(8) :: tmp
                            if (w <= 0.14d0) then
                                tmp = l
                            else
                                tmp = 0.0d0
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double w, double l) {
                        	double tmp;
                        	if (w <= 0.14) {
                        		tmp = l;
                        	} else {
                        		tmp = 0.0;
                        	}
                        	return tmp;
                        }
                        
                        def code(w, l):
                        	tmp = 0
                        	if w <= 0.14:
                        		tmp = l
                        	else:
                        		tmp = 0.0
                        	return tmp
                        
                        function code(w, l)
                        	tmp = 0.0
                        	if (w <= 0.14)
                        		tmp = l;
                        	else
                        		tmp = 0.0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(w, l)
                        	tmp = 0.0;
                        	if (w <= 0.14)
                        		tmp = l;
                        	else
                        		tmp = 0.0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[w_, l_] := If[LessEqual[w, 0.14], l, 0.0]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        \mathbf{if}\;w \leq 0.14:\\
                        \;\;\;\;\ell\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if w < 0.14000000000000001

                          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}{\ell} \]
                          4. Step-by-step derivation
                            1. Simplified63.2%

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

                            if 0.14000000000000001 < w

                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)} \]
                              14. metadata-evalN/A

                                \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)} \]
                              15. flip--N/A

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

                                \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{0} \]
                              17. metadata-evalN/A

                                \[\leadsto \frac{1}{e^{w}} \cdot 1 \]
                              18. associate-/r/N/A

                                \[\leadsto \frac{1}{\color{blue}{\frac{e^{w}}{1}}} \]
                              19. div-invN/A

                                \[\leadsto \frac{1}{e^{w} \cdot \color{blue}{\frac{1}{1}}} \]
                              20. metadata-evalN/A

                                \[\leadsto \frac{1}{e^{w} \cdot 1} \]
                              21. metadata-evalN/A

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

                                \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{2}\right)} \]
                              23. metadata-evalN/A

                                \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{\color{blue}{2}}\right)} \]
                            4. Applied egg-rr100.0%

                              \[\leadsto \color{blue}{0} \]
                          5. Recombined 2 regimes into one program.
                          6. Add Preprocessing

                          Alternative 18: 16.7% accurate, 309.0× speedup?

                          \[\begin{array}{l} \\ 0 \end{array} \]
                          (FPCore (w l) :precision binary64 0.0)
                          double code(double w, double l) {
                          	return 0.0;
                          }
                          
                          real(8) function code(w, l)
                              real(8), intent (in) :: w
                              real(8), intent (in) :: l
                              code = 0.0d0
                          end function
                          
                          public static double code(double w, double l) {
                          	return 0.0;
                          }
                          
                          def code(w, l):
                          	return 0.0
                          
                          function code(w, l)
                          	return 0.0
                          end
                          
                          function tmp = code(w, l)
                          	tmp = 0.0;
                          end
                          
                          code[w_, l_] := 0.0
                          
                          \begin{array}{l}
                          
                          \\
                          0
                          \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. exp-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)} \]
                            14. metadata-evalN/A

                              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)} \]
                            15. flip--N/A

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

                              \[\leadsto \frac{1}{e^{w}} \cdot {\ell}^{0} \]
                            17. metadata-evalN/A

                              \[\leadsto \frac{1}{e^{w}} \cdot 1 \]
                            18. associate-/r/N/A

                              \[\leadsto \frac{1}{\color{blue}{\frac{e^{w}}{1}}} \]
                            19. div-invN/A

                              \[\leadsto \frac{1}{e^{w} \cdot \color{blue}{\frac{1}{1}}} \]
                            20. metadata-evalN/A

                              \[\leadsto \frac{1}{e^{w} \cdot 1} \]
                            21. metadata-evalN/A

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

                              \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{2}\right)} \]
                            23. metadata-evalN/A

                              \[\leadsto \frac{1}{e^{w} \cdot \left(\frac{1}{2} + \frac{1}{\color{blue}{2}}\right)} \]
                          4. Applied egg-rr19.0%

                            \[\leadsto \color{blue}{0} \]
                          5. Add Preprocessing

                          Reproduce

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