exp-w (used to crash)

Percentage Accurate: 99.5% → 99.5%
Time: 20.7s
Alternatives: 11
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 11 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} \\ \frac{{\ell}^{\left(e^{w}\right)}}{e^{w}} \end{array} \]
(FPCore (w l) :precision binary64 (/ (pow l (exp w)) (exp w)))
double code(double w, double l) {
	return pow(l, exp(w)) / exp(w);
}
real(8) function code(w, l)
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    code = (l ** exp(w)) / exp(w)
end function
public static double code(double w, double l) {
	return Math.pow(l, Math.exp(w)) / Math.exp(w);
}
def code(w, l):
	return math.pow(l, math.exp(w)) / math.exp(w)
function code(w, l)
	return Float64((l ^ exp(w)) / exp(w))
end
function tmp = code(w, l)
	tmp = (l ^ exp(w)) / exp(w);
end
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}
\end{array}
Derivation
  1. Initial program 99.9%

    \[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. unsub-negN/A

      \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w} \]
    12. div-expN/A

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

      \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)}\right), \color{blue}{\left(e^{w}\right)}\right) \]
  5. Simplified99.9%

    \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
  6. Add Preprocessing

Alternative 2: 97.9% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -0.68:\\ \;\;\;\;\frac{1}{e^{w}}\\ \mathbf{elif}\;w \leq 2.4:\\ \;\;\;\;\ell\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
(FPCore (w l)
 :precision binary64
 (if (<= w -0.68) (/ 1.0 (exp w)) (if (<= w 2.4) l 0.0)))
double code(double w, double l) {
	double tmp;
	if (w <= -0.68) {
		tmp = 1.0 / exp(w);
	} else if (w <= 2.4) {
		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.68d0)) then
        tmp = 1.0d0 / exp(w)
    else if (w <= 2.4d0) 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.68) {
		tmp = 1.0 / Math.exp(w);
	} else if (w <= 2.4) {
		tmp = l;
	} else {
		tmp = 0.0;
	}
	return tmp;
}
def code(w, l):
	tmp = 0
	if w <= -0.68:
		tmp = 1.0 / math.exp(w)
	elif w <= 2.4:
		tmp = l
	else:
		tmp = 0.0
	return tmp
function code(w, l)
	tmp = 0.0
	if (w <= -0.68)
		tmp = Float64(1.0 / exp(w));
	elseif (w <= 2.4)
		tmp = l;
	else
		tmp = 0.0;
	end
	return tmp
end
function tmp_2 = code(w, l)
	tmp = 0.0;
	if (w <= -0.68)
		tmp = 1.0 / exp(w);
	elseif (w <= 2.4)
		tmp = l;
	else
		tmp = 0.0;
	end
	tmp_2 = tmp;
end
code[w_, l_] := If[LessEqual[w, -0.68], N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], l, 0.0]]
\begin{array}{l}

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

\mathbf{elif}\;w \leq 2.4:\\
\;\;\;\;\ell\\

