exp-w (used to crash)

Percentage Accurate: 99.4% → 99.4%
Time: 18.7s
Alternatives: 19
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 99.4% accurate, 1.0× speedup?

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

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

Alternative 1: 99.4% accurate, 1.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}
Derivation
  1. Initial program 99.7%

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

Alternative 2: 98.5% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
t_0 := {\ell}^{\left(e^{w}\right)}\\
\mathbf{if}\;e^{-w} \cdot t\_0 \leq 10^{+156}:\\
\;\;\;\;\frac{t\_0}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{e^{w}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999998e155

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg99.5%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. remove-double-neg99.5%

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

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{-\left(-w\right)}}} \]
      4. *-lft-identity99.5%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{-\left(-w\right)}} \]
      5. remove-double-neg99.5%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{e^{\color{blue}{w}}} \]
    3. Simplified99.5%

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

      \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{1 + w \cdot \left(1 + w \cdot \left(0.5 + 0.16666666666666666 \cdot w\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + \color{blue}{w \cdot 0.16666666666666666}\right)\right)} \]
    7. Simplified99.2%

      \[\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)}} \]

    if 9.9999999999999998e155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w)))

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod49.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt49.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow128.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg100.0%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity100.0%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified100.0%

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

Alternative 3: 98.4% accurate, 0.7× 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}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+156}:\\ \;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{e^{w}}\\ \end{array} \end{array} \]
(FPCore (w l)
 :precision binary64
 (let* ((t_0 (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666))))))))
   (if (<= (* (exp (- w)) (pow l (exp w))) 1e+156)
     (/ (pow l t_0) t_0)
     (/ l (exp w)))))
double code(double w, double l) {
	double t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))));
	double tmp;
	if ((exp(-w) * pow(l, exp(w))) <= 1e+156) {
		tmp = pow(l, t_0) / t_0;
	} else {
		tmp = l / exp(w);
	}
	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 ((exp(-w) * (l ** exp(w))) <= 1d+156) then
        tmp = (l ** t_0) / t_0
    else
        tmp = l / exp(w)
    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 ((Math.exp(-w) * Math.pow(l, Math.exp(w))) <= 1e+156) {
		tmp = Math.pow(l, t_0) / t_0;
	} else {
		tmp = l / Math.exp(w);
	}
	return tmp;
}
def code(w, l):
	t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))
	tmp = 0
	if (math.exp(-w) * math.pow(l, math.exp(w))) <= 1e+156:
		tmp = math.pow(l, t_0) / t_0
	else:
		tmp = l / math.exp(w)
	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 (Float64(exp(Float64(-w)) * (l ^ exp(w))) <= 1e+156)
		tmp = Float64((l ^ t_0) / t_0);
	else
		tmp = Float64(l / exp(w));
	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 ((exp(-w) * (l ^ exp(w))) <= 1e+156)
		tmp = (l ^ t_0) / t_0;
	else
		tmp = l / exp(w);
	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[N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+156], N[(N[Power[l, t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision], N[(l / N[Exp[w], $MachinePrecision]), $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}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+156}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{e^{w}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999998e155

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg99.5%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. remove-double-neg99.5%

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

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{-\left(-w\right)}}} \]
      4. *-lft-identity99.5%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{-\left(-w\right)}} \]
      5. remove-double-neg99.5%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{e^{\color{blue}{w}}} \]
    3. Simplified99.5%

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

      \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{1 + w \cdot \left(1 + w \cdot \left(0.5 + 0.16666666666666666 \cdot w\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + \color{blue}{w \cdot 0.16666666666666666}\right)\right)} \]
    7. Simplified99.2%

      \[\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 98.9%

      \[\leadsto \frac{{\ell}^{\color{blue}{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + 0.16666666666666666 \cdot w\right)\right)\right)}}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)} \]
    9. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + \color{blue}{w \cdot 0.16666666666666666}\right)\right)} \]
    10. Simplified98.9%

      \[\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)} \]

    if 9.9999999999999998e155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w)))

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod49.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt49.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow128.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg100.0%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity100.0%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified100.0%

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

