?

Average Error: 0.3 → 0.3
Time: 17.2s
Precision: binary64
Cost: 64384

?

\[e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]
\[\begin{array}{l} t_0 := \sqrt{e^{w}}\\ \frac{\frac{{\ell}^{\left(e^{w}\right)}}{t_0}}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right)} \end{array} \]
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
(FPCore (w l)
 :precision binary64
 (let* ((t_0 (sqrt (exp w))))
   (/ (/ (pow l (exp w)) t_0) (expm1 (expm1 (log1p (log1p t_0)))))))
double code(double w, double l) {
	return exp(-w) * pow(l, exp(w));
}
double code(double w, double l) {
	double t_0 = sqrt(exp(w));
	return (pow(l, exp(w)) / t_0) / expm1(expm1(log1p(log1p(t_0))));
}
public static double code(double w, double l) {
	return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
public static double code(double w, double l) {
	double t_0 = Math.sqrt(Math.exp(w));
	return (Math.pow(l, Math.exp(w)) / t_0) / Math.expm1(Math.expm1(Math.log1p(Math.log1p(t_0))));
}
def code(w, l):
	return math.exp(-w) * math.pow(l, math.exp(w))
def code(w, l):
	t_0 = math.sqrt(math.exp(w))
	return (math.pow(l, math.exp(w)) / t_0) / math.expm1(math.expm1(math.log1p(math.log1p(t_0))))
function code(w, l)
	return Float64(exp(Float64(-w)) * (l ^ exp(w)))
end
function code(w, l)
	t_0 = sqrt(exp(w))
	return Float64(Float64((l ^ exp(w)) / t_0) / expm1(expm1(log1p(log1p(t_0)))))
end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[w_, l_] := Block[{t$95$0 = N[Sqrt[N[Exp[w], $MachinePrecision]], $MachinePrecision]}, N[(N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / N[(Exp[N[(Exp[N[Log[1 + N[Log[1 + t$95$0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]]
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\begin{array}{l}
t_0 := \sqrt{e^{w}}\\
\frac{\frac{{\ell}^{\left(e^{w}\right)}}{t_0}}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right)}
\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 0.3

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

    \[\leadsto \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}} \]
    Proof

    [Start]0.3

    \[ e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \]

    exp-neg [=>]0.3

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

    associate-*l/ [=>]0.3

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

    *-lft-identity [=>]0.3

    \[ \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}} \]
  3. Applied egg-rr0.3

    \[\leadsto \color{blue}{\frac{1}{\sqrt{e^{w}}} \cdot \frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}} \]
  4. Simplified0.3

    \[\leadsto \color{blue}{\frac{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}}{\sqrt{e^{w}}}} \]
    Proof

    [Start]0.3

    \[ \frac{1}{\sqrt{e^{w}}} \cdot \frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}} \]

    associate-*l/ [=>]0.3

    \[ \color{blue}{\frac{1 \cdot \frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}}{\sqrt{e^{w}}}} \]

    *-lft-identity [=>]0.3

    \[ \frac{\color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}}}{\sqrt{e^{w}}} \]
  5. Applied egg-rr0.3

    \[\leadsto \frac{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt{e^{w}}\right)\right)}} \]
  6. Applied egg-rr0.3

    \[\leadsto \frac{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}}{\mathsf{expm1}\left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\sqrt{e^{w}}\right)\right)\right)}\right)} \]
  7. Final simplification0.3

    \[\leadsto \frac{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\sqrt{e^{w}}\right)\right)\right)\right)} \]

Alternatives

Alternative 1
Error0.3
Cost19520
\[{\ell}^{\left(e^{w}\right)} \cdot e^{-w} \]
Alternative 2
Error0.3
Cost19456
\[\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}} \]
Alternative 3
Error0.8
Cost13696
\[\begin{array}{l} t_0 := 1 + w \cdot 0.5\\ \frac{\frac{{\ell}^{\left(e^{w}\right)}}{t_0}}{t_0} \end{array} \]
Alternative 4
Error1.3
Cost13376
\[\frac{\ell + \ell \cdot \left(w \cdot \log \ell\right)}{e^{w}} \]
Alternative 5
Error1.7
Cost6656
\[\ell \cdot e^{-w} \]
Alternative 6
Error1.7
Cost6592
\[\frac{\ell}{e^{w}} \]
Alternative 7
Error2.1
Cost452
\[\begin{array}{l} \mathbf{if}\;w \leq 0.195:\\ \;\;\;\;\ell\\ \mathbf{else}:\\ \;\;\;\;\left(\ell + 1\right) + -1\\ \end{array} \]
Alternative 8
Error13.9
Cost64
\[\ell \]

Error

Reproduce?

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