exp-w (used to crash)

Percentage Accurate: 99.4% → 99.4%
Time: 15.8s
Alternatives: 17
Speedup: 1.4×

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

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

Initial Program: 99.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \end{array} \]
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
	return exp(-w) * pow(l, exp(w));
}
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.4% accurate, 1.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sqr-powN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\ell}^{\left(\frac{\frac{e^{w}}{2} \cdot \frac{e^{w}}{2} - \frac{e^{w}}{2} \cdot \frac{e^{w}}{2}}{\frac{e^{w}}{2} - \frac{e^{w}}{2}}\right)}\right), \mathsf{exp.f64}\left(w\right)\right) \]
      4. +-inversesN/A

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

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

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

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

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

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

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

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

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

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

    if -1.6000000000000001 < w

    1. Initial program 99.1%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
    3. Simplified99.1%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \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)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \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)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \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)\right) \]
      7. *-lowering-*.f6499.4%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \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)\right) \]
    7. Simplified99.4%

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

Alternative 2: 99.4% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
  3. Simplified99.3%

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

Alternative 4: 99.3% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sqr-powN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\ell}^{\left(\frac{\frac{e^{w}}{2} \cdot \frac{e^{w}}{2} - \frac{e^{w}}{2} \cdot \frac{e^{w}}{2}}{\frac{e^{w}}{2} - \frac{e^{w}}{2}}\right)}\right), \mathsf{exp.f64}\left(w\right)\right) \]
      4. +-inversesN/A

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

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

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

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

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

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

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

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

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

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

    if -3.89999999999999991 < w

    1. Initial program 99.1%

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{exp.f64}\left(w\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
    5. Simplified99.1%

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \frac{1}{2}\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
    8. Simplified99.2%

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

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

Alternative 5: 99.1% accurate, 1.4× speedup?

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

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

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sqr-powN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\ell}^{\left(\frac{\frac{e^{w}}{2} \cdot \frac{e^{w}}{2} - \frac{e^{w}}{2} \cdot \frac{e^{w}}{2}}{\frac{e^{w}}{2} - \frac{e^{w}}{2}}\right)}\right), \mathsf{exp.f64}\left(w\right)\right) \]
      4. +-inversesN/A

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

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

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

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

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

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

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

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

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

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

    if -1 < w

    1. Initial program 99.1%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
    3. Simplified99.1%

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \left(w + \color{blue}{1}\right)\right) \]
      2. +-lowering-+.f6499.1%

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{+.f64}\left(w, \color{blue}{1}\right)\right) \]
    7. Simplified99.1%

      \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{w + 1}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 6: 98.6% accurate, 2.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)}\\


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
    3. Simplified100.0%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. sqr-powN/A

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

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

        \[\leadsto \mathsf{/.f64}\left(\left({\ell}^{\left(\frac{\frac{e^{w}}{2} \cdot \frac{e^{w}}{2} - \frac{e^{w}}{2} \cdot \frac{e^{w}}{2}}{\frac{e^{w}}{2} - \frac{e^{w}}{2}}\right)}\right), \mathsf{exp.f64}\left(w\right)\right) \]
      4. +-inversesN/A

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

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

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

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

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

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

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

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

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

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

    if -1.6000000000000001 < w

    1. Initial program 99.1%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\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), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      3. sub-negN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\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 \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      10. *-lowering-*.f6486.0%

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
    5. Simplified86.0%

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

      \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \color{blue}{\left(1 + w \cdot \left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)\right)}\right)\right) \]
    7. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \color{blue}{\left(w \cdot \left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)\right)}\right)\right)\right) \]
      2. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \color{blue}{\left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)}\right)\right)\right)\right) \]
      3. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
      4. *-lowering-*.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
      5. +-lowering-+.f64N/A

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
      7. *-lowering-*.f6485.9%

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
    8. Simplified85.9%

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

      \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(\ell, \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, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
    10. Step-by-step derivation
      1. Simplified98.5%

        \[\leadsto \color{blue}{1} \cdot {\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)} \]
      2. Step-by-step derivation
        1. *-lft-identityN/A

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

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

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

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

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

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

          \[\leadsto \mathsf{pow.f64}\left(\ell, \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(w \cdot \frac{1}{6}\right)}\right)\right)\right)\right)\right)\right) \]
        8. *-lowering-*.f6498.5%

          \[\leadsto \mathsf{pow.f64}\left(\ell, \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)\right) \]
      3. Applied egg-rr98.5%

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

    Alternative 7: 98.6% accurate, 2.7× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
      3. Simplified100.0%

        \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
      4. Add Preprocessing
      5. Step-by-step derivation
        1. sqr-powN/A

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

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

          \[\leadsto \mathsf{/.f64}\left(\left({\ell}^{\left(\frac{\frac{e^{w}}{2} \cdot \frac{e^{w}}{2} - \frac{e^{w}}{2} \cdot \frac{e^{w}}{2}}{\frac{e^{w}}{2} - \frac{e^{w}}{2}}\right)}\right), \mathsf{exp.f64}\left(w\right)\right) \]
        4. +-inversesN/A

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

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

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

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

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

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

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

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

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

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

      if -1.30000000000000004 < w

      1. Initial program 99.1%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\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), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        3. sub-negN/A

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

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

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\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 \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        10. *-lowering-*.f6486.0%

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
      5. Simplified86.0%

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

        \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \color{blue}{\left(1 + w \cdot \left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)\right)}\right)\right) \]
      7. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \color{blue}{\left(w \cdot \left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)\right)}\right)\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \color{blue}{\left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)}\right)\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
        4. *-lowering-*.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
        7. *-lowering-*.f6485.9%

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
      8. Simplified85.9%

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

        \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(\ell, \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, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
      10. Step-by-step derivation
        1. Simplified98.5%

          \[\leadsto \color{blue}{1} \cdot {\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)} \]
        2. Taylor expanded in w around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(1, \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
        4. Simplified98.5%

          \[\leadsto 1 \cdot {\ell}^{\color{blue}{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)}} \]
      11. Recombined 2 regimes into one program.
      12. Final simplification98.9%

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

      Alternative 8: 98.5% accurate, 2.8× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
        3. Simplified100.0%

          \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
        4. Add Preprocessing
        5. Step-by-step derivation
          1. sqr-powN/A

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

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

            \[\leadsto \mathsf{/.f64}\left(\left({\ell}^{\left(\frac{\frac{e^{w}}{2} \cdot \frac{e^{w}}{2} - \frac{e^{w}}{2} \cdot \frac{e^{w}}{2}}{\frac{e^{w}}{2} - \frac{e^{w}}{2}}\right)}\right), \mathsf{exp.f64}\left(w\right)\right) \]
          4. +-inversesN/A

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

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

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

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

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

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

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

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

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

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

        if -1 < w

        1. Initial program 99.1%

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\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), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
          3. sub-negN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\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 \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
          10. *-lowering-*.f6486.0%

            \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
        5. Simplified86.0%

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

          \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \color{blue}{\left(1 + w \cdot \left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)\right)}\right)\right) \]
        7. Step-by-step derivation
          1. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \color{blue}{\left(w \cdot \left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)\right)}\right)\right)\right) \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \color{blue}{\left(1 + w \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot w\right)\right)}\right)\right)\right)\right) \]
          3. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
          4. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
          5. +-lowering-+.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
          6. *-commutativeN/A

            \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
          7. *-lowering-*.f6485.9%

            \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \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)\right)\right) \]
        8. Simplified85.9%

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

          \[\leadsto \mathsf{*.f64}\left(\color{blue}{1}, \mathsf{pow.f64}\left(\ell, \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, \frac{1}{6}\right)\right)\right)\right)\right)\right)\right)\right) \]
        10. Step-by-step derivation
          1. Simplified98.5%

            \[\leadsto \color{blue}{1} \cdot {\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)} \]
          2. Taylor expanded in w around 0

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

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

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

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

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

        Alternative 9: 97.8% accurate, 2.8× speedup?

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

          1. Initial program 100.0%

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
          3. Simplified100.0%

            \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
          4. Add Preprocessing
          5. Step-by-step derivation
            1. sqr-powN/A

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

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

              \[\leadsto \mathsf{/.f64}\left(\left({\ell}^{\left(\frac{\frac{e^{w}}{2} \cdot \frac{e^{w}}{2} - \frac{e^{w}}{2} \cdot \frac{e^{w}}{2}}{\frac{e^{w}}{2} - \frac{e^{w}}{2}}\right)}\right), \mathsf{exp.f64}\left(w\right)\right) \]
            4. +-inversesN/A

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

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

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

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

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

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

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

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

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

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

          if -0.71999999999999997 < w < 0.185

          1. Initial program 99.5%

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
          3. Simplified99.5%

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(\ell, \left(w + \color{blue}{1}\right)\right) \]
              2. +-lowering-+.f6497.6%

                \[\leadsto \mathsf{/.f64}\left(\ell, \mathsf{+.f64}\left(w, \color{blue}{1}\right)\right) \]
            4. Simplified97.6%

              \[\leadsto \frac{\ell}{\color{blue}{w + 1}} \]

            if 0.185 < w

            1. Initial program 97.5%

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

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

          Alternative 10: 97.5% 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.3%

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

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

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
          3. Simplified99.3%

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

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

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

            Alternative 11: 90.0% accurate, 14.5× speedup?

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

              1. Initial program 100.0%

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
              3. Simplified100.0%

                \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
              4. Add Preprocessing
              5. Step-by-step derivation
                1. sqr-powN/A

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

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

                  \[\leadsto \mathsf{/.f64}\left(\left({\ell}^{\left(\frac{\frac{e^{w}}{2} \cdot \frac{e^{w}}{2} - \frac{e^{w}}{2} \cdot \frac{e^{w}}{2}}{\frac{e^{w}}{2} - \frac{e^{w}}{2}}\right)}\right), \mathsf{exp.f64}\left(w\right)\right) \]
                4. +-inversesN/A

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{\color{blue}{1}}{e^{w}} \]
              7. 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)} \]
              8. 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) \]
              9. Simplified100.0%

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

              if -2.19999999999999992e110 < w < 0.115000000000000005

              1. Initial program 99.6%

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

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \left(e^{w}\right)\right) \]
                7. exp-lowering-exp.f6499.6%

                  \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
              3. Simplified99.6%

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

                \[\leadsto \mathsf{/.f64}\left(\color{blue}{\ell}, \mathsf{exp.f64}\left(w\right)\right) \]
              6. 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) \]
                  23. *-lowering-*.f6486.3%

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

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

                if 0.115000000000000005 < w

                1. Initial program 97.5%

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

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

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

              Alternative 12: 91.3% accurate, 15.2× speedup?

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

                1. Initial program 99.7%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\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), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                  3. sub-negN/A

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

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

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\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 \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                  10. *-lowering-*.f6488.8%

                    \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right)\right) \]
                5. Simplified88.8%

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

                  \[\leadsto \mathsf{*.f64}\left(\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, \frac{-1}{6}\right)\right)\right)\right)\right)\right), \color{blue}{\ell}\right) \]
                7. Step-by-step derivation
                  1. Simplified89.0%

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

                  if 0.110000000000000001 < w

                  1. Initial program 97.5%

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

                    \[\leadsto \color{blue}{0} \]
                8. Recombined 2 regimes into one program.
                9. Final simplification90.0%

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

                Alternative 13: 87.6% accurate, 20.3× speedup?

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

                  1. Initial program 100.0%

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
                  3. Simplified100.0%

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

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

                      \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
                    2. Step-by-step derivation
                      1. clear-numN/A

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

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

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

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

                      \[\leadsto \color{blue}{\frac{1}{\frac{e^{w}}{\ell}}} \]
                    4. 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)} \]
                    5. 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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(w, \left(\ell \cdot \frac{1}{2}\right)\right), \ell\right)\right)\right) \]
                      14. *-lowering-*.f6451.5%

                        \[\leadsto \mathsf{+.f64}\left(\ell, \mathsf{*.f64}\left(w, \mathsf{\_.f64}\left(\mathsf{*.f64}\left(w, \mathsf{*.f64}\left(\ell, \frac{1}{2}\right)\right), \ell\right)\right)\right) \]
                    6. Simplified51.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                    if -1 < w < 0.0850000000000000061

                    1. Initial program 99.5%

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

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

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

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

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

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

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

                        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
                    3. Simplified99.5%

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

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

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

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

                          \[\leadsto \mathsf{/.f64}\left(\ell, \left(w + \color{blue}{1}\right)\right) \]
                        2. +-lowering-+.f6497.6%

                          \[\leadsto \mathsf{/.f64}\left(\ell, \mathsf{+.f64}\left(w, \color{blue}{1}\right)\right) \]
                      4. Simplified97.6%

                        \[\leadsto \frac{\ell}{\color{blue}{w + 1}} \]

                      if 0.0850000000000000061 < w

                      1. Initial program 97.5%

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

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

                    Alternative 14: 77.5% accurate, 30.5× speedup?

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

                      1. Initial program 99.7%

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{exp.f64}\left(w\right)\right), \mathsf{exp.f64}\left(w\right)\right) \]
                      3. Simplified99.7%

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

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

                          \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
                        2. Step-by-step derivation
                          1. clear-numN/A

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

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

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

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

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

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

                            \[\leadsto \ell + \left(\mathsf{neg}\left(\ell \cdot w\right)\right) \]
                          2. unsub-negN/A

                            \[\leadsto \ell - \color{blue}{\ell \cdot w} \]
                          3. --lowering--.f64N/A

                            \[\leadsto \mathsf{\_.f64}\left(\ell, \color{blue}{\left(\ell \cdot w\right)}\right) \]
                          4. *-lowering-*.f6474.8%

                            \[\leadsto \mathsf{\_.f64}\left(\ell, \mathsf{*.f64}\left(\ell, \color{blue}{w}\right)\right) \]
                        6. Simplified74.8%

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

                        if 0.115000000000000005 < w

                        1. Initial program 97.5%

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

                          \[\leadsto \color{blue}{0} \]
                      7. Recombined 2 regimes into one program.
                      8. Final simplification78.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq 0.115:\\ \;\;\;\;\ell - w \cdot \ell\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
                      9. Add Preprocessing

                      Alternative 15: 77.5% accurate, 30.5× speedup?

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

                        1. Initial program 99.7%

                          \[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--.f6468.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. Simplified68.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. Simplified74.8%

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

                          if 0.170000000000000012 < w

                          1. Initial program 97.5%

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

                            \[\leadsto \color{blue}{0} \]
                        8. Recombined 2 regimes into one program.
                        9. Final simplification78.0%

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

                        Alternative 16: 70.8% accurate, 50.7× speedup?

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

                          1. Initial program 99.7%

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

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

                            if 0.25 < w

                            1. Initial program 97.5%

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

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

                          Alternative 17: 16.5% 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.3%

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

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

                          Reproduce

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