exp-w (used to crash)

Percentage Accurate: 99.4% → 99.5%
Time: 16.1s
Alternatives: 20
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 20 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.5% accurate, 1.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{\left(w + 1\right) + \left(0.5 + w \cdot 0.16666666666666666\right) \cdot \left(w \cdot w\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. Add Preprocessing
    3. Taylor expanded in l around inf

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

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

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)\right), w\right)\right) \]
      8. log-recN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)\right), w\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell \cdot e^{w}\right)\right)\right)\right), w\right)\right) \]
      10. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
    6. Taylor expanded in w around inf

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

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

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

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

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

    if -1.6000000000000001 < w

    1. Initial program 98.2%

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

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

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

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

      \[\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)}} \]
    8. Step-by-step derivation
      1. distribute-lft-inN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.4% accurate, 1.0× speedup?

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

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

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

    \[\leadsto {\ell}^{\left(e^{w}\right)} \cdot e^{0 - w} \]
  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 98.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.f6498.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. Simplified98.6%

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

Alternative 4: 99.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq -1.6:\\ \;\;\;\;e^{0 - 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)
   (exp (- 0.0 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 = exp((0.0 - 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 = exp((0.0d0 - 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 = Math.exp((0.0 - 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 = math.exp((0.0 - 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 = exp(Float64(0.0 - 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 = exp((0.0 - 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[Exp[N[(0.0 - 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:\\
\;\;\;\;e^{0 - 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. Add Preprocessing
    3. Taylor expanded in l around inf

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

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

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)\right), w\right)\right) \]
      8. log-recN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)\right), w\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell \cdot e^{w}\right)\right)\right)\right), w\right)\right) \]
      10. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
    6. Taylor expanded in w around inf

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

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

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

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

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

    if -1.6000000000000001 < w

    1. Initial program 98.2%

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

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

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

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

      \[\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 5: 99.4% accurate, 1.4× speedup?

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

\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{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.7999999999999998

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)\right), w\right)\right) \]
      8. log-recN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)\right), w\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell \cdot e^{w}\right)\right)\right)\right), w\right)\right) \]
      10. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
    6. Taylor expanded in w around inf

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

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

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

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

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

    if -3.7999999999999998 < w

    1. Initial program 98.2%

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

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

      \[\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 + \frac{1}{2} \cdot w\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 + \frac{1}{2} \cdot w\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 + \frac{1}{2} \cdot w\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(\frac{1}{2} \cdot w\right)}\right)\right)\right)\right) \]
      4. *-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, \left(w \cdot \color{blue}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
      5. *-lowering-*.f6499.2%

        \[\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}{\frac{1}{2}}\right)\right)\right)\right)\right) \]
    7. Simplified99.2%

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

Alternative 6: 99.4% accurate, 2.3× speedup?

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

\\
\begin{array}{l}
t_0 := 1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\\
\mathbf{if}\;w \leq -1.6:\\
\;\;\;\;e^{0 - w}\\

\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\


