Average Error: 0.3 → 0.7
Time: 11.2s
Precision: binary64
\[e^{-w} \cdot {\ell}^{\left(e^{w}\right)}\]
\[\begin{array}{l} \mathbf{if}\;w \leq 1.913020217302641 \cdot 10^{-07}:\\ \;\;\;\;\frac{\log \ell \cdot \left(w \cdot \ell\right) + \left(\ell + \left(0.5 \cdot \left(\ell \cdot \left(w \cdot w\right)\right)\right) \cdot \left(\log \ell + {\log \ell}^{2}\right)\right)}{e^{w}}\\ \mathbf{else}:\\ \;\;\;\;{e}^{\left(\log \ell \cdot e^{w} - w\right)}\\ \end{array}\]
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\begin{array}{l}
\mathbf{if}\;w \leq 1.913020217302641 \cdot 10^{-07}:\\
\;\;\;\;\frac{\log \ell \cdot \left(w \cdot \ell\right) + \left(\ell + \left(0.5 \cdot \left(\ell \cdot \left(w \cdot w\right)\right)\right) \cdot \left(\log \ell + {\log \ell}^{2}\right)\right)}{e^{w}}\\

\mathbf{else}:\\
\;\;\;\;{e}^{\left(\log \ell \cdot e^{w} - w\right)}\\

\end{array}
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
(FPCore (w l)
 :precision binary64
 (if (<= w 1.913020217302641e-07)
   (/
    (+
     (* (log l) (* w l))
     (+ l (* (* 0.5 (* l (* w w))) (+ (log l) (pow (log l) 2.0)))))
    (exp w))
   (pow E (- (* (log l) (exp w)) w))))
double code(double w, double l) {
	return exp(-w) * pow(l, exp(w));
}
double code(double w, double l) {
	double tmp;
	if (w <= 1.913020217302641e-07) {
		tmp = ((log(l) * (w * l)) + (l + ((0.5 * (l * (w * w))) * (log(l) + pow(log(l), 2.0))))) / exp(w);
	} else {
		tmp = pow(((double) M_E), ((log(l) * exp(w)) - w));
	}
	return tmp;
}

Error

Bits error versus w

Bits error versus l

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 2 regimes
  2. if w < 1.9130202173026411e-7

    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}}}\]
    3. Taylor expanded around 0 1.3

      \[\leadsto \frac{\color{blue}{\log \ell \cdot \left(w \cdot \ell\right) + \left(\ell + \left(0.5 \cdot \left({w}^{2} \cdot \left({\log \ell}^{2} \cdot \ell\right)\right) + 0.5 \cdot \left({w}^{2} \cdot \left(\log \ell \cdot \ell\right)\right)\right)\right)}}{e^{w}}\]
    4. Simplified0.8

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

    if 1.9130202173026411e-7 < w

    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}}}\]
    3. Using strategy rm
    4. Applied add-exp-log_binary640.3

      \[\leadsto \frac{{\color{blue}{\left(e^{\log \ell}\right)}}^{\left(e^{w}\right)}}{e^{w}}\]
    5. Applied pow-exp_binary640.3

      \[\leadsto \frac{\color{blue}{e^{\log \ell \cdot e^{w}}}}{e^{w}}\]
    6. Applied div-exp_binary640.3

      \[\leadsto \color{blue}{e^{\log \ell \cdot e^{w} - w}}\]
    7. Using strategy rm
    8. Applied *-un-lft-identity_binary640.3

      \[\leadsto e^{\color{blue}{1 \cdot \left(\log \ell \cdot e^{w} - w\right)}}\]
    9. Applied exp-prod_binary640.3

      \[\leadsto \color{blue}{{\left(e^{1}\right)}^{\left(\log \ell \cdot e^{w} - w\right)}}\]
    10. Simplified0.3

      \[\leadsto {\color{blue}{e}}^{\left(\log \ell \cdot e^{w} - w\right)}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.7

    \[\leadsto \begin{array}{l} \mathbf{if}\;w \leq 1.913020217302641 \cdot 10^{-07}:\\ \;\;\;\;\frac{\log \ell \cdot \left(w \cdot \ell\right) + \left(\ell + \left(0.5 \cdot \left(\ell \cdot \left(w \cdot w\right)\right)\right) \cdot \left(\log \ell + {\log \ell}^{2}\right)\right)}{e^{w}}\\ \mathbf{else}:\\ \;\;\;\;{e}^{\left(\log \ell \cdot e^{w} - w\right)}\\ \end{array}\]

Reproduce

herbie shell --seed 2020220 
(FPCore (w l)
  :name "exp-w crasher"
  :precision binary64
  (* (exp (- w)) (pow l (exp w))))