Alternative 4: 98.4% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+156}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{e^{w}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999998e155

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg99.5%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. remove-double-neg99.5%

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

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{-\left(-w\right)}}} \]
      4. *-lft-identity99.5%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{-\left(-w\right)}} \]
      5. remove-double-neg99.5%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{e^{\color{blue}{w}}} \]
    3. Simplified99.5%

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

      \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{1 + w \cdot \left(1 + w \cdot \left(0.5 + 0.16666666666666666 \cdot w\right)\right)}} \]
    6. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + \color{blue}{w \cdot 0.16666666666666666}\right)\right)} \]
    7. Simplified99.2%

      \[\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 98.5%

      \[\leadsto \frac{{\ell}^{\color{blue}{\left(1 + w \cdot \left(1 + 0.5 \cdot w\right)\right)}}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)} \]
    9. Step-by-step derivation
      1. *-commutative98.5%

        \[\leadsto \frac{{\ell}^{\left(1 + w \cdot \left(1 + \color{blue}{w \cdot 0.5}\right)\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)} \]
    10. Simplified98.5%

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

    if 9.9999999999999998e155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w)))

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod49.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt49.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow128.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg100.0%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity100.0%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified100.0%

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

Alternative 5: 98.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+156}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)}}{w + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{e^{w}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999998e155

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg99.5%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. remove-double-neg99.5%

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

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{-\left(-w\right)}}} \]
      4. *-lft-identity99.5%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{-\left(-w\right)}} \]
      5. remove-double-neg99.5%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{e^{\color{blue}{w}}} \]
    3. Simplified99.5%

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

      \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{1 + w}} \]
    6. Step-by-step derivation
      1. +-commutative98.3%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{w + 1}} \]
    7. Simplified98.3%

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

      \[\leadsto \frac{{\ell}^{\color{blue}{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + 0.16666666666666666 \cdot w\right)\right)\right)}}}{w + 1} \]
    9. Step-by-step derivation
      1. *-commutative99.2%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + \color{blue}{w \cdot 0.16666666666666666}\right)\right)} \]
    10. Simplified98.3%

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

    if 9.9999999999999998e155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w)))

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod49.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt49.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow128.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg100.0%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity100.0%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified100.0%

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

Alternative 6: 98.3% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+156}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)}}{w + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{e^{w}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999998e155

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Step-by-step derivation
      1. exp-neg99.5%

        \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. remove-double-neg99.5%

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

        \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{-\left(-w\right)}}} \]
      4. *-lft-identity99.5%

        \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{-\left(-w\right)}} \]
      5. remove-double-neg99.5%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{e^{\color{blue}{w}}} \]
    3. Simplified99.5%

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

      \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{1 + w}} \]
    6. Step-by-step derivation
      1. +-commutative98.3%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{w + 1}} \]
    7. Simplified98.3%

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

      \[\leadsto \frac{{\ell}^{\color{blue}{\left(1 + w \cdot \left(1 + 0.5 \cdot w\right)\right)}}}{w + 1} \]
    9. Step-by-step derivation
      1. *-commutative98.5%

        \[\leadsto \frac{{\ell}^{\left(1 + w \cdot \left(1 + \color{blue}{w \cdot 0.5}\right)\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)} \]
    10. Simplified98.3%

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

    if 9.9999999999999998e155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w)))

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod49.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt49.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow128.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr100.0%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg100.0%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/100.0%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity100.0%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified100.0%

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

Alternative 7: 87.0% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+156}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999998e155

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt62.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod97.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg97.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod34.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt95.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt95.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod95.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt34.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod37.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow172.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up95.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval95.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval95.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval95.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr95.1%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg95.1%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/95.1%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity95.1%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified95.1%

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

      \[\leadsto \frac{\ell}{\color{blue}{1 + w \cdot \left(1 + 0.5 \cdot w\right)}} \]
    9. Step-by-step derivation
      1. *-commutative98.5%

        \[\leadsto \frac{{\ell}^{\left(1 + w \cdot \left(1 + \color{blue}{w \cdot 0.5}\right)\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)} \]
    10. Simplified90.3%

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

    if 9.9999999999999998e155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w)))

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod49.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt49.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow128.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr100.0%

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

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

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

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