\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. Add Preprocessing
    3. Taylor expanded in l around inf

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

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

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)\right), w\right)\right) \]
      8. log-recN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)\right), w\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell \cdot e^{w}\right)\right)\right)\right), w\right)\right) \]
      10. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
    6. Taylor expanded in w around inf

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

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

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

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

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

    if -1.6000000000000001 < w

    1. Initial program 98.2%

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

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

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

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

      \[\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)}} \]
    8. Taylor expanded in w around 0

      \[\leadsto \mathsf{/.f64}\left(\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), \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) \]
    9. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\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), \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) \]
    10. Simplified99.1%

      \[\leadsto \frac{{\ell}^{\color{blue}{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)}}}{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 7: 99.4% accurate, 2.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(w + -1\right) \cdot \left(\frac{\ell}{w + 1} \cdot \frac{{\ell}^{\left(w \cdot \left(1 + w \cdot 0.5\right)\right)}}{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. Add Preprocessing
    3. Taylor expanded in l around inf

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

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

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)\right), w\right)\right) \]
      8. log-recN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)\right), w\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell \cdot e^{w}\right)\right)\right)\right), w\right)\right) \]
      10. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
    6. Taylor expanded in w around inf

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

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

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

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

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

    if -1 < w

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \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{+.f64}\left(\mathsf{*.f64}\left(w, w\right), -1\right)\right), \left(w + \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right)\right) \]
      16. metadata-evalN/A

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \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{+.f64}\left(\mathsf{*.f64}\left(w, w\right), -1\right)\right), \mathsf{+.f64}\left(w, \color{blue}{-1}\right)\right) \]
    12. Applied egg-rr99.0%

      \[\leadsto \color{blue}{\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)}}{w \cdot w + -1} \cdot \left(w + -1\right)} \]
    13. Step-by-step derivation
      1. unpow-prod-upN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(\ell, \mathsf{+.f64}\left(w, 1\right)\right), \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \frac{1}{2}\right)\right)\right)\right), \mathsf{+.f64}\left(w, -1\right)\right)\right), \mathsf{+.f64}\left(w, -1\right)\right) \]
    14. Applied egg-rr99.1%

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

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

Alternative 8: 99.4% accurate, 2.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot {\ell}^{\left(w \cdot \left(1 + w \cdot 0.5\right)\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. Add Preprocessing
    3. Taylor expanded in l around inf

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

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

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)\right), w\right)\right) \]
      8. log-recN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)\right), w\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell \cdot e^{w}\right)\right)\right)\right), w\right)\right) \]
      10. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
    6. Taylor expanded in w around inf

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

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

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

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

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

    if -1 < w

    1. Initial program 98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{*.f64}\left(w, \mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \frac{1}{2}\right)\right)\right)\right), \ell\right), \mathsf{+.f64}\left(w, 1\right)\right) \]
    12. Applied egg-rr99.1%

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

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

Alternative 9: 99.1% accurate, 2.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(w + 1\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. Add Preprocessing
    3. Taylor expanded in l around inf

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

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

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)\right), w\right)\right) \]
      8. log-recN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)\right), w\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell \cdot e^{w}\right)\right)\right)\right), w\right)\right) \]
      10. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
    6. Taylor expanded in w around inf

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

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

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

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

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

    if -1 < w

    1. Initial program 98.2%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(\mathsf{pow.f64}\left(\ell, \mathsf{+.f64}\left(w, 1\right)\right), \mathsf{+.f64}\left(w, 1\right)\right) \]
    10. Simplified98.8%

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

Alternative 10: 98.0% accurate, 2.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7:\\
\;\;\;\;e^{0 - w}\\

