
(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 14 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.4%
(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.4%
exp-neg99.4%
remove-double-neg99.4%
associate-*l/99.4%
*-lft-identity99.4%
remove-double-neg99.4%
Simplified99.4%
(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}
Initial program 99.4%
add-sqr-sqrt46.8%
sqrt-unprod87.0%
sqr-neg87.0%
sqrt-unprod40.2%
add-sqr-sqrt86.6%
add-sqr-sqrt86.6%
sqrt-unprod86.6%
add-sqr-sqrt40.2%
sqrt-unprod65.6%
sqr-neg65.6%
sqrt-unprod25.3%
add-sqr-sqrt52.7%
pow152.7%
exp-neg52.7%
inv-pow52.7%
pow-prod-up98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Final simplification98.4%
(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.4%
add-sqr-sqrt46.8%
sqrt-unprod87.0%
sqr-neg87.0%
sqrt-unprod40.2%
add-sqr-sqrt86.6%
add-sqr-sqrt86.6%
sqrt-unprod86.6%
add-sqr-sqrt40.2%
sqrt-unprod65.6%
sqr-neg65.6%
sqrt-unprod25.3%
add-sqr-sqrt52.7%
pow152.7%
exp-neg52.7%
inv-pow52.7%
pow-prod-up98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Taylor expanded in w around inf 98.4%
exp-neg98.4%
associate-*r/98.4%
*-rgt-identity98.4%
rem-exp-log84.4%
rem-exp-log98.4%
Simplified98.4%
(FPCore (w l) :precision binary64 (if (<= w 0.82) (* l (+ 1.0 (* w (+ (* w (* 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.82) {
tmp = l * (1.0 + (w * ((w * (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.82d0) then
tmp = l * (1.0d0 + (w * ((w * (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.82) {
tmp = l * (1.0 + (w * ((w * (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.82: tmp = l * (1.0 + (w * ((w * (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.82) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * 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.82) tmp = l * (1.0 + (w * ((w * (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.82], N[(l * N[(1.0 + N[(w * N[(N[(w * N[(w * -0.16666666666666666), $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.82:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(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}
if w < 0.819999999999999951Initial program 99.2%
add-sqr-sqrt32.5%
sqrt-unprod83.5%
sqr-neg83.5%
sqrt-unprod51.0%
add-sqr-sqrt83.0%
add-sqr-sqrt83.0%
sqrt-unprod83.0%
add-sqr-sqrt51.0%
sqrt-unprod83.1%
sqr-neg83.1%
sqrt-unprod32.1%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up98.0%
metadata-eval98.0%
metadata-eval98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Taylor expanded in w around 0 89.1%
Taylor expanded in w around inf 89.1%
*-commutative89.1%
Simplified89.1%
if 0.819999999999999951 < w Initial program 100.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 inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
rem-exp-log55.6%
rem-exp-log100.0%
Simplified100.0%
Taylor expanded in w around 0 76.2%
*-commutative76.2%
Simplified76.2%
Final simplification86.4%
(FPCore (w l) :precision binary64 (if (<= w 1.6) (* l (+ 1.0 (* w (+ (* w (+ (* w -0.16666666666666666) 0.5)) -1.0)))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 1.6) {
tmp = l * (1.0 + (w * ((w * ((w * -0.16666666666666666) + 0.5)) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 1.6d0) then
tmp = l * (1.0d0 + (w * ((w * ((w * (-0.16666666666666666d0)) + 0.5d0)) + (-1.0d0))))
else
tmp = l / (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 1.6) {
tmp = l * (1.0 + (w * ((w * ((w * -0.16666666666666666) + 0.5)) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 1.6: tmp = l * (1.0 + (w * ((w * ((w * -0.16666666666666666) + 0.5)) + -1.0))) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 1.6) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * Float64(Float64(w * -0.16666666666666666) + 0.5)) + -1.0)))); else tmp = Float64(l / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 1.6) tmp = l * (1.0 + (w * ((w * ((w * -0.16666666666666666) + 0.5)) + -1.0))); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 1.6], N[(l * N[(1.0 + N[(w * N[(N[(w * N[(N[(w * -0.16666666666666666), $MachinePrecision] + 0.5), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 1.6:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(w \cdot -0.16666666666666666 + 0.5\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 1.6000000000000001Initial program 99.2%
add-sqr-sqrt32.5%
sqrt-unprod83.5%
sqr-neg83.5%
sqrt-unprod51.0%
add-sqr-sqrt83.0%
add-sqr-sqrt83.0%
sqrt-unprod83.0%
add-sqr-sqrt51.0%
sqrt-unprod83.1%
sqr-neg83.1%
sqrt-unprod32.1%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up98.0%
metadata-eval98.0%
metadata-eval98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Taylor expanded in w around 0 89.1%
Taylor expanded in l around 0 89.1%
if 1.6000000000000001 < w Initial program 100.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 inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
rem-exp-log55.6%
rem-exp-log100.0%
Simplified100.0%
Taylor expanded in w around 0 74.1%
*-commutative74.1%
Simplified74.1%
Final simplification85.9%
(FPCore (w l) :precision binary64 (if (<= w 0.89) (* l (+ 1.0 (* w (+ (* w (* w -0.16666666666666666)) -1.0)))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 0.89) {
tmp = l * (1.0 + (w * ((w * (w * -0.16666666666666666)) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.89d0) then
tmp = l * (1.0d0 + (w * ((w * (w * (-0.16666666666666666d0))) + (-1.0d0))))
else
tmp = l / (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.89) {
tmp = l * (1.0 + (w * ((w * (w * -0.16666666666666666)) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.89: tmp = l * (1.0 + (w * ((w * (w * -0.16666666666666666)) + -1.0))) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.89) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * Float64(w * -0.16666666666666666)) + -1.0)))); else tmp = Float64(l / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.89) tmp = l * (1.0 + (w * ((w * (w * -0.16666666666666666)) + -1.0))); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.89], N[(l * N[(1.0 + N[(w * N[(N[(w * N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.89:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 0.890000000000000013Initial program 99.2%
add-sqr-sqrt32.5%
sqrt-unprod83.5%
sqr-neg83.5%
sqrt-unprod51.0%
add-sqr-sqrt83.0%
add-sqr-sqrt83.0%
sqrt-unprod83.0%
add-sqr-sqrt51.0%
sqrt-unprod83.1%
sqr-neg83.1%
sqrt-unprod32.1%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up98.0%
metadata-eval98.0%
metadata-eval98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Taylor expanded in w around 0 89.1%
Taylor expanded in w around inf 89.1%
*-commutative89.1%
Simplified89.1%
if 0.890000000000000013 < w Initial program 100.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 inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
rem-exp-log55.6%
rem-exp-log100.0%
Simplified100.0%
Taylor expanded in w around 0 74.1%
*-commutative74.1%
Simplified74.1%
Final simplification85.9%
(FPCore (w l) :precision binary64 (if (<= w -1e-14) (* l (+ 1.0 (* w (+ (* w 0.5) -1.0)))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -1e-14) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1d-14)) then
tmp = l * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l / (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1e-14) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1e-14: tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -1e-14) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1e-14) tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1e-14], N[(l * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1 \cdot 10^{-14}:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -9.99999999999999999e-15Initial program 99.6%
add-sqr-sqrt0.0%
sqrt-unprod52.2%
sqr-neg52.2%
sqrt-unprod52.2%
add-sqr-sqrt52.2%
add-sqr-sqrt52.2%
sqrt-unprod52.2%
add-sqr-sqrt52.2%
sqrt-unprod52.2%
sqr-neg52.2%
sqrt-unprod0.0%
add-sqr-sqrt3.1%
pow13.1%
exp-neg3.1%
inv-pow3.1%
pow-prod-up97.1%
metadata-eval97.1%
metadata-eval97.1%
metadata-eval97.1%
Applied egg-rr97.1%
Taylor expanded in w around 0 70.3%
Taylor expanded in w around 0 65.8%
Taylor expanded in l around 0 65.8%
if -9.99999999999999999e-15 < w Initial program 99.3%
add-sqr-sqrt63.3%
sqrt-unprod99.3%
sqr-neg99.3%
sqrt-unprod36.0%
add-sqr-sqrt98.8%
add-sqr-sqrt98.8%
sqrt-unprod98.8%
add-sqr-sqrt36.0%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-unprod34.3%
add-sqr-sqrt70.3%
pow170.3%
exp-neg70.3%
inv-pow70.3%
pow-prod-up98.9%
metadata-eval98.9%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Taylor expanded in w around inf 98.9%
exp-neg98.9%
associate-*r/98.9%
*-rgt-identity98.9%
rem-exp-log79.9%
rem-exp-log98.9%
Simplified98.9%
Taylor expanded in w around 0 91.5%
*-commutative91.5%
Simplified91.5%
Final simplification84.7%
(FPCore (w l) :precision binary64 (if (<= w 1.4) (* l (+ 1.0 (* w (+ (* w 0.5) -1.0)))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 1.4) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} 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 <= 1.4d0) then
tmp = l * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 1.4) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 1.4: tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 1.4) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 1.4) tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 1.4], N[(l * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 1.4:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 1.3999999999999999Initial program 99.2%
add-sqr-sqrt32.5%
sqrt-unprod83.5%
sqr-neg83.5%
sqrt-unprod51.0%
add-sqr-sqrt83.0%
add-sqr-sqrt83.0%
sqrt-unprod83.0%
add-sqr-sqrt51.0%
sqrt-unprod83.1%
sqr-neg83.1%
sqrt-unprod32.1%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up98.0%
metadata-eval98.0%
metadata-eval98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Taylor expanded in w around 0 89.1%
Taylor expanded in w around 0 87.6%
Taylor expanded in l around 0 87.6%
if 1.3999999999999999 < w Initial program 100.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 inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
rem-exp-log55.6%
rem-exp-log100.0%
Simplified100.0%
Taylor expanded in w around 0 49.2%
+-commutative49.2%
Simplified49.2%
Final simplification79.5%
(FPCore (w l) :precision binary64 (if (<= w 0.96) (- l (* w l)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.96) {
tmp = l - (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.96d0) then
tmp = l - (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.96) {
tmp = l - (w * l);
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.96: tmp = l - (w * l) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.96) tmp = Float64(l - Float64(w * 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.96) tmp = l - (w * l); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.96], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.96:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 0.95999999999999996Initial program 99.2%
add-sqr-sqrt32.5%
sqrt-unprod83.5%
sqr-neg83.5%
sqrt-unprod51.0%
add-sqr-sqrt83.0%
add-sqr-sqrt83.0%
sqrt-unprod83.0%
add-sqr-sqrt51.0%
sqrt-unprod83.1%
sqr-neg83.1%
sqrt-unprod32.1%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up98.0%
metadata-eval98.0%
metadata-eval98.0%
metadata-eval98.0%
Applied egg-rr98.0%
Taylor expanded in w around 0 74.0%
mul-1-neg74.0%
unsub-neg74.0%
Simplified74.0%
if 0.95999999999999996 < w Initial program 100.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 inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
rem-exp-log55.6%
rem-exp-log100.0%
Simplified100.0%
Taylor expanded in w around 0 49.2%
+-commutative49.2%
Simplified49.2%
Final simplification68.8%
(FPCore (w l) :precision binary64 (if (<= w -1.45) (* w (- l)) l))
double code(double w, double l) {
double tmp;
if (w <= -1.45) {
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 <= (-1.45d0)) 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 <= -1.45) {
tmp = w * -l;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.45: tmp = w * -l else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -1.45) tmp = Float64(w * Float64(-l)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.45) tmp = w * -l; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.45], N[(w * (-l)), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.45:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -1.44999999999999996Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod52.4%
sqr-neg52.4%
sqrt-unprod52.4%
add-sqr-sqrt52.4%
add-sqr-sqrt52.4%
sqrt-unprod52.4%
add-sqr-sqrt52.4%
sqrt-unprod52.4%
sqr-neg52.4%
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 23.1%
mul-1-neg23.1%
unsub-neg23.1%
Simplified23.1%
Taylor expanded in w around inf 23.1%
mul-1-neg23.1%
*-commutative23.1%
distribute-rgt-neg-in23.1%
Simplified23.1%
if -1.44999999999999996 < w Initial program 99.2%
Taylor expanded in w around 0 71.4%
(FPCore (w l) :precision binary64 (- l (* w l)))
double code(double w, double l) {
return l - (w * l);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l - (w * l)
end function
public static double code(double w, double l) {
return l - (w * l);
}
def code(w, l): return l - (w * l)
function code(w, l) return Float64(l - Float64(w * l)) end
function tmp = code(w, l) tmp = l - (w * l); end
code[w_, l_] := N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell - w \cdot \ell
\end{array}
Initial program 99.4%
add-sqr-sqrt46.8%
sqrt-unprod87.0%
sqr-neg87.0%
sqrt-unprod40.2%
add-sqr-sqrt86.6%
add-sqr-sqrt86.6%
sqrt-unprod86.6%
add-sqr-sqrt40.2%
sqrt-unprod65.6%
sqr-neg65.6%
sqrt-unprod25.3%
add-sqr-sqrt52.7%
pow152.7%
exp-neg52.7%
inv-pow52.7%
pow-prod-up98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Taylor expanded in w around 0 59.1%
mul-1-neg59.1%
unsub-neg59.1%
Simplified59.1%
Final simplification59.1%
(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}
Initial program 99.4%
add-sqr-sqrt46.8%
sqrt-unprod87.0%
sqr-neg87.0%
sqrt-unprod40.2%
add-sqr-sqrt86.6%
add-sqr-sqrt86.6%
sqrt-unprod86.6%
add-sqr-sqrt40.2%
sqrt-unprod65.6%
sqr-neg65.6%
sqrt-unprod25.3%
add-sqr-sqrt52.7%
pow152.7%
exp-neg52.7%
inv-pow52.7%
pow-prod-up98.4%
metadata-eval98.4%
metadata-eval98.4%
metadata-eval98.4%
Applied egg-rr98.4%
Taylor expanded in w around inf 98.4%
exp-neg98.4%
associate-*r/98.4%
*-rgt-identity98.4%
rem-exp-log84.4%
rem-exp-log98.4%
Simplified98.4%
Taylor expanded in w around 0 59.1%
*-rgt-identity59.1%
mul-1-neg59.1%
distribute-rgt-neg-out59.1%
distribute-lft-in59.1%
sub-neg59.1%
Simplified59.1%
(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.4%
Taylor expanded in w around 0 54.7%
herbie shell --seed 2024182
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))