Alternative 8: 83.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+156}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999998e155

    1. Initial program 99.5%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt62.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod97.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg97.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod34.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt95.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt95.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod95.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt34.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod37.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow172.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow72.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up95.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval95.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval95.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval95.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr95.1%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg95.1%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/95.1%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity95.1%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified95.1%

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

      \[\leadsto \frac{\ell}{\color{blue}{1 + w \cdot \left(1 + 0.5 \cdot w\right)}} \]
    9. Step-by-step derivation
      1. *-commutative98.5%

        \[\leadsto \frac{{\ell}^{\left(1 + w \cdot \left(1 + \color{blue}{w \cdot 0.5}\right)\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)} \]
    10. Simplified90.3%

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

    if 9.9999999999999998e155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w)))

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod49.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt49.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg62.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod12.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow128.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow28.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr100.0%

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

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

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

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

Alternative 9: 80.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 5 \cdot 10^{-180}:\\
\;\;\;\;\frac{\ell}{w + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 5.0000000000000001e-180

    1. Initial program 99.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod97.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg97.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod18.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt94.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt94.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod94.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt18.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod48.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg48.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod30.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt48.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow148.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg48.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow48.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up94.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval94.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval94.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval94.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr94.3%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg94.3%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/94.3%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity94.3%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified94.3%

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

      \[\leadsto \frac{\ell}{\color{blue}{1 + w}} \]
    9. Step-by-step derivation
      1. +-commutative98.8%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{w + 1}} \]
    10. Simplified69.6%

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

    if 5.0000000000000001e-180 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w)))

    1. Initial program 99.8%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt26.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod77.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg77.2%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod50.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt76.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt76.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod76.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt50.5%

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

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg76.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod26.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt57.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow157.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg57.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow57.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up98.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval98.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval98.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval98.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr98.3%

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

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

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

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

Alternative 10: 99.4% accurate, 1.0× speedup?

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

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

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Step-by-step derivation
    1. exp-neg99.7%

      \[\leadsto \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. remove-double-neg99.7%

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

      \[\leadsto \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{-\left(-w\right)}}} \]
    4. *-lft-identity99.7%

      \[\leadsto \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{-\left(-w\right)}} \]
    5. remove-double-neg99.7%

      \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{e^{\color{blue}{w}}} \]
  3. Simplified99.7%

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

Alternative 11: 97.6% accurate, 2.9× speedup?

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

\\
e^{-w} \cdot \ell
\end{array}
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt42.4%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
    2. sqrt-unprod83.2%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
    3. sqr-neg83.2%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
    4. sqrt-unprod40.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
    5. add-sqr-sqrt81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
    6. add-sqr-sqrt81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
    7. sqrt-unprod81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
    8. add-sqr-sqrt40.8%

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

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
    10. sqr-neg68.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
    11. sqrt-unprod27.4%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
    12. add-sqr-sqrt54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
    13. pow154.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
    14. exp-neg54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
    15. inv-pow54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
    16. pow-prod-up97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
    17. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
    18. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
    19. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
  4. Applied egg-rr97.1%

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

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

Alternative 12: 97.6% accurate, 3.0× speedup?

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