\mathbf{else}:\\
\;\;\;\;0\\


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

    1. Initial program 100.0%

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{e^{w}}{2}\right)} \cdot \color{blue}{{\ell}^{\left(\frac{e^{w}}{2}\right)}}\right)\right) \]
      2. pow-prod-upN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\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)}\right)\right) \]
      4. +-inversesN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
      5. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 - 0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
      6. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0}{\frac{\color{blue}{e^{w}}}{2} - \frac{e^{w}}{2}}\right)}\right)\right) \]
      7. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{\frac{e^{w}}{\color{blue}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
      8. +-inversesN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)}\right)\right) \]
      9. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)}\right)\right) \]
      10. flip--N/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(0 - \color{blue}{0}\right)}\right)\right) \]
      11. metadata-evalN/A

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{0}\right)\right) \]
      12. metadata-eval99.1%

        \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), 1\right) \]
    4. Applied egg-rr99.1%

      \[\leadsto e^{-w} \cdot \color{blue}{1} \]
    5. Step-by-step derivation
      1. *-rgt-identityN/A

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

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

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

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

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

    if -0.680000000000000049 < w < 2.39999999999999991

    1. Initial program 99.8%

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

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

      if 2.39999999999999991 < 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. Add Preprocessing

    Alternative 3: 97.8% accurate, 3.0× 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.9%

      \[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. unsub-negN/A

        \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w} \]
      12. div-expN/A

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

        \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)}\right), \color{blue}{\left(e^{w}\right)}\right) \]
    5. Simplified99.9%

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

      \[\leadsto \mathsf{/.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right) \]
    7. Step-by-step derivation
      1. Simplified98.3%

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

      Alternative 4: 94.2% accurate, 6.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := w \cdot \left(w \cdot w\right)\\ \mathbf{if}\;w \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;w \leq -0.7:\\ \;\;\;\;1 + \frac{\frac{w \cdot \left(1 + -0.015625 \cdot \left(t\_0 \cdot t\_0\right)\right)}{-1 + t\_0 \cdot -0.125}}{1 + \left(w \cdot 0.5\right) \cdot \left(w \cdot 0.5 - -1\right)}\\ \mathbf{elif}\;w \leq 2.4:\\ \;\;\;\;\ell\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
      (FPCore (w l)
       :precision binary64
       (let* ((t_0 (* w (* w w))))
         (if (<= w -5.6e+102)
           (+ 1.0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666))))))
           (if (<= w -0.7)
             (+
              1.0
              (/
               (/ (* w (+ 1.0 (* -0.015625 (* t_0 t_0)))) (+ -1.0 (* t_0 -0.125)))
               (+ 1.0 (* (* w 0.5) (- (* w 0.5) -1.0)))))
             (if (<= w 2.4) l 0.0)))))
      double code(double w, double l) {
      	double t_0 = w * (w * w);
      	double tmp;
      	if (w <= -5.6e+102) {
      		tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
      	} else if (w <= -0.7) {
      		tmp = 1.0 + (((w * (1.0 + (-0.015625 * (t_0 * t_0)))) / (-1.0 + (t_0 * -0.125))) / (1.0 + ((w * 0.5) * ((w * 0.5) - -1.0))));
      	} else if (w <= 2.4) {
      		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) :: t_0
          real(8) :: tmp
          t_0 = w * (w * w)
          if (w <= (-5.6d+102)) then
              tmp = 1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0))))))
          else if (w <= (-0.7d0)) then
              tmp = 1.0d0 + (((w * (1.0d0 + ((-0.015625d0) * (t_0 * t_0)))) / ((-1.0d0) + (t_0 * (-0.125d0)))) / (1.0d0 + ((w * 0.5d0) * ((w * 0.5d0) - (-1.0d0)))))
          else if (w <= 2.4d0) then
              tmp = l
          else
              tmp = 0.0d0
          end if
          code = tmp
      end function
      
      public static double code(double w, double l) {
      	double t_0 = w * (w * w);
      	double tmp;
      	if (w <= -5.6e+102) {
      		tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
      	} else if (w <= -0.7) {
      		tmp = 1.0 + (((w * (1.0 + (-0.015625 * (t_0 * t_0)))) / (-1.0 + (t_0 * -0.125))) / (1.0 + ((w * 0.5) * ((w * 0.5) - -1.0))));
      	} else if (w <= 2.4) {
      		tmp = l;
      	} else {
      		tmp = 0.0;
      	}
      	return tmp;
      }
      
      def code(w, l):
      	t_0 = w * (w * w)
      	tmp = 0
      	if w <= -5.6e+102:
      		tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))))
      	elif w <= -0.7:
      		tmp = 1.0 + (((w * (1.0 + (-0.015625 * (t_0 * t_0)))) / (-1.0 + (t_0 * -0.125))) / (1.0 + ((w * 0.5) * ((w * 0.5) - -1.0))))
      	elif w <= 2.4:
      		tmp = l
      	else:
      		tmp = 0.0
      	return tmp
      
      function code(w, l)
      	t_0 = Float64(w * Float64(w * w))
      	tmp = 0.0
      	if (w <= -5.6e+102)
      		tmp = Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))))));
      	elseif (w <= -0.7)
      		tmp = Float64(1.0 + Float64(Float64(Float64(w * Float64(1.0 + Float64(-0.015625 * Float64(t_0 * t_0)))) / Float64(-1.0 + Float64(t_0 * -0.125))) / Float64(1.0 + Float64(Float64(w * 0.5) * Float64(Float64(w * 0.5) - -1.0)))));
      	elseif (w <= 2.4)
      		tmp = l;
      	else
      		tmp = 0.0;
      	end
      	return tmp
      end
      
      function tmp_2 = code(w, l)
      	t_0 = w * (w * w);
      	tmp = 0.0;
      	if (w <= -5.6e+102)
      		tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
      	elseif (w <= -0.7)
      		tmp = 1.0 + (((w * (1.0 + (-0.015625 * (t_0 * t_0)))) / (-1.0 + (t_0 * -0.125))) / (1.0 + ((w * 0.5) * ((w * 0.5) - -1.0))));
      	elseif (w <= 2.4)
      		tmp = l;
      	else
      		tmp = 0.0;
      	end
      	tmp_2 = tmp;
      end
      
      code[w_, l_] := Block[{t$95$0 = N[(w * N[(w * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -5.6e+102], N[(1.0 + N[(w * N[(-1.0 + N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, -0.7], N[(1.0 + N[(N[(N[(w * N[(1.0 + N[(-0.015625 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + N[(t$95$0 * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(w * 0.5), $MachinePrecision] * N[(N[(w * 0.5), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], l, 0.0]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := w \cdot \left(w \cdot w\right)\\
      \mathbf{if}\;w \leq -5.6 \cdot 10^{+102}:\\
      \;\;\;\;1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\
      
      \mathbf{elif}\;w \leq -0.7:\\
      \;\;\;\;1 + \frac{\frac{w \cdot \left(1 + -0.015625 \cdot \left(t\_0 \cdot t\_0\right)\right)}{-1 + t\_0 \cdot -0.125}}{1 + \left(w \cdot 0.5\right) \cdot \left(w \cdot 0.5 - -1\right)}\\
      
      \mathbf{elif}\;w \leq 2.4:\\
      \;\;\;\;\ell\\
      
      \mathbf{else}:\\
      \;\;\;\;0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if w < -5.60000000000000037e102

        1. Initial program 100.0%

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{e^{w}}{2}\right)} \cdot \color{blue}{{\ell}^{\left(\frac{e^{w}}{2}\right)}}\right)\right) \]
          2. pow-prod-upN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\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)}\right)\right) \]
          4. +-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 - 0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0}{\frac{\color{blue}{e^{w}}}{2} - \frac{e^{w}}{2}}\right)}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{\frac{e^{w}}{\color{blue}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
          8. +-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)}\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)}\right)\right) \]
          10. flip--N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(0 - \color{blue}{0}\right)}\right)\right) \]
          11. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{0}\right)\right) \]
          12. metadata-eval100.0%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), 1\right) \]
        4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -5.60000000000000037e102 < w < -0.69999999999999996

        1. Initial program 100.0%

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{e^{w}}{2}\right)} \cdot \color{blue}{{\ell}^{\left(\frac{e^{w}}{2}\right)}}\right)\right) \]
          2. pow-prod-upN/A

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

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\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)}\right)\right) \]
          4. +-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
          5. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 - 0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
          6. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0}{\frac{\color{blue}{e^{w}}}{2} - \frac{e^{w}}{2}}\right)}\right)\right) \]
          7. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{\frac{e^{w}}{\color{blue}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
          8. +-inversesN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)}\right)\right) \]
          9. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)}\right)\right) \]
          10. flip--N/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(0 - \color{blue}{0}\right)}\right)\right) \]
          11. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{0}\right)\right) \]
          12. metadata-eval97.6%

            \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), 1\right) \]
        4. Applied egg-rr97.6%

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(-1, \left(w \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
          8. *-lowering-*.f644.4%

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(w, \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
        7. Simplified4.4%

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

            \[\leadsto \mathsf{+.f64}\left(1, \left(\left(-1 + w \cdot \frac{1}{2}\right) \cdot \color{blue}{w}\right)\right) \]
          2. flip3-+N/A

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

            \[\leadsto \mathsf{+.f64}\left(1, \left(\frac{\left({-1}^{3} + {\left(w \cdot \frac{1}{2}\right)}^{3}\right) \cdot w}{\color{blue}{-1 \cdot -1 + \left(\left(w \cdot \frac{1}{2}\right) \cdot \left(w \cdot \frac{1}{2}\right) - -1 \cdot \left(w \cdot \frac{1}{2}\right)\right)}}\right)\right) \]
          4. /-lowering-/.f64N/A

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\left({-1}^{3} + {\left(w \cdot \frac{1}{2}\right)}^{3}\right), w\right), \left(\color{blue}{-1 \cdot -1} + \left(\left(w \cdot \frac{1}{2}\right) \cdot \left(w \cdot \frac{1}{2}\right) - -1 \cdot \left(w \cdot \frac{1}{2}\right)\right)\right)\right)\right) \]
          6. metadata-evalN/A

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

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{1}{8}, \left({w}^{3}\right)\right)\right), w\right), \left(-1 \cdot -1 + \left(\left(w \cdot \frac{1}{2}\right) \cdot \left(w \cdot \frac{1}{2}\right) - -1 \cdot \left(w \cdot \frac{1}{2}\right)\right)\right)\right)\right) \]
          12. cube-multN/A

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

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

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

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{1}{8}, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, w\right)\right)\right)\right), w\right), \mathsf{+.f64}\left(1, \color{blue}{\left(\left(w \cdot \frac{1}{2}\right) \cdot \left(w \cdot \frac{1}{2}\right) - -1 \cdot \left(w \cdot \frac{1}{2}\right)\right)}\right)\right)\right) \]
          17. distribute-rgt-out--N/A

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(\frac{1}{8}, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, w\right)\right)\right)\right), w\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\left(w \cdot \frac{1}{2}\right), \color{blue}{\left(w \cdot \frac{1}{2} - -1\right)}\right)\right)\right)\right) \]
        9. Applied egg-rr25.8%

          \[\leadsto 1 + \color{blue}{\frac{\left(-1 + 0.125 \cdot \left(w \cdot \left(w \cdot w\right)\right)\right) \cdot w}{1 + \left(w \cdot 0.5\right) \cdot \left(w \cdot 0.5 - -1\right)}} \]
        10. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\left(\frac{-1 \cdot -1 - \left(\frac{1}{8} \cdot \left(w \cdot \left(w \cdot w\right)\right)\right) \cdot \left(\frac{1}{8} \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)}{-1 - \frac{1}{8} \cdot \left(w \cdot \left(w \cdot w\right)\right)} \cdot w\right), \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{2}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{2}\right), -1\right)\right)\right)\right)\right) \]
          2. associate-*l/N/A

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

            \[\leadsto \mathsf{+.f64}\left(1, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\left(-1 \cdot -1 - \left(\frac{1}{8} \cdot \left(w \cdot \left(w \cdot w\right)\right)\right) \cdot \left(\frac{1}{8} \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\right) \cdot w\right), \left(-1 - \frac{1}{8} \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\right), \mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{2}\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(w, \frac{1}{2}\right), -1\right)\right)\right)\right)\right) \]
        11. Applied egg-rr53.6%

          \[\leadsto 1 + \frac{\color{blue}{\frac{\left(1 + -0.015625 \cdot \left(\left(w \cdot \left(w \cdot w\right)\right) \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\right) \cdot w}{-1 + \left(w \cdot \left(w \cdot w\right)\right) \cdot -0.125}}}{1 + \left(w \cdot 0.5\right) \cdot \left(w \cdot 0.5 - -1\right)} \]

        if -0.69999999999999996 < w < 2.39999999999999991

        1. Initial program 99.8%

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

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

          if 2.39999999999999991 < 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 4 regimes into one program.
        6. Final simplification93.0%

          \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -5.6 \cdot 10^{+102}:\\ \;\;\;\;1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;w \leq -0.7:\\ \;\;\;\;1 + \frac{\frac{w \cdot \left(1 + -0.015625 \cdot \left(\left(w \cdot \left(w \cdot w\right)\right) \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\right)}{-1 + \left(w \cdot \left(w \cdot w\right)\right) \cdot -0.125}}{1 + \left(w \cdot 0.5\right) \cdot \left(w \cdot 0.5 - -1\right)}\\ \mathbf{elif}\;w \leq 2.4:\\ \;\;\;\;\ell\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
        7. Add Preprocessing

        Alternative 5: 89.1% accurate, 13.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq 0.13:\\ \;\;\;\;\ell + w \cdot \left(w \cdot \left(\ell \cdot 0.5 - \left(\ell \cdot w\right) \cdot 0.16666666666666666\right) - \ell\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
        (FPCore (w l)
         :precision binary64
         (if (<= w 0.13)
           (+ l (* w (- (* w (- (* l 0.5) (* (* l w) 0.16666666666666666))) l)))
           0.0))
        double code(double w, double l) {
        	double tmp;
        	if (w <= 0.13) {
        		tmp = l + (w * ((w * ((l * 0.5) - ((l * w) * 0.16666666666666666))) - 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.13d0) then
                tmp = l + (w * ((w * ((l * 0.5d0) - ((l * w) * 0.16666666666666666d0))) - l))
            else
                tmp = 0.0d0
            end if
            code = tmp
        end function
        
        public static double code(double w, double l) {
        	double tmp;
        	if (w <= 0.13) {
        		tmp = l + (w * ((w * ((l * 0.5) - ((l * w) * 0.16666666666666666))) - l));
        	} else {
        		tmp = 0.0;
        	}
        	return tmp;
        }
        
        def code(w, l):
        	tmp = 0
        	if w <= 0.13:
        		tmp = l + (w * ((w * ((l * 0.5) - ((l * w) * 0.16666666666666666))) - l))
        	else:
        		tmp = 0.0
        	return tmp
        
        function code(w, l)
        	tmp = 0.0
        	if (w <= 0.13)
        		tmp = Float64(l + Float64(w * Float64(Float64(w * Float64(Float64(l * 0.5) - Float64(Float64(l * w) * 0.16666666666666666))) - l)));
        	else
        		tmp = 0.0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(w, l)
        	tmp = 0.0;
        	if (w <= 0.13)
        		tmp = l + (w * ((w * ((l * 0.5) - ((l * w) * 0.16666666666666666))) - l));
        	else
        		tmp = 0.0;
        	end
        	tmp_2 = tmp;
        end
        
        code[w_, l_] := If[LessEqual[w, 0.13], N[(l + N[(w * N[(N[(w * N[(N[(l * 0.5), $MachinePrecision] - N[(N[(l * w), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;w \leq 0.13:\\
        \;\;\;\;\ell + w \cdot \left(w \cdot \left(\ell \cdot 0.5 - \left(\ell \cdot w\right) \cdot 0.16666666666666666\right) - \ell\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if w < 0.13

          1. Initial program 99.9%

            \[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. unsub-negN/A

              \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w} \]
            12. div-expN/A

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

              \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)}\right), \color{blue}{\left(e^{w}\right)}\right) \]
          5. Simplified99.9%

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

            \[\leadsto \mathsf{/.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right) \]
          7. Step-by-step derivation
            1. Simplified98.3%

              \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
            2. 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)} \]
            3. Simplified86.6%

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

            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-rr97.9%

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

          Alternative 6: 90.8% accurate, 14.5× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -3 \cdot 10^{+97}:\\ \;\;\;\;1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\ \mathbf{elif}\;w \leq 2.4:\\ \;\;\;\;\ell + w \cdot \left(\ell \cdot \left(-1 + w \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
          (FPCore (w l)
           :precision binary64
           (if (<= w -3e+97)
             (+ 1.0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666))))))
             (if (<= w 2.4) (+ l (* w (* l (+ -1.0 (* w 0.5))))) 0.0)))
          double code(double w, double l) {
          	double tmp;
          	if (w <= -3e+97) {
          		tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
          	} else if (w <= 2.4) {
          		tmp = l + (w * (l * (-1.0 + (w * 0.5))));
          	} 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 <= (-3d+97)) then
                  tmp = 1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0))))))
              else if (w <= 2.4d0) then
                  tmp = l + (w * (l * ((-1.0d0) + (w * 0.5d0))))
              else
                  tmp = 0.0d0
              end if
              code = tmp
          end function
          
          public static double code(double w, double l) {
          	double tmp;
          	if (w <= -3e+97) {
          		tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
          	} else if (w <= 2.4) {
          		tmp = l + (w * (l * (-1.0 + (w * 0.5))));
          	} else {
          		tmp = 0.0;
          	}
          	return tmp;
          }
          
          def code(w, l):
          	tmp = 0
          	if w <= -3e+97:
          		tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))))
          	elif w <= 2.4:
          		tmp = l + (w * (l * (-1.0 + (w * 0.5))))
          	else:
          		tmp = 0.0
          	return tmp
          
          function code(w, l)
          	tmp = 0.0
          	if (w <= -3e+97)
          		tmp = Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))))));
          	elseif (w <= 2.4)
          		tmp = Float64(l + Float64(w * Float64(l * Float64(-1.0 + Float64(w * 0.5)))));
          	else
          		tmp = 0.0;
          	end
          	return tmp
          end
          
          function tmp_2 = code(w, l)
          	tmp = 0.0;
          	if (w <= -3e+97)
          		tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
          	elseif (w <= 2.4)
          		tmp = l + (w * (l * (-1.0 + (w * 0.5))));
          	else
          		tmp = 0.0;
          	end
          	tmp_2 = tmp;
          end
          
          code[w_, l_] := If[LessEqual[w, -3e+97], N[(1.0 + N[(w * N[(-1.0 + N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], N[(l + N[(w * N[(l * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;w \leq -3 \cdot 10^{+97}:\\
          \;\;\;\;1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\
          
          \mathbf{elif}\;w \leq 2.4:\\
          \;\;\;\;\ell + w \cdot \left(\ell \cdot \left(-1 + w \cdot 0.5\right)\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;0\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if w < -2.9999999999999998e97

            1. Initial program 100.0%

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{e^{w}}{2}\right)} \cdot \color{blue}{{\ell}^{\left(\frac{e^{w}}{2}\right)}}\right)\right) \]
              2. pow-prod-upN/A

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

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\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)}\right)\right) \]
              4. +-inversesN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
              5. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 - 0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
              6. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0}{\frac{\color{blue}{e^{w}}}{2} - \frac{e^{w}}{2}}\right)}\right)\right) \]
              7. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{\frac{e^{w}}{\color{blue}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
              8. +-inversesN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)}\right)\right) \]
              9. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)}\right)\right) \]
              10. flip--N/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(0 - \color{blue}{0}\right)}\right)\right) \]
              11. metadata-evalN/A

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{0}\right)\right) \]
              12. metadata-eval100.0%

                \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), 1\right) \]
            4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(\frac{1}{2}, \left(w \cdot \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right)\right) \]
              10. *-lowering-*.f6496.5%

                \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(w, \color{blue}{\frac{-1}{6}}\right)\right)\right)\right)\right)\right) \]
            7. Simplified96.5%

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

            if -2.9999999999999998e97 < w < 2.39999999999999991

            1. Initial program 99.8%

              \[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. unsub-negN/A

                \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w} \]
              12. div-expN/A

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

                \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)}\right), \color{blue}{\left(e^{w}\right)}\right) \]
            5. Simplified99.8%

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

              \[\leadsto \mathsf{/.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right) \]
            7. Step-by-step derivation
              1. Simplified97.2%

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

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \left(\left(\mathsf{neg}\left(w \cdot \left(-1 \cdot \ell + \frac{1}{2} \cdot \ell\right)\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right)\right) \]
                5. distribute-rgt-neg-inN/A

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \left(w \cdot \left(\mathsf{neg}\left(\frac{-1}{2} \cdot \ell\right)\right) + \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
                9. distribute-lft-neg-inN/A

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

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

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

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

                  \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \left(\left(\frac{1}{2} \cdot w\right) \cdot \ell + -1 \cdot \color{blue}{\ell}\right)\right)\right) \]
                14. distribute-rgt-outN/A

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

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

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

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

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

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

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

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

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

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

              if 2.39999999999999991 < 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} \]
            8. Recombined 3 regimes into one program.
            9. Add Preprocessing

            Alternative 7: 88.0% accurate, 14.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -1.9 \cdot 10^{+154}:\\ \;\;\;\;w \cdot \left(w \cdot 0.5\right)\\ \mathbf{elif}\;w \leq 2.4:\\ \;\;\;\;\ell + w \cdot \left(\ell \cdot \left(-1 + w \cdot 0.5\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
            (FPCore (w l)
             :precision binary64
             (if (<= w -1.9e+154)
               (* w (* w 0.5))
               (if (<= w 2.4) (+ l (* w (* l (+ -1.0 (* w 0.5))))) 0.0)))
            double code(double w, double l) {
            	double tmp;
            	if (w <= -1.9e+154) {
            		tmp = w * (w * 0.5);
            	} else if (w <= 2.4) {
            		tmp = l + (w * (l * (-1.0 + (w * 0.5))));
            	} 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 <= (-1.9d+154)) then
                    tmp = w * (w * 0.5d0)
                else if (w <= 2.4d0) then
                    tmp = l + (w * (l * ((-1.0d0) + (w * 0.5d0))))
                else
                    tmp = 0.0d0
                end if
                code = tmp
            end function
            
            public static double code(double w, double l) {
            	double tmp;
            	if (w <= -1.9e+154) {
            		tmp = w * (w * 0.5);
            	} else if (w <= 2.4) {
            		tmp = l + (w * (l * (-1.0 + (w * 0.5))));
            	} else {
            		tmp = 0.0;
            	}
            	return tmp;
            }
            
            def code(w, l):
            	tmp = 0
            	if w <= -1.9e+154:
            		tmp = w * (w * 0.5)
            	elif w <= 2.4:
            		tmp = l + (w * (l * (-1.0 + (w * 0.5))))
            	else:
            		tmp = 0.0
            	return tmp
            
            function code(w, l)
            	tmp = 0.0
            	if (w <= -1.9e+154)
            		tmp = Float64(w * Float64(w * 0.5));
            	elseif (w <= 2.4)
            		tmp = Float64(l + Float64(w * Float64(l * Float64(-1.0 + Float64(w * 0.5)))));
            	else
            		tmp = 0.0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(w, l)
            	tmp = 0.0;
            	if (w <= -1.9e+154)
            		tmp = w * (w * 0.5);
            	elseif (w <= 2.4)
            		tmp = l + (w * (l * (-1.0 + (w * 0.5))));
            	else
            		tmp = 0.0;
            	end
            	tmp_2 = tmp;
            end
            
            code[w_, l_] := If[LessEqual[w, -1.9e+154], N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], N[(l + N[(w * N[(l * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;w \leq -1.9 \cdot 10^{+154}:\\
            \;\;\;\;w \cdot \left(w \cdot 0.5\right)\\
            
            \mathbf{elif}\;w \leq 2.4:\\
            \;\;\;\;\ell + w \cdot \left(\ell \cdot \left(-1 + w \cdot 0.5\right)\right)\\
            
            \mathbf{else}:\\
            \;\;\;\;0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if w < -1.8999999999999999e154

              1. Initial program 100.0%

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{e^{w}}{2}\right)} \cdot \color{blue}{{\ell}^{\left(\frac{e^{w}}{2}\right)}}\right)\right) \]
                2. pow-prod-upN/A

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\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)}\right)\right) \]
                4. +-inversesN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                5. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 - 0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                6. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0}{\frac{\color{blue}{e^{w}}}{2} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                7. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{\frac{e^{w}}{\color{blue}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                8. +-inversesN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)}\right)\right) \]
                9. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)}\right)\right) \]
                10. flip--N/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(0 - \color{blue}{0}\right)}\right)\right) \]
                11. metadata-evalN/A

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{0}\right)\right) \]
                12. metadata-eval100.0%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), 1\right) \]
              4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \color{blue}{1 + w \cdot \left(-1 + w \cdot 0.5\right)} \]
              8. Taylor expanded in w around inf

                \[\leadsto \color{blue}{\frac{1}{2} \cdot {w}^{2}} \]
              9. Step-by-step derivation
                1. unpow2N/A

                  \[\leadsto \frac{1}{2} \cdot \left(w \cdot \color{blue}{w}\right) \]
                2. associate-*r*N/A

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, \color{blue}{\frac{1}{2}}\right)\right) \]
              10. Simplified100.0%

                \[\leadsto \color{blue}{w \cdot \left(w \cdot 0.5\right)} \]

              if -1.8999999999999999e154 < w < 2.39999999999999991

              1. Initial program 99.8%

                \[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. unsub-negN/A

                  \[\leadsto e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right) - w} \]
                12. div-expN/A

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

                  \[\leadsto \mathsf{/.f64}\left(\left(e^{-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)}\right), \color{blue}{\left(e^{w}\right)}\right) \]
              5. Simplified99.8%

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \left(\left(\mathsf{neg}\left(w \cdot \left(-1 \cdot \ell + \frac{1}{2} \cdot \ell\right)\right)\right) + \left(\mathsf{neg}\left(\color{blue}{\ell}\right)\right)\right)\right)\right) \]
                  5. distribute-rgt-neg-inN/A

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \left(w \cdot \left(\mathsf{neg}\left(\frac{-1}{2} \cdot \ell\right)\right) + \left(\mathsf{neg}\left(\ell\right)\right)\right)\right)\right) \]
                  9. distribute-lft-neg-inN/A

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \left(\left(\frac{1}{2} \cdot w\right) \cdot \ell + -1 \cdot \color{blue}{\ell}\right)\right)\right) \]
                  14. distribute-rgt-outN/A

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(\ell, \mathsf{+.f64}\left(-1, \left(w \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
                4. Simplified81.4%

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

                if 2.39999999999999991 < 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} \]
              8. Recombined 3 regimes into one program.
              9. Add Preprocessing

              Alternative 8: 86.2% accurate, 20.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -1.8 \cdot 10^{+142}:\\ \;\;\;\;w \cdot \left(w \cdot 0.5\right)\\ \mathbf{elif}\;w \leq 0.19:\\ \;\;\;\;\ell \cdot \left(1 - w\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
              (FPCore (w l)
               :precision binary64
               (if (<= w -1.8e+142) (* w (* w 0.5)) (if (<= w 0.19) (* l (- 1.0 w)) 0.0)))
              double code(double w, double l) {
              	double tmp;
              	if (w <= -1.8e+142) {
              		tmp = w * (w * 0.5);
              	} else if (w <= 0.19) {
              		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 <= (-1.8d+142)) then
                      tmp = w * (w * 0.5d0)
                  else if (w <= 0.19d0) 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 <= -1.8e+142) {
              		tmp = w * (w * 0.5);
              	} else if (w <= 0.19) {
              		tmp = l * (1.0 - w);
              	} else {
              		tmp = 0.0;
              	}
              	return tmp;
              }
              
              def code(w, l):
              	tmp = 0
              	if w <= -1.8e+142:
              		tmp = w * (w * 0.5)
              	elif w <= 0.19:
              		tmp = l * (1.0 - w)
              	else:
              		tmp = 0.0
              	return tmp
              
              function code(w, l)
              	tmp = 0.0
              	if (w <= -1.8e+142)
              		tmp = Float64(w * Float64(w * 0.5));
              	elseif (w <= 0.19)
              		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 <= -1.8e+142)
              		tmp = w * (w * 0.5);
              	elseif (w <= 0.19)
              		tmp = l * (1.0 - w);
              	else
              		tmp = 0.0;
              	end
              	tmp_2 = tmp;
              end
              
              code[w_, l_] := If[LessEqual[w, -1.8e+142], N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.19], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;w \leq -1.8 \cdot 10^{+142}:\\
              \;\;\;\;w \cdot \left(w \cdot 0.5\right)\\
              
              \mathbf{elif}\;w \leq 0.19:\\
              \;\;\;\;\ell \cdot \left(1 - w\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if w < -1.8000000000000001e142

                1. Initial program 100.0%

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{e^{w}}{2}\right)} \cdot \color{blue}{{\ell}^{\left(\frac{e^{w}}{2}\right)}}\right)\right) \]
                  2. pow-prod-upN/A

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\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)}\right)\right) \]
                  4. +-inversesN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                  5. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 - 0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                  6. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0}{\frac{\color{blue}{e^{w}}}{2} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                  7. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{\frac{e^{w}}{\color{blue}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                  8. +-inversesN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)}\right)\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)}\right)\right) \]
                  10. flip--N/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(0 - \color{blue}{0}\right)}\right)\right) \]
                  11. metadata-evalN/A

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{0}\right)\right) \]
                  12. metadata-eval100.0%

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), 1\right) \]
                4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(-1, \left(w \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                  8. *-lowering-*.f6497.7%

                    \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(w, \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                7. Simplified97.7%

                  \[\leadsto \color{blue}{1 + w \cdot \left(-1 + w \cdot 0.5\right)} \]
                8. Taylor expanded in w around inf

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot {w}^{2}} \]
                9. Step-by-step derivation
                  1. unpow2N/A

                    \[\leadsto \frac{1}{2} \cdot \left(w \cdot \color{blue}{w}\right) \]
                  2. associate-*r*N/A

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(w, \left(w \cdot \color{blue}{\frac{1}{2}}\right)\right) \]
                  6. *-lowering-*.f6497.7%

                    \[\leadsto \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, \color{blue}{\frac{1}{2}}\right)\right) \]
                10. Simplified97.7%

                  \[\leadsto \color{blue}{w \cdot \left(w \cdot 0.5\right)} \]

                if -1.8000000000000001e142 < w < 0.19

                1. Initial program 99.8%

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

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

                  \[\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), \color{blue}{\ell}\right) \]
                7. Step-by-step derivation
                  1. Simplified79.3%

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

                  if 0.19 < 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-rr97.9%

                    \[\leadsto \color{blue}{0} \]
                8. Recombined 3 regimes into one program.
                9. Final simplification85.5%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -1.8 \cdot 10^{+142}:\\ \;\;\;\;w \cdot \left(w \cdot 0.5\right)\\ \mathbf{elif}\;w \leq 0.19:\\ \;\;\;\;\ell \cdot \left(1 - w\right)\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                10. Add Preprocessing

                Alternative 9: 84.9% accurate, 27.6× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -3.5 \cdot 10^{+65}:\\ \;\;\;\;w \cdot \left(w \cdot 0.5\right)\\ \mathbf{elif}\;w \leq 2.4:\\ \;\;\;\;\ell\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                (FPCore (w l)
                 :precision binary64
                 (if (<= w -3.5e+65) (* w (* w 0.5)) (if (<= w 2.4) l 0.0)))
                double code(double w, double l) {
                	double tmp;
                	if (w <= -3.5e+65) {
                		tmp = w * (w * 0.5);
                	} else if (w <= 2.4) {
                		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 <= (-3.5d+65)) then
                        tmp = w * (w * 0.5d0)
                    else if (w <= 2.4d0) 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 <= -3.5e+65) {
                		tmp = w * (w * 0.5);
                	} else if (w <= 2.4) {
                		tmp = l;
                	} else {
                		tmp = 0.0;
                	}
                	return tmp;
                }
                
                def code(w, l):
                	tmp = 0
                	if w <= -3.5e+65:
                		tmp = w * (w * 0.5)
                	elif w <= 2.4:
                		tmp = l
                	else:
                		tmp = 0.0
                	return tmp
                
                function code(w, l)
                	tmp = 0.0
                	if (w <= -3.5e+65)
                		tmp = Float64(w * Float64(w * 0.5));
                	elseif (w <= 2.4)
                		tmp = l;
                	else
                		tmp = 0.0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(w, l)
                	tmp = 0.0;
                	if (w <= -3.5e+65)
                		tmp = w * (w * 0.5);
                	elseif (w <= 2.4)
                		tmp = l;
                	else
                		tmp = 0.0;
                	end
                	tmp_2 = tmp;
                end
                
                code[w_, l_] := If[LessEqual[w, -3.5e+65], N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], l, 0.0]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                \mathbf{if}\;w \leq -3.5 \cdot 10^{+65}:\\
                \;\;\;\;w \cdot \left(w \cdot 0.5\right)\\
                
                \mathbf{elif}\;w \leq 2.4:\\
                \;\;\;\;\ell\\
                
                \mathbf{else}:\\
                \;\;\;\;0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if w < -3.5000000000000001e65

                  1. Initial program 100.0%

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{e^{w}}{2}\right)} \cdot \color{blue}{{\ell}^{\left(\frac{e^{w}}{2}\right)}}\right)\right) \]
                    2. pow-prod-upN/A

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\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)}\right)\right) \]
                    4. +-inversesN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                    5. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 - 0}{\color{blue}{\frac{e^{w}}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                    6. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0}{\frac{\color{blue}{e^{w}}}{2} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                    7. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{\frac{e^{w}}{\color{blue}{2}} - \frac{e^{w}}{2}}\right)}\right)\right) \]
                    8. +-inversesN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0}\right)}\right)\right) \]
                    9. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(\frac{0 \cdot 0 - 0 \cdot 0}{0 + \color{blue}{0}}\right)}\right)\right) \]
                    10. flip--N/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{\left(0 - \color{blue}{0}\right)}\right)\right) \]
                    11. metadata-evalN/A

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \left({\ell}^{0}\right)\right) \]
                    12. metadata-eval100.0%

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), 1\right) \]
                  4. Applied egg-rr100.0%

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(-1, \left(w \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                    8. *-lowering-*.f6467.1%

                      \[\leadsto \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(-1, \mathsf{*.f64}\left(w, \color{blue}{\frac{1}{2}}\right)\right)\right)\right) \]
                  7. Simplified67.1%

                    \[\leadsto \color{blue}{1 + w \cdot \left(-1 + w \cdot 0.5\right)} \]
                  8. Taylor expanded in w around inf

                    \[\leadsto \color{blue}{\frac{1}{2} \cdot {w}^{2}} \]
                  9. Step-by-step derivation
                    1. unpow2N/A

                      \[\leadsto \frac{1}{2} \cdot \left(w \cdot \color{blue}{w}\right) \]
                    2. associate-*r*N/A

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(w, \color{blue}{\frac{1}{2}}\right)\right) \]
                  10. Simplified67.1%

                    \[\leadsto \color{blue}{w \cdot \left(w \cdot 0.5\right)} \]

                  if -3.5000000000000001e65 < w < 2.39999999999999991

                  1. Initial program 99.8%

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

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

                    if 2.39999999999999991 < 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. Add Preprocessing

                  Alternative 10: 70.9% accurate, 50.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq 2.4:\\ \;\;\;\;\ell\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \end{array} \]
                  (FPCore (w l) :precision binary64 (if (<= w 2.4) l 0.0))
                  double code(double w, double l) {
                  	double tmp;
                  	if (w <= 2.4) {
                  		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 <= 2.4d0) 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 <= 2.4) {
                  		tmp = l;
                  	} else {
                  		tmp = 0.0;
                  	}
                  	return tmp;
                  }
                  
                  def code(w, l):
                  	tmp = 0
                  	if w <= 2.4:
                  		tmp = l
                  	else:
                  		tmp = 0.0
                  	return tmp
                  
                  function code(w, l)
                  	tmp = 0.0
                  	if (w <= 2.4)
                  		tmp = l;
                  	else
                  		tmp = 0.0;
                  	end
                  	return tmp
                  end
                  
                  function tmp_2 = code(w, l)
                  	tmp = 0.0;
                  	if (w <= 2.4)
                  		tmp = l;
                  	else
                  		tmp = 0.0;
                  	end
                  	tmp_2 = tmp;
                  end
                  
                  code[w_, l_] := If[LessEqual[w, 2.4], l, 0.0]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;w \leq 2.4:\\
                  \;\;\;\;\ell\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if w < 2.39999999999999991

                    1. Initial program 99.9%

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

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

                      if 2.39999999999999991 < 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 11: 16.7% accurate, 305.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.9%

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

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

                    Reproduce

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