
(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:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(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}
Initial program 99.8%
(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}
Initial program 99.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
(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}
Initial program 99.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
add-sqr-sqrt43.2%
sqrt-unprod84.6%
sqr-neg84.6%
sqrt-unprod41.4%
add-sqr-sqrt84.0%
add-sqr-sqrt84.0%
sqrt-unprod84.0%
add-sqr-sqrt41.4%
sqrt-unprod68.4%
sqr-neg68.4%
sqrt-unprod27.0%
add-sqr-sqrt53.2%
pow153.2%
exp-neg53.2%
inv-pow53.2%
pow-prod-up98.9%
metadata-eval98.9%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Taylor expanded in l around 0 98.9%
(FPCore (w l) :precision binary64 (if (<= w 0.24) (+ l (* l (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0)))) (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.24) {
tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = l * 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.24d0) then
tmp = l + (l * (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.24) {
tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.24: tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))) else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.24) tmp = Float64(l + Float64(l * Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0)))); else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.24) tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))); else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.24], 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 * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.24:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 0.23999999999999999Initial program 99.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt32.7%
sqrt-unprod81.7%
sqr-neg81.7%
sqrt-unprod49.0%
add-sqr-sqrt81.0%
add-sqr-sqrt81.0%
sqrt-unprod81.0%
add-sqr-sqrt49.0%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod32.0%
add-sqr-sqrt63.0%
pow163.0%
exp-neg63.0%
inv-pow63.0%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around 0 85.0%
Taylor expanded in l around 0 87.6%
if 0.23999999999999999 < w Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.0%
mul-1-neg3.0%
unsub-neg3.0%
Simplified3.0%
Taylor expanded in w around inf 3.0%
mul-1-neg3.0%
distribute-rgt-neg-out3.0%
Simplified3.0%
add-sqr-sqrt0.0%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-unprod3.0%
add-sqr-sqrt3.0%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification89.6%
(FPCore (w l) :precision binary64 (if (<= w 0.31) (+ l (* w (- (* w (* w (* l -0.16666666666666666))) l))) (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.31) {
tmp = l + (w * ((w * (w * (l * -0.16666666666666666))) - l));
} else {
tmp = l * 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.31d0) then
tmp = l + (w * ((w * (w * (l * (-0.16666666666666666d0)))) - l))
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.31) {
tmp = l + (w * ((w * (w * (l * -0.16666666666666666))) - l));
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.31: tmp = l + (w * ((w * (w * (l * -0.16666666666666666))) - l)) else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.31) tmp = Float64(l + Float64(w * Float64(Float64(w * Float64(w * Float64(l * -0.16666666666666666))) - l))); else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.31) tmp = l + (w * ((w * (w * (l * -0.16666666666666666))) - l)); else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.31], N[(l + N[(w * N[(N[(w * N[(w * N[(l * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.31:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \left(w \cdot \left(\ell \cdot -0.16666666666666666\right)\right) - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 0.309999999999999998Initial program 99.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt32.7%
sqrt-unprod81.7%
sqr-neg81.7%
sqrt-unprod49.0%
add-sqr-sqrt81.0%
add-sqr-sqrt81.0%
sqrt-unprod81.0%
add-sqr-sqrt49.0%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod32.0%
add-sqr-sqrt63.0%
pow163.0%
exp-neg63.0%
inv-pow63.0%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around 0 85.0%
Taylor expanded in w around inf 85.0%
distribute-rgt-out85.0%
metadata-eval85.0%
+-commutative85.0%
mul-1-neg85.0%
distribute-rgt-out85.0%
metadata-eval85.0%
fma-undefine85.0%
neg-mul-185.0%
distribute-rgt-neg-in85.0%
fma-undefine85.0%
sub-neg85.0%
distribute-lft-out--85.0%
metadata-eval85.0%
distribute-rgt-neg-in85.0%
metadata-eval85.0%
Simplified85.0%
if 0.309999999999999998 < w Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.0%
mul-1-neg3.0%
unsub-neg3.0%
Simplified3.0%
Taylor expanded in w around inf 3.0%
mul-1-neg3.0%
distribute-rgt-neg-out3.0%
Simplified3.0%
add-sqr-sqrt0.0%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-unprod3.0%
add-sqr-sqrt3.0%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
(FPCore (w l) :precision binary64 (if (<= w 0.18) (+ l (* l (* w (+ (* w 0.5) -1.0)))) (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.18) {
tmp = l + (l * (w * ((w * 0.5) + -1.0)));
} else {
tmp = l * 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.18d0) then
tmp = l + (l * (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.18) {
tmp = l + (l * (w * ((w * 0.5) + -1.0)));
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.18: tmp = l + (l * (w * ((w * 0.5) + -1.0))) else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.18) tmp = Float64(l + Float64(l * Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.18) tmp = l + (l * (w * ((w * 0.5) + -1.0))); else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.18], N[(l + N[(l * N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.18:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 0.17999999999999999Initial program 99.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt32.7%
sqrt-unprod81.7%
sqr-neg81.7%
sqrt-unprod49.0%
add-sqr-sqrt81.0%
add-sqr-sqrt81.0%
sqrt-unprod81.0%
add-sqr-sqrt49.0%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod32.0%
add-sqr-sqrt63.0%
pow163.0%
exp-neg63.0%
inv-pow63.0%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around 0 79.3%
associate-*r*79.3%
neg-mul-179.3%
distribute-rgt-out79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in l around 0 83.6%
if 0.17999999999999999 < w Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.0%
mul-1-neg3.0%
unsub-neg3.0%
Simplified3.0%
Taylor expanded in w around inf 3.0%
mul-1-neg3.0%
distribute-rgt-neg-out3.0%
Simplified3.0%
add-sqr-sqrt0.0%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-unprod3.0%
add-sqr-sqrt3.0%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification86.2%
(FPCore (w l) :precision binary64 (if (<= w 0.24) (* l (+ 1.0 (* w (+ 1.0 (* w 0.5))))) (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.24) {
tmp = l * (1.0 + (w * (1.0 + (w * 0.5))));
} else {
tmp = l * 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.24d0) then
tmp = l * (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.24) {
tmp = l * (1.0 + (w * (1.0 + (w * 0.5))));
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.24: tmp = l * (1.0 + (w * (1.0 + (w * 0.5)))) else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.24) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))); else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.24) tmp = l * (1.0 + (w * (1.0 + (w * 0.5)))); else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.24], N[(l * N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.24:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 0.23999999999999999Initial program 99.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt32.7%
sqrt-unprod81.7%
sqr-neg81.7%
sqrt-unprod49.0%
add-sqr-sqrt81.0%
add-sqr-sqrt81.0%
sqrt-unprod81.0%
add-sqr-sqrt49.0%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod32.0%
add-sqr-sqrt63.0%
pow163.0%
exp-neg63.0%
inv-pow63.0%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
div-inv98.7%
exp-neg98.7%
*-commutative98.7%
add-sqr-sqrt66.6%
sqrt-unprod98.7%
sqr-neg98.7%
sqrt-unprod32.0%
add-sqr-sqrt63.6%
*-rgt-identity63.6%
Applied egg-rr63.6%
Taylor expanded in w around 0 83.6%
*-commutative83.6%
Simplified83.6%
if 0.23999999999999999 < w Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.0%
mul-1-neg3.0%
unsub-neg3.0%
Simplified3.0%
Taylor expanded in w around inf 3.0%
mul-1-neg3.0%
distribute-rgt-neg-out3.0%
Simplified3.0%
add-sqr-sqrt0.0%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-unprod3.0%
add-sqr-sqrt3.0%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification86.2%
(FPCore (w l) :precision binary64 (if (<= w 0.23) (+ l (* w (* w (* l 0.5)))) (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.23) {
tmp = l + (w * (w * (l * 0.5)));
} else {
tmp = l * 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.23d0) then
tmp = l + (w * (w * (l * 0.5d0)))
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.23) {
tmp = l + (w * (w * (l * 0.5)));
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.23: tmp = l + (w * (w * (l * 0.5))) else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.23) tmp = Float64(l + Float64(w * Float64(w * Float64(l * 0.5)))); else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.23) tmp = l + (w * (w * (l * 0.5))); else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.23], N[(l + N[(w * N[(w * N[(l * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.23:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \left(\ell \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 0.23000000000000001Initial program 99.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt32.7%
sqrt-unprod81.7%
sqr-neg81.7%
sqrt-unprod49.0%
add-sqr-sqrt81.0%
add-sqr-sqrt81.0%
sqrt-unprod81.0%
add-sqr-sqrt49.0%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod32.0%
add-sqr-sqrt63.0%
pow163.0%
exp-neg63.0%
inv-pow63.0%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around 0 79.3%
associate-*r*79.3%
neg-mul-179.3%
distribute-rgt-out79.3%
metadata-eval79.3%
Simplified79.3%
Taylor expanded in w around inf 79.3%
associate-*r*79.3%
*-commutative79.3%
metadata-eval79.3%
distribute-rgt-neg-in79.3%
*-commutative79.3%
distribute-rgt-neg-in79.3%
metadata-eval79.3%
*-commutative79.3%
Simplified79.3%
if 0.23000000000000001 < w Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.0%
mul-1-neg3.0%
unsub-neg3.0%
Simplified3.0%
Taylor expanded in w around inf 3.0%
mul-1-neg3.0%
distribute-rgt-neg-out3.0%
Simplified3.0%
add-sqr-sqrt0.0%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-unprod3.0%
add-sqr-sqrt3.0%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification82.5%
(FPCore (w l) :precision binary64 (if (<= w -0.064) (* w (- l)) (if (<= w 0.49) l (* l 0.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.064) {
tmp = w * -l;
} else if (w <= 0.49) {
tmp = l;
} else {
tmp = l * 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.064d0)) then
tmp = w * -l
else if (w <= 0.49d0) then
tmp = l
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.064) {
tmp = w * -l;
} else if (w <= 0.49) {
tmp = l;
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.064: tmp = w * -l elif w <= 0.49: tmp = l else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.064) tmp = Float64(w * Float64(-l)); elseif (w <= 0.49) tmp = l; else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.064) tmp = w * -l; elseif (w <= 0.49) tmp = l; else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.064], N[(w * (-l)), $MachinePrecision], If[LessEqual[w, 0.49], l, N[(l * 0.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.064:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{elif}\;w \leq 0.49:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < -0.064000000000000001Initial program 99.9%
exp-neg99.9%
remove-double-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
remove-double-neg99.9%
Simplified99.9%
add-sqr-sqrt0.0%
sqrt-unprod50.1%
sqr-neg50.1%
sqrt-unprod50.1%
add-sqr-sqrt50.1%
add-sqr-sqrt50.1%
sqrt-unprod50.1%
add-sqr-sqrt50.1%
sqrt-unprod50.1%
sqr-neg50.1%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.8%
metadata-eval98.8%
metadata-eval98.8%
metadata-eval98.8%
Applied egg-rr98.8%
Taylor expanded in w around 0 27.7%
mul-1-neg27.7%
unsub-neg27.7%
Simplified27.7%
Taylor expanded in w around inf 27.7%
mul-1-neg27.7%
distribute-rgt-neg-out27.7%
Simplified27.7%
if -0.064000000000000001 < w < 0.48999999999999999Initial program 99.6%
Taylor expanded in w around 0 98.6%
if 0.48999999999999999 < w Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.0%
mul-1-neg3.0%
unsub-neg3.0%
Simplified3.0%
Taylor expanded in w around inf 3.0%
mul-1-neg3.0%
distribute-rgt-neg-out3.0%
Simplified3.0%
add-sqr-sqrt0.0%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-unprod3.0%
add-sqr-sqrt3.0%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification77.2%
(FPCore (w l) :precision binary64 (if (<= w 0.24) (- l (* w l)) (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.24) {
tmp = l - (w * l);
} else {
tmp = l * 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.24d0) then
tmp = l - (w * l)
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.24) {
tmp = l - (w * l);
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.24: tmp = l - (w * l) else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.24) tmp = Float64(l - Float64(w * l)); else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.24) tmp = l - (w * l); else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.24], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.24:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 0.23999999999999999Initial program 99.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt32.7%
sqrt-unprod81.7%
sqr-neg81.7%
sqrt-unprod49.0%
add-sqr-sqrt81.0%
add-sqr-sqrt81.0%
sqrt-unprod81.0%
add-sqr-sqrt49.0%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod32.0%
add-sqr-sqrt63.0%
pow163.0%
exp-neg63.0%
inv-pow63.0%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around 0 73.0%
mul-1-neg73.0%
unsub-neg73.0%
Simplified73.0%
if 0.23999999999999999 < w Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.0%
mul-1-neg3.0%
unsub-neg3.0%
Simplified3.0%
Taylor expanded in w around inf 3.0%
mul-1-neg3.0%
distribute-rgt-neg-out3.0%
Simplified3.0%
add-sqr-sqrt0.0%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-unprod3.0%
add-sqr-sqrt3.0%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Final simplification77.2%
(FPCore (w l) :precision binary64 (if (<= w 0.21) l (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.21) {
tmp = l;
} else {
tmp = l * 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.21d0) then
tmp = l
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.21) {
tmp = l;
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.21: tmp = l else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.21) tmp = l; else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.21) tmp = l; else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.21], l, N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.21:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 0.209999999999999992Initial program 99.7%
Taylor expanded in w around 0 64.4%
if 0.209999999999999992 < w Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.0%
mul-1-neg3.0%
unsub-neg3.0%
Simplified3.0%
Taylor expanded in w around inf 3.0%
mul-1-neg3.0%
distribute-rgt-neg-out3.0%
Simplified3.0%
add-sqr-sqrt0.0%
sqrt-unprod2.5%
sqr-neg2.5%
sqrt-unprod3.0%
add-sqr-sqrt3.0%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
(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}
Initial program 99.8%
Taylor expanded in w around 0 55.1%
herbie shell --seed 2024155
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))