\\
\frac{\ell}{e^{w}}
\end{array}
Derivation
  1. Initial program 99.7%

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt42.4%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
    2. sqrt-unprod83.2%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
    3. sqr-neg83.2%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
    4. sqrt-unprod40.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
    5. add-sqr-sqrt81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
    6. add-sqr-sqrt81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
    7. sqrt-unprod81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
    8. add-sqr-sqrt40.8%

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

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
    10. sqr-neg68.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
    11. sqrt-unprod27.4%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
    12. add-sqr-sqrt54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
    13. pow154.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
    14. exp-neg54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
    15. inv-pow54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
    16. pow-prod-up97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
    17. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
    18. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
    19. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
  4. Applied egg-rr97.1%

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

    \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
  6. Step-by-step derivation
    1. exp-neg97.1%

      \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
    2. associate-*r/97.1%

      \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
    3. *-rgt-identity97.1%

      \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
  7. Simplified97.1%

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

Alternative 13: 90.9% accurate, 15.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.14:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\

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


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

    1. Initial program 99.6%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt32.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod80.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg80.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod47.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt47.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod31.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow163.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr97.5%

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

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

    if 0.14000000000000001 < w

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt100.0%

        \[\leadsto \color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)} \cdot {\ell}^{\left(e^{w}\right)} \]
      2. sqrt-unprod100.0%

        \[\leadsto \color{blue}{\sqrt{e^{-w} \cdot e^{-w}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      3. add-sqr-sqrt0.0%

        \[\leadsto \sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      4. sqrt-unprod5.4%

        \[\leadsto \sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      5. sqr-neg5.4%

        \[\leadsto \sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      6. sqrt-unprod5.4%

        \[\leadsto \sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      7. add-sqr-sqrt5.4%

        \[\leadsto \sqrt{e^{\color{blue}{w}} \cdot e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      8. pow15.4%

        \[\leadsto \sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}} \cdot {\ell}^{\left(e^{w}\right)} \]
      9. exp-neg5.4%

        \[\leadsto \sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      10. inv-pow5.4%

        \[\leadsto \sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      11. pow-prod-up100.0%

        \[\leadsto \sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      12. metadata-eval100.0%

        \[\leadsto \sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}} \cdot {\ell}^{\left(e^{w}\right)} \]
      13. metadata-eval100.0%

        \[\leadsto \sqrt{\color{blue}{1}} \cdot {\ell}^{\left(e^{w}\right)} \]
      14. metadata-eval100.0%

        \[\leadsto \color{blue}{1} \cdot {\ell}^{\left(e^{w}\right)} \]
      15. *-un-lft-identity100.0%

        \[\leadsto \color{blue}{{\ell}^{\left(e^{w}\right)}} \]
      16. add-sqr-sqrt100.0%

        \[\leadsto {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      17. sqrt-unprod100.0%

        \[\leadsto {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      18. sqr-neg100.0%

        \[\leadsto {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      19. sqrt-unprod0.0%

        \[\leadsto {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      20. add-sqr-sqrt3.1%

        \[\leadsto {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
    4. Applied egg-rr92.2%

      \[\leadsto \color{blue}{\log \left(e^{\ell}\right)} \]
    5. Taylor expanded in l around 0 100.0%

      \[\leadsto \log \color{blue}{1} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.7%

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

Alternative 14: 88.1% accurate, 15.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq 0.92:\\ \;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{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 0.92)
   (* l (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0))))
   (/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
	double tmp;
	if (w <= 0.92) {
		tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
	} else {
		tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
	}
	return tmp;
}
real(8) function code(w, l)
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    real(8) :: tmp
    if (w <= 0.92d0) then
        tmp = l * (1.0d0 + (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
    else
        tmp = l / (1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0))))))
    end if
    code = tmp
end function
public static double code(double w, double l) {
	double tmp;
	if (w <= 0.92) {
		tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
	} else {
		tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
	}
	return tmp;
}
def code(w, l):
	tmp = 0
	if w <= 0.92:
		tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)))
	else:
		tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))
	return tmp
function code(w, l)
	tmp = 0.0
	if (w <= 0.92)
		tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0))));
	else
		tmp = Float64(l / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666)))))));
	end
	return tmp
end
function tmp_2 = code(w, l)
	tmp = 0.0;
	if (w <= 0.92)
		tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
	else
		tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
	end
	tmp_2 = tmp;