\mathbf{elif}\;w \leq 0.18:\\
\;\;\;\;\frac{\ell}{w + 1}\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(-1 \cdot \left(e^{w} \cdot \log \left(\frac{1}{\ell}\right)\right)\right), w\right)\right) \]
      6. mul-1-negN/A

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\log \left(\frac{1}{\ell}\right) \cdot e^{w}\right)\right), w\right)\right) \]
      8. log-recN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell\right)\right) \cdot e^{w}\right)\right), w\right)\right) \]
      9. distribute-lft-neg-outN/A

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\log \ell \cdot e^{w}\right)\right)\right)\right), w\right)\right) \]
      10. remove-double-negN/A

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

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

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

        \[\leadsto \mathsf{exp.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{log.f64}\left(\ell\right), \mathsf{exp.f64}\left(w\right)\right), w\right)\right) \]
    5. Simplified99.9%

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}} \]
    6. Taylor expanded in w around inf

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

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

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

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

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

    if -0.69999999999999996 < w < 0.17999999999999999

    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.1%

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

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

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

      if 0.17999999999999999 < w

      1. Initial program 93.3%

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

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

    Alternative 11: 97.7% 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 98.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.f6498.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. Simplified98.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. Simplified96.1%

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

      Alternative 12: 94.4% accurate, 4.0× speedup?

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

        1. Initial program 100.0%

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

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

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

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

              \[\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), \ell\right) \]
          4. Simplified90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{36}\right)\right), \mathsf{*.f64}\left(w, w\right)\right), \mathsf{\_.f64}\left(\frac{1}{2}, \left(w \cdot \frac{-1}{6}\right)\right)\right)\right), \ell\right) \]
            13. *-lowering-*.f6496.2%

              \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{36}\right)\right), \mathsf{*.f64}\left(w, w\right)\right), \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(w, \frac{-1}{6}\right)\right)\right)\right), \ell\right) \]
          8. Applied egg-rr96.2%

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

          if -4.39999999999999984e51 < w < 0.160000000000000003

          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(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
          4. Step-by-step derivation
            1. Simplified95.6%

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

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

                \[\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), \ell\right) \]
            4. Simplified89.1%

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

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

                \[\leadsto \frac{\left({1}^{3} + {\left(w \cdot \left(-1 + w \cdot \left(\frac{1}{2} + w \cdot \frac{-1}{6}\right)\right)\right)}^{3}\right) \cdot \ell}{\color{blue}{1 \cdot 1 + \left(\left(w \cdot \left(-1 + w \cdot \left(\frac{1}{2} + w \cdot \frac{-1}{6}\right)\right)\right) \cdot \left(w \cdot \left(-1 + w \cdot \left(\frac{1}{2} + w \cdot \frac{-1}{6}\right)\right)\right) - 1 \cdot \left(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{/.f64}\left(\left(\left({1}^{3} + {\left(w \cdot \left(-1 + w \cdot \left(\frac{1}{2} + w \cdot \frac{-1}{6}\right)\right)\right)}^{3}\right) \cdot \ell\right), \color{blue}{\left(1 \cdot 1 + \left(\left(w \cdot \left(-1 + w \cdot \left(\frac{1}{2} + w \cdot \frac{-1}{6}\right)\right)\right) \cdot \left(w \cdot \left(-1 + w \cdot \left(\frac{1}{2} + w \cdot \frac{-1}{6}\right)\right)\right) - 1 \cdot \left(w \cdot \left(-1 + w \cdot \left(\frac{1}{2} + w \cdot \frac{-1}{6}\right)\right)\right)\right)\right)}\right) \]
            6. Applied egg-rr93.8%

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

            if 0.160000000000000003 < w

            1. Initial program 93.3%

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

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

            \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq -4.4 \cdot 10^{+51}:\\ \;\;\;\;\ell \cdot \left(\left(1 - w\right) + \frac{\left(w \cdot w\right) \cdot \left(0.25 - \left(w \cdot w\right) \cdot 0.027777777777777776\right)}{0.5 - w \cdot -0.16666666666666666}\right)\\ \mathbf{elif}\;w \leq 0.16:\\ \;\;\;\;\frac{\ell \cdot \left(1 + \left(w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\right) \cdot \left(\left(w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\right) \cdot \left(w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\right)\right)\right)}{1 + \left(w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\right) \cdot \left(-1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array} \]
          7. Add Preprocessing

          Alternative 13: 92.6% accurate, 10.9× speedup?

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

            1. Initial program 99.8%

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

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

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

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

                  \[\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), \ell\right) \]
              4. Simplified89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(w, \frac{-1}{6}\right)\right), \left(w \cdot w\right)\right)\right), \ell\right) \]
                18. *-lowering-*.f6489.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{36}\right)\right), \mathsf{*.f64}\left(w, w\right)\right), \mathsf{\_.f64}\left(\frac{1}{2}, \left(w \cdot \frac{-1}{6}\right)\right)\right)\right), \ell\right) \]
                13. *-lowering-*.f6490.8%

                  \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\mathsf{\_.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, w\right), \frac{1}{36}\right)\right), \mathsf{*.f64}\left(w, w\right)\right), \mathsf{\_.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(w, \frac{-1}{6}\right)\right)\right)\right), \ell\right) \]
              8. Applied egg-rr90.8%

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

              if 0.104999999999999996 < w

              1. Initial program 93.3%

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

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

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

            Alternative 14: 91.3% accurate, 15.2× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq 0.13:\\ \;\;\;\;\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.13)
               (* 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.13) {
            		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.13d0) 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.13) {
            		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.13:
            		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.13)
            		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.13)
            		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.13], 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.13:\\
            \;\;\;\;\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.13

              1. Initial program 99.8%

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

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

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

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

                    \[\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), \ell\right) \]
                4. Simplified89.4%

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

                if 0.13 < w

                1. Initial program 93.3%

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq 0.13:\\ \;\;\;\;\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} \]
              7. Add Preprocessing

              Alternative 15: 91.3% accurate, 16.9× speedup?

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

                1. Initial program 99.8%

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

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

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

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

                      \[\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), \ell\right) \]
                  4. Simplified89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\mathsf{\_.f64}\left(1, w\right), \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(w, \frac{-1}{6}\right)\right), \left(w \cdot w\right)\right)\right), \ell\right) \]
                    18. *-lowering-*.f6489.4%

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

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

                    \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(\color{blue}{1}, \mathsf{*.f64}\left(\mathsf{+.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(w, \frac{-1}{6}\right)\right), \mathsf{*.f64}\left(w, w\right)\right)\right), \ell\right) \]
                  8. Step-by-step derivation
                    1. Simplified89.4%

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

                    if 0.14499999999999999 < w

                    1. Initial program 93.3%

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

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

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

                  Alternative 16: 91.3% accurate, 19.0× speedup?

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

                    1. Initial program 99.8%

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

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

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

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

                          \[\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), \ell\right) \]
                      4. Simplified89.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(\frac{-1}{6}, \left(w \cdot w\right)\right)\right)\right), \ell\right) \]
                        13. *-lowering-*.f6489.4%

                          \[\leadsto \mathsf{*.f64}\left(\mathsf{+.f64}\left(1, \mathsf{*.f64}\left(w, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(w, w\right)\right)\right)\right), \ell\right) \]
                      7. Simplified89.4%

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

                      if 0.170000000000000012 < w

                      1. Initial program 93.3%

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

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

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

                    Alternative 17: 91.3% accurate, 20.3× speedup?

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

                      1. Initial program 100.0%

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

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

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

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

                            \[\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), \ell\right) \]
                        4. Simplified74.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \mathsf{*.f64}\left(\frac{-1}{6}, \left(w \cdot w\right)\right)\right), \ell\right) \]
                          13. *-lowering-*.f6474.5%

                            \[\leadsto \mathsf{*.f64}\left(\mathsf{*.f64}\left(w, \mathsf{*.f64}\left(\frac{-1}{6}, \mathsf{*.f64}\left(w, w\right)\right)\right), \ell\right) \]
                        7. Simplified74.5%

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

                        if -190 < 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(\mathsf{exp.f64}\left(\mathsf{neg.f64}\left(w\right)\right), \color{blue}{\ell}\right) \]
                        4. Step-by-step derivation
                          1. Simplified95.9%

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

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

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

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

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

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

                          if 0.110000000000000001 < w

                          1. Initial program 93.3%

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

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

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

                        Alternative 18: 77.8% accurate, 30.5× speedup?

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

                          1. Initial program 99.8%

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

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

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

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

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

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

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

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

                            if 0.12 < w

                            1. Initial program 93.3%

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

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

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

                          Alternative 19: 70.6% accurate, 50.7× speedup?

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

                            1. Initial program 99.8%

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

                              \[\leadsto \color{blue}{\ell} \]
                            4. Step-by-step derivation
                              1. Simplified67.9%

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

                              if 0.149999999999999994 < w

                              1. Initial program 93.3%

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

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

                            Alternative 20: 16.8% 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 98.6%

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

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

                            Reproduce

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