
(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 13 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 (/ (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.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
(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.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt43.3%
sqrt-unprod79.7%
sqr-neg79.7%
sqrt-unprod36.4%
add-sqr-sqrt79.4%
add-sqr-sqrt79.4%
sqrt-unprod79.4%
add-sqr-sqrt36.4%
sqrt-unprod64.9%
sqr-neg64.9%
sqrt-unprod28.5%
add-sqr-sqrt52.9%
pow152.9%
exp-neg52.9%
inv-pow52.9%
pow-prod-up98.2%
metadata-eval98.2%
metadata-eval98.2%
metadata-eval98.2%
Applied egg-rr98.2%
Taylor expanded in l around 0 98.2%
(FPCore (w l)
:precision binary64
(if (<= w 0.125)
(+
l
(*
w
(-
(*
w
(+
(- l (* l 0.5))
(* w (- (- (* l 0.5) l) (+ (* l 0.16666666666666666) (* l -0.5))))))
l)))
(/ (+ -1.0 (+ l 1.0)) (- 1.0 (* w (- -1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 0.125) {
tmp = l + (w * ((w * ((l - (l * 0.5)) + (w * (((l * 0.5) - l) - ((l * 0.16666666666666666) + (l * -0.5)))))) - l));
} else {
tmp = (-1.0 + (l + 1.0)) / (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.125d0) then
tmp = l + (w * ((w * ((l - (l * 0.5d0)) + (w * (((l * 0.5d0) - l) - ((l * 0.16666666666666666d0) + (l * (-0.5d0))))))) - l))
else
tmp = ((-1.0d0) + (l + 1.0d0)) / (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.125) {
tmp = l + (w * ((w * ((l - (l * 0.5)) + (w * (((l * 0.5) - l) - ((l * 0.16666666666666666) + (l * -0.5)))))) - l));
} else {
tmp = (-1.0 + (l + 1.0)) / (1.0 - (w * (-1.0 - (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.125: tmp = l + (w * ((w * ((l - (l * 0.5)) + (w * (((l * 0.5) - l) - ((l * 0.16666666666666666) + (l * -0.5)))))) - l)) else: tmp = (-1.0 + (l + 1.0)) / (1.0 - (w * (-1.0 - (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.125) tmp = Float64(l + Float64(w * Float64(Float64(w * Float64(Float64(l - Float64(l * 0.5)) + Float64(w * Float64(Float64(Float64(l * 0.5) - l) - Float64(Float64(l * 0.16666666666666666) + Float64(l * -0.5)))))) - l))); else tmp = Float64(Float64(-1.0 + Float64(l + 1.0)) / 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.125) tmp = l + (w * ((w * ((l - (l * 0.5)) + (w * (((l * 0.5) - l) - ((l * 0.16666666666666666) + (l * -0.5)))))) - l)); else tmp = (-1.0 + (l + 1.0)) / (1.0 - (w * (-1.0 - (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.125], N[(l + N[(w * N[(N[(w * N[(N[(l - N[(l * 0.5), $MachinePrecision]), $MachinePrecision] + N[(w * N[(N[(N[(l * 0.5), $MachinePrecision] - l), $MachinePrecision] - N[(N[(l * 0.16666666666666666), $MachinePrecision] + N[(l * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 + N[(l + 1.0), $MachinePrecision]), $MachinePrecision] / 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.125:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \left(\left(\ell - \ell \cdot 0.5\right) + w \cdot \left(\left(\ell \cdot 0.5 - \ell\right) - \left(\ell \cdot 0.16666666666666666 + \ell \cdot -0.5\right)\right)\right) - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 + \left(\ell + 1\right)}{1 - w \cdot \left(-1 - w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 0.125Initial 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-sqrt33.7%
sqrt-unprod76.3%
sqr-neg76.3%
sqrt-unprod42.6%
add-sqr-sqrt75.9%
add-sqr-sqrt75.9%
sqrt-unprod75.9%
add-sqr-sqrt42.6%
sqrt-unprod75.9%
sqr-neg75.9%
sqrt-unprod33.3%
add-sqr-sqrt61.8%
pow161.8%
exp-neg61.8%
inv-pow61.8%
pow-prod-up97.9%
metadata-eval97.9%
metadata-eval97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Taylor expanded in w around 0 82.7%
if 0.125 < 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 70.0%
*-commutative70.0%
Simplified70.0%
*-rgt-identity70.0%
expm1-log1p-u70.0%
expm1-undefine97.4%
log1p-undefine97.4%
rem-exp-log97.4%
+-commutative97.4%
Applied egg-rr97.4%
Final simplification84.8%
(FPCore (w l) :precision binary64 (if (<= w 0.15) (* l (+ 1.0 (* w (+ -1.0 (* w 0.5))))) (/ (+ -1.0 (+ l 1.0)) (- 1.0 (* w (- -1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 0.15) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} else {
tmp = (-1.0 + (l + 1.0)) / (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.15d0) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * 0.5d0))))
else
tmp = ((-1.0d0) + (l + 1.0d0)) / (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.15) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} else {
tmp = (-1.0 + (l + 1.0)) / (1.0 - (w * (-1.0 - (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.15: tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))) else: tmp = (-1.0 + (l + 1.0)) / (1.0 - (w * (-1.0 - (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.15) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * 0.5))))); else tmp = Float64(Float64(-1.0 + Float64(l + 1.0)) / 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.15) tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))); else tmp = (-1.0 + (l + 1.0)) / (1.0 - (w * (-1.0 - (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.15], N[(l * N[(1.0 + N[(w * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 + N[(l + 1.0), $MachinePrecision]), $MachinePrecision] / 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.15:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 + \left(\ell + 1\right)}{1 - w \cdot \left(-1 - w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 0.149999999999999994Initial program 99.7%
Taylor expanded in w around 0 82.4%
add-sqr-sqrt33.7%
sqrt-unprod76.3%
sqr-neg76.3%
sqrt-unprod42.6%
add-sqr-sqrt75.9%
add-sqr-sqrt75.9%
sqrt-unprod75.9%
add-sqr-sqrt42.6%
sqrt-unprod75.9%
sqr-neg75.9%
sqrt-unprod33.3%
add-sqr-sqrt61.8%
pow161.8%
exp-neg61.8%
inv-pow61.8%
pow-prod-up97.9%
metadata-eval97.9%
metadata-eval97.9%
metadata-eval97.9%
Applied egg-rr82.1%
if 0.149999999999999994 < 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 70.0%
*-commutative70.0%
Simplified70.0%
*-rgt-identity70.0%
expm1-log1p-u70.0%
expm1-undefine97.4%
log1p-undefine97.4%
rem-exp-log97.4%
+-commutative97.4%
Applied egg-rr97.4%
Final simplification84.3%
(FPCore (w l) :precision binary64 (if (<= w -4e-7) (* l (+ 1.0 (* w (+ -1.0 (* w 0.5))))) (/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -4e-7) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} 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 <= (-4d-7)) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * 0.5d0))))
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 <= -4e-7) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -4e-7: tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))) 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 <= -4e-7) 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(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 <= -4e-7) tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))); 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, -4e-7], 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[(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 -4 \cdot 10^{-7}:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot 0.5\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 < -3.9999999999999998e-7Initial program 99.7%
Taylor expanded in w around 0 53.5%
add-sqr-sqrt0.0%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod38.4%
add-sqr-sqrt38.4%
add-sqr-sqrt38.4%
sqrt-unprod38.4%
add-sqr-sqrt38.4%
sqrt-unprod38.4%
sqr-neg38.4%
sqrt-unprod0.0%
add-sqr-sqrt0.7%
pow10.7%
exp-neg0.7%
inv-pow0.7%
pow-prod-up97.0%
metadata-eval97.0%
metadata-eval97.0%
metadata-eval97.0%
Applied egg-rr55.0%
if -3.9999999999999998e-7 < w Initial 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-sqrt63.7%
sqrt-unprod99.1%
sqr-neg99.1%
sqrt-unprod35.5%
add-sqr-sqrt98.7%
add-sqr-sqrt98.7%
sqrt-unprod98.7%
add-sqr-sqrt35.5%
sqrt-unprod77.4%
sqr-neg77.4%
sqrt-unprod41.9%
add-sqr-sqrt77.5%
pow177.5%
exp-neg77.5%
inv-pow77.5%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in l around 0 98.7%
Taylor expanded in w around 0 94.7%
*-commutative94.7%
Simplified94.7%
Final simplification82.0%
(FPCore (w l) :precision binary64 (if (<= w -220.0) (* l (+ 1.0 (* w (+ -1.0 (* w 0.5))))) (/ l (- 1.0 (* w (- -1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -220.0) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} 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 <= (-220.0d0)) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * 0.5d0))))
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 <= -220.0) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} else {
tmp = l / (1.0 - (w * (-1.0 - (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -220.0: tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))) else: tmp = l / (1.0 - (w * (-1.0 - (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -220.0) 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(-1.0 - Float64(w * 0.5))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -220.0) tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))); else tmp = l / (1.0 - (w * (-1.0 - (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -220.0], 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[(-1.0 - N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -220:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 - w \cdot \left(-1 - w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -220Initial program 100.0%
Taylor expanded in w around 0 53.2%
add-sqr-sqrt0.0%
sqrt-unprod39.2%
sqr-neg39.2%
sqrt-unprod39.2%
add-sqr-sqrt39.2%
add-sqr-sqrt39.2%
sqrt-unprod39.2%
add-sqr-sqrt39.2%
sqrt-unprod39.2%
sqr-neg39.2%
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-rr56.4%
if -220 < w Initial program 99.6%
exp-neg99.6%
remove-double-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
remove-double-neg99.6%
Simplified99.6%
add-sqr-sqrt62.6%
sqrt-unprod97.7%
sqr-neg97.7%
sqrt-unprod35.2%
add-sqr-sqrt97.3%
add-sqr-sqrt97.3%
sqrt-unprod97.3%
add-sqr-sqrt35.2%
sqrt-unprod76.4%
sqr-neg76.4%
sqrt-unprod41.2%
add-sqr-sqrt76.4%
pow176.4%
exp-neg76.4%
inv-pow76.4%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr97.4%
Taylor expanded in l around 0 97.4%
Taylor expanded in w around 0 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification80.4%
(FPCore (w l) :precision binary64 (if (<= w -0.032) (- l (* w (+ l (* w (* l -0.5))))) (/ l (- 1.0 (* w (- -1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -0.032) {
tmp = l - (w * (l + (w * (l * -0.5))));
} 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.032d0)) then
tmp = l - (w * (l + (w * (l * (-0.5d0)))))
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.032) {
tmp = l - (w * (l + (w * (l * -0.5))));
} else {
tmp = l / (1.0 - (w * (-1.0 - (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.032: tmp = l - (w * (l + (w * (l * -0.5)))) else: tmp = l / (1.0 - (w * (-1.0 - (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.032) tmp = Float64(l - Float64(w * Float64(l + Float64(w * Float64(l * -0.5))))); 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.032) tmp = l - (w * (l + (w * (l * -0.5)))); else tmp = l / (1.0 - (w * (-1.0 - (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.032], N[(l - N[(w * N[(l + N[(w * N[(l * -0.5), $MachinePrecision]), $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.032:\\
\;\;\;\;\ell - w \cdot \left(\ell + w \cdot \left(\ell \cdot -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 - w \cdot \left(-1 - w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -0.032000000000000001Initial 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-sqrt0.0%
sqrt-unprod39.2%
sqr-neg39.2%
sqrt-unprod39.2%
add-sqr-sqrt39.2%
add-sqr-sqrt39.2%
sqrt-unprod39.2%
add-sqr-sqrt39.2%
sqrt-unprod39.2%
sqr-neg39.2%
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 44.5%
associate-*r*44.5%
neg-mul-144.5%
distribute-rgt-out44.5%
metadata-eval44.5%
Simplified44.5%
if -0.032000000000000001 < w Initial program 99.6%
exp-neg99.6%
remove-double-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
remove-double-neg99.6%
Simplified99.6%
add-sqr-sqrt62.6%
sqrt-unprod97.7%
sqr-neg97.7%
sqrt-unprod35.2%
add-sqr-sqrt97.3%
add-sqr-sqrt97.3%
sqrt-unprod97.3%
add-sqr-sqrt35.2%
sqrt-unprod76.4%
sqr-neg76.4%
sqrt-unprod41.2%
add-sqr-sqrt76.4%
pow176.4%
exp-neg76.4%
inv-pow76.4%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr97.4%
Taylor expanded in l around 0 97.4%
Taylor expanded in w around 0 91.1%
*-commutative91.1%
Simplified91.1%
Final simplification76.7%
(FPCore (w l) :precision binary64 (if (<= w -0.008) (* l (- w)) (/ l (- 1.0 (* w (- -1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -0.008) {
tmp = l * -w;
} 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.008d0)) then
tmp = l * -w
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.008) {
tmp = l * -w;
} else {
tmp = l / (1.0 - (w * (-1.0 - (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.008: tmp = l * -w else: tmp = l / (1.0 - (w * (-1.0 - (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.008) tmp = Float64(l * Float64(-w)); 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.008) tmp = l * -w; else tmp = l / (1.0 - (w * (-1.0 - (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.008], N[(l * (-w)), $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.008:\\
\;\;\;\;\ell \cdot \left(-w\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 - w \cdot \left(-1 - w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -0.0080000000000000002Initial 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-sqrt0.0%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod38.6%
add-sqr-sqrt38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod0.0%
add-sqr-sqrt0.4%
pow10.4%
exp-neg0.4%
inv-pow0.4%
pow-prod-up97.9%
metadata-eval97.9%
metadata-eval97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Taylor expanded in w around 0 25.6%
mul-1-neg25.6%
unsub-neg25.6%
Simplified25.6%
Taylor expanded in w around inf 25.7%
associate-*r*25.7%
neg-mul-125.7%
*-commutative25.7%
Simplified25.7%
if -0.0080000000000000002 < w Initial 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-sqrt63.3%
sqrt-unprod98.7%
sqr-neg98.7%
sqrt-unprod35.4%
add-sqr-sqrt98.2%
add-sqr-sqrt98.2%
sqrt-unprod98.2%
add-sqr-sqrt35.4%
sqrt-unprod77.1%
sqr-neg77.1%
sqrt-unprod41.7%
add-sqr-sqrt77.2%
pow177.2%
exp-neg77.2%
inv-pow77.2%
pow-prod-up98.3%
metadata-eval98.3%
metadata-eval98.3%
metadata-eval98.3%
Applied egg-rr98.3%
Taylor expanded in l around 0 98.3%
Taylor expanded in w around 0 92.0%
*-commutative92.0%
Simplified92.0%
Final simplification71.0%
(FPCore (w l) :precision binary64 (if (<= w -0.0102) (* l (- w)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.0102) {
tmp = l * -w;
} 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.0102d0)) then
tmp = l * -w
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.0102) {
tmp = l * -w;
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.0102: tmp = l * -w else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.0102) tmp = Float64(l * Float64(-w)); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.0102) tmp = l * -w; else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.0102], N[(l * (-w)), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.0102:\\
\;\;\;\;\ell \cdot \left(-w\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -0.010200000000000001Initial 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-sqrt0.0%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod38.6%
add-sqr-sqrt38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod0.0%
add-sqr-sqrt0.4%
pow10.4%
exp-neg0.4%
inv-pow0.4%
pow-prod-up97.9%
metadata-eval97.9%
metadata-eval97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Taylor expanded in w around 0 25.6%
mul-1-neg25.6%
unsub-neg25.6%
Simplified25.6%
Taylor expanded in w around inf 25.7%
associate-*r*25.7%
neg-mul-125.7%
*-commutative25.7%
Simplified25.7%
if -0.010200000000000001 < w Initial 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-sqrt63.3%
sqrt-unprod98.7%
sqr-neg98.7%
sqrt-unprod35.4%
add-sqr-sqrt98.2%
add-sqr-sqrt98.2%
sqrt-unprod98.2%
add-sqr-sqrt35.4%
sqrt-unprod77.1%
sqr-neg77.1%
sqrt-unprod41.7%
add-sqr-sqrt77.2%
pow177.2%
exp-neg77.2%
inv-pow77.2%
pow-prod-up98.3%
metadata-eval98.3%
metadata-eval98.3%
metadata-eval98.3%
Applied egg-rr98.3%
Taylor expanded in l around 0 98.3%
Taylor expanded in w around 0 87.2%
+-commutative87.2%
Simplified87.2%
Final simplification67.7%
(FPCore (w l) :precision binary64 (if (<= w -0.012) (* l (- w)) l))
double code(double w, double l) {
double tmp;
if (w <= -0.012) {
tmp = l * -w;
} 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.012d0)) then
tmp = l * -w
else
tmp = l
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.012) {
tmp = l * -w;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.012: tmp = l * -w else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -0.012) tmp = Float64(l * Float64(-w)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.012) tmp = l * -w; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.012], N[(l * (-w)), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.012:\\
\;\;\;\;\ell \cdot \left(-w\right)\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -0.012Initial 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-sqrt0.0%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod38.6%
add-sqr-sqrt38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
add-sqr-sqrt38.6%
sqrt-unprod38.6%
sqr-neg38.6%
sqrt-unprod0.0%
add-sqr-sqrt0.4%
pow10.4%
exp-neg0.4%
inv-pow0.4%
pow-prod-up97.9%
metadata-eval97.9%
metadata-eval97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Taylor expanded in w around 0 25.6%
mul-1-neg25.6%
unsub-neg25.6%
Simplified25.6%
Taylor expanded in w around inf 25.7%
associate-*r*25.7%
neg-mul-125.7%
*-commutative25.7%
Simplified25.7%
if -0.012 < w Initial program 99.7%
Taylor expanded in w around 0 78.3%
Final simplification61.7%
(FPCore (w l) :precision binary64 (- l (* l w)))
double code(double w, double l) {
return l - (l * w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l - (l * w)
end function
public static double code(double w, double l) {
return l - (l * w);
}
def code(w, l): return l - (l * w)
function code(w, l) return Float64(l - Float64(l * w)) end
function tmp = code(w, l) tmp = l - (l * w); end
code[w_, l_] := N[(l - N[(l * w), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell - \ell \cdot w
\end{array}
Initial 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-sqrt43.3%
sqrt-unprod79.7%
sqr-neg79.7%
sqrt-unprod36.4%
add-sqr-sqrt79.4%
add-sqr-sqrt79.4%
sqrt-unprod79.4%
add-sqr-sqrt36.4%
sqrt-unprod64.9%
sqr-neg64.9%
sqrt-unprod28.5%
add-sqr-sqrt52.9%
pow152.9%
exp-neg52.9%
inv-pow52.9%
pow-prod-up98.2%
metadata-eval98.2%
metadata-eval98.2%
metadata-eval98.2%
Applied egg-rr98.2%
Taylor expanded in w around 0 61.3%
mul-1-neg61.3%
unsub-neg61.3%
Simplified61.3%
(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.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt43.3%
sqrt-unprod79.7%
sqr-neg79.7%
sqrt-unprod36.4%
add-sqr-sqrt79.4%
add-sqr-sqrt79.4%
sqrt-unprod79.4%
add-sqr-sqrt36.4%
sqrt-unprod64.9%
sqr-neg64.9%
sqrt-unprod28.5%
add-sqr-sqrt52.9%
pow152.9%
exp-neg52.9%
inv-pow52.9%
pow-prod-up98.2%
metadata-eval98.2%
metadata-eval98.2%
metadata-eval98.2%
Applied egg-rr98.2%
Taylor expanded in l around 0 98.2%
Taylor expanded in w around 0 61.3%
mul-1-neg61.3%
*-rgt-identity61.3%
distribute-rgt-neg-in61.3%
distribute-lft-in61.3%
sub-neg61.3%
Simplified61.3%
(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.7%
Taylor expanded in w around 0 54.7%
herbie shell --seed 2024150
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))