end
code[w_, l_] := If[LessEqual[w, 0.92], N[(l * N[(1.0 + N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.92:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{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 < 0.92000000000000004

    1. Initial program 99.6%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt32.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod80.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg80.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod47.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt47.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod31.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow163.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr97.5%

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

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

    if 0.92000000000000004 < w

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod0.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt94.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt94.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod94.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt0.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow10.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up94.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval94.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval94.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval94.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr94.9%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg94.9%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/94.9%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity94.9%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified94.9%

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

      \[\leadsto \frac{\ell}{\color{blue}{1 + w \cdot \left(1 + w \cdot \left(0.5 + 0.16666666666666666 \cdot w\right)\right)}} \]
    9. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + \color{blue}{w \cdot 0.16666666666666666}\right)\right)} \]
    10. Simplified82.1%

      \[\leadsto \frac{\ell}{\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. Final simplification88.1%

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

Alternative 15: 88.1% accurate, 15.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;w \leq 1.6:\\ \;\;\;\;\ell + \ell \cdot \left(w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{\ell}{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)
   (+ l (* l (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0))))
   (/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
	double tmp;
	if (w <= 1.6) {
		tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
	} else {
		tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
	}
	return tmp;
}
real(8) function code(w, l)
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    real(8) :: tmp
    if (w <= 1.6d0) then
        tmp = l + (l * (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
    else
        tmp = l / (1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0))))))
    end if
    code = tmp
end function
public static double code(double w, double l) {
	double tmp;
	if (w <= 1.6) {
		tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
	} else {
		tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
	}
	return tmp;
}
def code(w, l):
	tmp = 0
	if w <= 1.6:
		tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)))
	else:
		tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))
	return tmp
function code(w, l)
	tmp = 0.0
	if (w <= 1.6)
		tmp = Float64(l + Float64(l * Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0))));
	else
		tmp = Float64(l / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666)))))));
	end
	return tmp
end
function tmp_2 = code(w, l)
	tmp = 0.0;
	if (w <= 1.6)
		tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
	else
		tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
	end
	tmp_2 = tmp;
end
code[w_, l_] := If[LessEqual[w, 1.6], N[(l + N[(l * N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;w \leq 1.6:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{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 99.6%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt32.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod80.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg80.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod47.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt47.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg79.6%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod31.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow163.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow63.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval97.5%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr97.5%

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

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

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

    if 1.6000000000000001 < w

    1. Initial program 100.0%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg100.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod0.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt94.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt94.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod94.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt0.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow10.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow0.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up94.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval94.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval94.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval94.9%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr94.9%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg94.9%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/94.9%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity94.9%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified94.9%

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

      \[\leadsto \frac{\ell}{\color{blue}{1 + w \cdot \left(1 + w \cdot \left(0.5 + 0.16666666666666666 \cdot w\right)\right)}} \]
    9. Step-by-step derivation
      1. *-commutative100.0%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + \color{blue}{w \cdot 0.16666666666666666}\right)\right)} \]
    10. Simplified82.1%

      \[\leadsto \frac{\ell}{\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. Final simplification88.1%

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

Alternative 16: 69.5% accurate, 30.5× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.013:\\
\;\;\;\;w \cdot \left(-\ell\right)\\

\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\


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

    1. Initial program 99.8%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod0.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt0.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow10.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg0.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow0.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up98.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval98.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval98.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval98.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr98.8%

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

      \[\leadsto \color{blue}{\ell + -1 \cdot \left(\ell \cdot w\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg26.2%

        \[\leadsto \ell + \color{blue}{\left(-\ell \cdot w\right)} \]
      2. unsub-neg26.2%

        \[\leadsto \color{blue}{\ell - \ell \cdot w} \]
      3. *-rgt-identity26.2%

        \[\leadsto \color{blue}{\ell \cdot 1} - \ell \cdot w \]
      4. distribute-lft-out--26.2%

        \[\leadsto \color{blue}{\ell \cdot \left(1 - w\right)} \]
    7. Simplified26.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\ell \cdot w\right)} \]
    9. Step-by-step derivation
      1. neg-mul-126.2%

        \[\leadsto \color{blue}{-\ell \cdot w} \]
      2. *-commutative26.2%

        \[\leadsto -\color{blue}{w \cdot \ell} \]
      3. distribute-rgt-neg-in26.2%

        \[\leadsto \color{blue}{w \cdot \left(-\ell\right)} \]
    10. Simplified26.2%

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

    if -0.0129999999999999994 < w

    1. Initial program 99.6%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt60.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod98.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg98.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod38.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt96.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt96.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod96.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt38.3%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod77.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg77.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod38.7%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt77.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow177.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg77.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow77.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up96.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval96.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval96.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval96.4%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr96.4%

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

      \[\leadsto \color{blue}{\ell \cdot e^{-w}} \]
    6. Step-by-step derivation
      1. exp-neg96.4%

        \[\leadsto \ell \cdot \color{blue}{\frac{1}{e^{w}}} \]
      2. associate-*r/96.4%

        \[\leadsto \color{blue}{\frac{\ell \cdot 1}{e^{w}}} \]
      3. *-rgt-identity96.4%

        \[\leadsto \frac{\color{blue}{\ell}}{e^{w}} \]
    7. Simplified96.4%

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

      \[\leadsto \frac{\ell}{\color{blue}{1 + w}} \]
    9. Step-by-step derivation
      1. +-commutative98.9%

        \[\leadsto \frac{{\ell}^{\left(e^{w}\right)}}{\color{blue}{w + 1}} \]
    10. Simplified85.9%

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

Alternative 17: 63.4% accurate, 33.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.053:\\
\;\;\;\;w \cdot \left(-\ell\right)\\

\mathbf{else}:\\
\;\;\;\;\ell\\


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

    1. Initial program 99.8%

      \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. add-sqr-sqrt0.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
      2. sqrt-unprod46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
      3. sqr-neg46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
      4. sqrt-unprod46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
      5. add-sqr-sqrt46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
      6. add-sqr-sqrt46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
      7. sqrt-unprod46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
      8. add-sqr-sqrt46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}} \cdot e^{-w}}\right)} \]
      9. sqrt-unprod46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
      10. sqr-neg46.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
      11. sqrt-unprod0.0%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
      12. add-sqr-sqrt0.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
      13. pow10.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
      14. exp-neg0.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
      15. inv-pow0.1%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
      16. pow-prod-up98.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
      17. metadata-eval98.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
      18. metadata-eval98.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
      19. metadata-eval98.8%

        \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
    4. Applied egg-rr98.8%

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

      \[\leadsto \color{blue}{\ell + -1 \cdot \left(\ell \cdot w\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg26.2%

        \[\leadsto \ell + \color{blue}{\left(-\ell \cdot w\right)} \]
      2. unsub-neg26.2%

        \[\leadsto \color{blue}{\ell - \ell \cdot w} \]
      3. *-rgt-identity26.2%

        \[\leadsto \color{blue}{\ell \cdot 1} - \ell \cdot w \]
      4. distribute-lft-out--26.2%

        \[\leadsto \color{blue}{\ell \cdot \left(1 - w\right)} \]
    7. Simplified26.2%

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

      \[\leadsto \color{blue}{-1 \cdot \left(\ell \cdot w\right)} \]
    9. Step-by-step derivation
      1. neg-mul-126.2%

        \[\leadsto \color{blue}{-\ell \cdot w} \]
      2. *-commutative26.2%

        \[\leadsto -\color{blue}{w \cdot \ell} \]
      3. distribute-rgt-neg-in26.2%

        \[\leadsto \color{blue}{w \cdot \left(-\ell\right)} \]
    10. Simplified26.2%

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

    if -0.0529999999999999985 < w

    1. Initial program 99.6%

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

      \[\leadsto \color{blue}{\ell} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 18: 63.1% accurate, 61.0× speedup?

\[\begin{array}{l} \\ \ell \cdot \left(1 - w\right) \end{array} \]
(FPCore (w l) :precision binary64 (* l (- 1.0 w)))
double code(double w, double l) {
	return l * (1.0 - w);
}
real(8) function code(w, l)
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    code = l * (1.0d0 - w)
end function
public static double code(double w, double l) {
	return l * (1.0 - w);
}
def code(w, l):
	return l * (1.0 - w)
function code(w, l)
	return Float64(l * Float64(1.0 - w))
end
function tmp = code(w, l)
	tmp = l * (1.0 - w);
end
code[w_, l_] := N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

    \[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. add-sqr-sqrt42.4%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}}\right)} \]
    2. sqrt-unprod83.2%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{w \cdot w}}}\right)} \]
    3. sqr-neg83.2%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\sqrt{\color{blue}{\left(-w\right) \cdot \left(-w\right)}}}\right)} \]
    4. sqrt-unprod40.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{\sqrt{-w} \cdot \sqrt{-w}}}\right)} \]
    5. add-sqr-sqrt81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(e^{\color{blue}{-w}}\right)} \]
    6. add-sqr-sqrt81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w}} \cdot \sqrt{e^{-w}}\right)}} \]
    7. sqrt-unprod81.8%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{\left(\sqrt{e^{-w} \cdot e^{-w}}\right)}} \]
    8. add-sqr-sqrt40.8%

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

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{\left(-w\right) \cdot \left(-w\right)}}} \cdot e^{-w}}\right)} \]
    10. sqr-neg68.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\sqrt{\color{blue}{w \cdot w}}} \cdot e^{-w}}\right)} \]
    11. sqrt-unprod27.4%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{\sqrt{w} \cdot \sqrt{w}}} \cdot e^{-w}}\right)} \]
    12. add-sqr-sqrt54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{e^{\color{blue}{w}} \cdot e^{-w}}\right)} \]
    13. pow154.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{1}} \cdot e^{-w}}\right)} \]
    14. exp-neg54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{\frac{1}{e^{w}}}}\right)} \]
    15. inv-pow54.5%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{1} \cdot \color{blue}{{\left(e^{w}\right)}^{-1}}}\right)} \]
    16. pow-prod-up97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{{\left(e^{w}\right)}^{\left(1 + -1\right)}}}\right)} \]
    17. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{{\left(e^{w}\right)}^{\color{blue}{0}}}\right)} \]
    18. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\left(\sqrt{\color{blue}{1}}\right)} \]
    19. metadata-eval97.1%

      \[\leadsto e^{-w} \cdot {\ell}^{\color{blue}{1}} \]
  4. Applied egg-rr97.1%

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

    \[\leadsto \color{blue}{\ell + -1 \cdot \left(\ell \cdot w\right)} \]
  6. Step-by-step derivation
    1. mul-1-neg62.6%

      \[\leadsto \ell + \color{blue}{\left(-\ell \cdot w\right)} \]
    2. unsub-neg62.6%

      \[\leadsto \color{blue}{\ell - \ell \cdot w} \]
    3. *-rgt-identity62.6%

      \[\leadsto \color{blue}{\ell \cdot 1} - \ell \cdot w \]
    4. distribute-lft-out--62.6%

      \[\leadsto \color{blue}{\ell \cdot \left(1 - w\right)} \]
  7. Simplified62.6%

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

Alternative 19: 56.7% accurate, 305.0× speedup?

\[\begin{array}{l} \\ \ell \end{array} \]
(FPCore (w l) :precision binary64 l)
double code(double w, double l) {
	return l;
}
real(8) function code(w, l)
    real(8), intent (in) :: w
    real(8), intent (in) :: l
    code = l
end function
public static double code(double w, double l) {
	return l;
}
def code(w, l):
	return l
function code(w, l)
	return l
end
function tmp = code(w, l)
	tmp = l;
end
code[w_, l_] := l
\begin{array}{l}

\\
\ell
\end{array}
Derivation
  1. Initial program 99.7%

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

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

Reproduce

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