
(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.1%
(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.1%
exp-neg99.1%
remove-double-neg99.1%
associate-*l/99.1%
*-lft-identity99.1%
remove-double-neg99.1%
Simplified99.1%
(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.1%
add-sqr-sqrt50.7%
sqrt-unprod88.7%
sqr-neg88.7%
sqrt-unprod38.0%
add-sqr-sqrt87.5%
add-sqr-sqrt87.5%
sqrt-unprod87.5%
add-sqr-sqrt38.0%
sqrt-unprod62.1%
sqr-neg62.1%
sqrt-unprod24.1%
add-sqr-sqrt53.6%
pow153.6%
exp-neg53.6%
inv-pow53.6%
pow-prod-up98.1%
metadata-eval98.1%
metadata-eval98.1%
metadata-eval98.1%
Applied egg-rr98.1%
Final simplification98.1%
(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.1%
add-sqr-sqrt50.7%
sqrt-unprod88.7%
sqr-neg88.7%
sqrt-unprod38.0%
add-sqr-sqrt87.5%
add-sqr-sqrt87.5%
sqrt-unprod87.5%
add-sqr-sqrt38.0%
sqrt-unprod62.1%
sqr-neg62.1%
sqrt-unprod24.1%
add-sqr-sqrt53.6%
pow153.6%
exp-neg53.6%
inv-pow53.6%
pow-prod-up98.1%
metadata-eval98.1%
metadata-eval98.1%
metadata-eval98.1%
Applied egg-rr98.1%
Taylor expanded in w around inf 98.1%
exp-neg98.1%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
(FPCore (w l) :precision binary64 (if (<= w 0.35) (* 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.35) {
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.35d0) 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.35) {
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.35: 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.35) 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.35) 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.35], 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.35:\\
\;\;\;\;\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.34999999999999998Initial program 99.8%
add-sqr-sqrt33.2%
sqrt-unprod85.6%
sqr-neg85.6%
sqrt-unprod52.4%
add-sqr-sqrt84.9%
add-sqr-sqrt84.9%
sqrt-unprod84.9%
add-sqr-sqrt52.4%
sqrt-unprod84.9%
sqr-neg84.9%
sqrt-unprod32.6%
add-sqr-sqrt73.1%
pow173.1%
exp-neg73.1%
inv-pow73.1%
pow-prod-up98.9%
metadata-eval98.9%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Taylor expanded in w around 0 93.8%
Taylor expanded in w around inf 93.8%
*-commutative93.8%
Simplified93.8%
if 0.34999999999999998 < w Initial program 97.1%
add-sqr-sqrt97.1%
sqrt-unprod97.1%
sqr-neg97.1%
sqrt-unprod0.0%
add-sqr-sqrt94.4%
add-sqr-sqrt94.4%
sqrt-unprod94.4%
add-sqr-sqrt0.0%
sqrt-unprod1.5%
sqr-neg1.5%
sqrt-unprod1.4%
add-sqr-sqrt1.5%
pow11.5%
exp-neg1.5%
inv-pow1.5%
pow-prod-up95.8%
metadata-eval95.8%
metadata-eval95.8%
metadata-eval95.8%
Applied egg-rr95.8%
Taylor expanded in w around inf 95.8%
exp-neg95.8%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
Taylor expanded in w around 0 81.9%
*-commutative81.9%
Simplified81.9%
Final simplification90.5%
(FPCore (w l) :precision binary64 (if (<= w 0.78) (* 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.78) {
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.78d0) 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.78) {
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.78: 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.78) 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.78) 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.78], 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.78:\\
\;\;\;\;\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.78000000000000003Initial program 99.8%
add-sqr-sqrt33.2%
sqrt-unprod85.6%
sqr-neg85.6%
sqrt-unprod52.4%
add-sqr-sqrt84.9%
add-sqr-sqrt84.9%
sqrt-unprod84.9%
add-sqr-sqrt52.4%
sqrt-unprod84.9%
sqr-neg84.9%
sqrt-unprod32.6%
add-sqr-sqrt73.1%
pow173.1%
exp-neg73.1%
inv-pow73.1%
pow-prod-up98.9%
metadata-eval98.9%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Taylor expanded in w around 0 93.8%
Taylor expanded in w around inf 93.8%
*-commutative93.8%
Simplified93.8%
if 0.78000000000000003 < w Initial program 97.1%
add-sqr-sqrt97.1%
sqrt-unprod97.1%
sqr-neg97.1%
sqrt-unprod0.0%
add-sqr-sqrt94.4%
add-sqr-sqrt94.4%
sqrt-unprod94.4%
add-sqr-sqrt0.0%
sqrt-unprod1.5%
sqr-neg1.5%
sqrt-unprod1.4%
add-sqr-sqrt1.5%
pow11.5%
exp-neg1.5%
inv-pow1.5%
pow-prod-up95.8%
metadata-eval95.8%
metadata-eval95.8%
metadata-eval95.8%
Applied egg-rr95.8%
Taylor expanded in w around inf 95.8%
exp-neg95.8%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
Taylor expanded in w around 0 73.5%
*-commutative73.5%
Simplified73.5%
Final simplification88.2%
(FPCore (w l) :precision binary64 (if (<= w -5e-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 <= -5e-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 <= (-5d-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 <= -5e-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 <= -5e-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 <= -5e-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 <= -5e-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, -5e-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 -5 \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 < -5.0000000000000002e-14Initial program 99.8%
add-sqr-sqrt0.0%
sqrt-unprod46.0%
sqr-neg46.0%
sqrt-unprod46.0%
add-sqr-sqrt46.0%
add-sqr-sqrt46.0%
sqrt-unprod46.0%
add-sqr-sqrt46.0%
sqrt-unprod46.0%
sqr-neg46.0%
sqrt-unprod0.0%
add-sqr-sqrt1.2%
pow11.2%
exp-neg1.2%
inv-pow1.2%
pow-prod-up99.1%
metadata-eval99.1%
metadata-eval99.1%
metadata-eval99.1%
Applied egg-rr99.1%
Taylor expanded in w around 0 69.7%
if -5.0000000000000002e-14 < w Initial program 98.9%
add-sqr-sqrt62.7%
sqrt-unprod98.8%
sqr-neg98.8%
sqrt-unprod36.2%
add-sqr-sqrt97.3%
add-sqr-sqrt97.3%
sqrt-unprod97.3%
add-sqr-sqrt36.2%
sqrt-unprod65.9%
sqr-neg65.9%
sqrt-unprod29.8%
add-sqr-sqrt66.0%
pow166.0%
exp-neg66.0%
inv-pow66.0%
pow-prod-up97.8%
metadata-eval97.8%
metadata-eval97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in w around inf 97.8%
exp-neg97.8%
associate-*r/97.8%
*-rgt-identity97.8%
Simplified97.8%
Taylor expanded in w around 0 90.3%
*-commutative90.3%
Simplified90.3%
Final simplification86.3%
(FPCore (w l) :precision binary64 (if (<= w -2e-10) (- 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 <= -2e-10) {
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 <= (-2d-10)) 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 <= -2e-10) {
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 <= -2e-10: 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 <= -2e-10) 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 <= -2e-10) 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, -2e-10], 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 -2 \cdot 10^{-10}:\\
\;\;\;\;\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 < -2.00000000000000007e-10Initial program 99.8%
add-sqr-sqrt0.0%
sqrt-unprod46.0%
sqr-neg46.0%
sqrt-unprod46.0%
add-sqr-sqrt46.0%
add-sqr-sqrt46.0%
sqrt-unprod46.0%
add-sqr-sqrt46.0%
sqrt-unprod46.0%
sqr-neg46.0%
sqrt-unprod0.0%
add-sqr-sqrt1.2%
pow11.2%
exp-neg1.2%
inv-pow1.2%
pow-prod-up99.1%
metadata-eval99.1%
metadata-eval99.1%
metadata-eval99.1%
Applied egg-rr99.1%
Taylor expanded in w around inf 99.1%
exp-neg99.1%
associate-*r/99.1%
*-rgt-identity99.1%
Simplified99.1%
Taylor expanded in w around 0 56.4%
sub-neg56.4%
distribute-lft-in56.4%
mul-1-neg56.4%
*-commutative56.4%
distribute-lft-neg-in56.4%
distribute-rgt-out56.4%
metadata-eval56.4%
*-commutative56.4%
distribute-lft-neg-in56.4%
metadata-eval56.4%
associate-*r*56.4%
distribute-lft-in56.4%
unsub-neg56.4%
Simplified56.4%
if -2.00000000000000007e-10 < w Initial program 98.9%
add-sqr-sqrt62.7%
sqrt-unprod98.8%
sqr-neg98.8%
sqrt-unprod36.2%
add-sqr-sqrt97.3%
add-sqr-sqrt97.3%
sqrt-unprod97.3%
add-sqr-sqrt36.2%
sqrt-unprod65.9%
sqr-neg65.9%
sqrt-unprod29.8%
add-sqr-sqrt66.0%
pow166.0%
exp-neg66.0%
inv-pow66.0%
pow-prod-up97.8%
metadata-eval97.8%
metadata-eval97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in w around inf 97.8%
exp-neg97.8%
associate-*r/97.8%
*-rgt-identity97.8%
Simplified97.8%
Taylor expanded in w around 0 90.3%
*-commutative90.3%
Simplified90.3%
Final simplification83.8%
(FPCore (w l) :precision binary64 (if (<= w 0.92) (- l (* w l)) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 0.92) {
tmp = l - (w * l);
} 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.92d0) then
tmp = l - (w * l)
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.92) {
tmp = l - (w * l);
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.92: tmp = l - (w * l) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.92) tmp = Float64(l - Float64(w * l)); 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.92) tmp = l - (w * l); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.92], N[(l - N[(w * l), $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.92:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 0.92000000000000004Initial program 99.8%
add-sqr-sqrt33.2%
sqrt-unprod85.6%
sqr-neg85.6%
sqrt-unprod52.4%
add-sqr-sqrt84.9%
add-sqr-sqrt84.9%
sqrt-unprod84.9%
add-sqr-sqrt52.4%
sqrt-unprod84.9%
sqr-neg84.9%
sqrt-unprod32.6%
add-sqr-sqrt73.1%
pow173.1%
exp-neg73.1%
inv-pow73.1%
pow-prod-up98.9%
metadata-eval98.9%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Taylor expanded in w around 0 79.6%
mul-1-neg79.6%
distribute-lft-neg-out79.6%
*-commutative79.6%
Simplified79.6%
if 0.92000000000000004 < w Initial program 97.1%
add-sqr-sqrt97.1%
sqrt-unprod97.1%
sqr-neg97.1%
sqrt-unprod0.0%
add-sqr-sqrt94.4%
add-sqr-sqrt94.4%
sqrt-unprod94.4%
add-sqr-sqrt0.0%
sqrt-unprod1.5%
sqr-neg1.5%
sqrt-unprod1.4%
add-sqr-sqrt1.5%
pow11.5%
exp-neg1.5%
inv-pow1.5%
pow-prod-up95.8%
metadata-eval95.8%
metadata-eval95.8%
metadata-eval95.8%
Applied egg-rr95.8%
Taylor expanded in w around inf 95.8%
exp-neg95.8%
associate-*r/95.8%
*-rgt-identity95.8%
Simplified95.8%
Taylor expanded in w around 0 73.5%
*-commutative73.5%
Simplified73.5%
Final simplification77.9%
(FPCore (w l) :precision binary64 (if (<= w 0.62) (- l (* w l)) (/ 1.0 (/ w l))))
double code(double w, double l) {
double tmp;
if (w <= 0.62) {
tmp = l - (w * l);
} else {
tmp = 1.0 / (w / 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.62d0) then
tmp = l - (w * l)
else
tmp = 1.0d0 / (w / l)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.62) {
tmp = l - (w * l);
} else {
tmp = 1.0 / (w / l);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.62: tmp = l - (w * l) else: tmp = 1.0 / (w / l) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.62) tmp = Float64(l - Float64(w * l)); else tmp = Float64(1.0 / Float64(w / l)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.62) tmp = l - (w * l); else tmp = 1.0 / (w / l); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.62], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(w / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.62:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{w}{\ell}}\\
\end{array}
\end{array}
if w < 0.619999999999999996Initial program 99.8%
add-sqr-sqrt33.2%
sqrt-unprod85.6%
sqr-neg85.6%
sqrt-unprod52.4%
add-sqr-sqrt84.9%
add-sqr-sqrt84.9%
sqrt-unprod84.9%
add-sqr-sqrt52.4%
sqrt-unprod84.9%
sqr-neg84.9%
sqrt-unprod32.6%
add-sqr-sqrt73.1%
pow173.1%
exp-neg73.1%
inv-pow73.1%
pow-prod-up98.9%
metadata-eval98.9%
metadata-eval98.9%
metadata-eval98.9%
Applied egg-rr98.9%
Taylor expanded in w around 0 79.6%
mul-1-neg79.6%
distribute-lft-neg-out79.6%
*-commutative79.6%
Simplified79.6%
if 0.619999999999999996 < w Initial program 97.1%
exp-neg97.1%
remove-double-neg97.1%
associate-*l/97.1%
*-lft-identity97.1%
remove-double-neg97.1%
Simplified97.1%
Taylor expanded in w around 0 98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in w around inf 98.6%
Taylor expanded in w around 0 53.3%
clear-num53.4%
inv-pow53.4%
Applied egg-rr53.4%
unpow-153.4%
Simplified53.4%
Final simplification72.4%
(FPCore (w l) :precision binary64 (if (<= w 0.22) l (/ 1.0 (/ w l))))
double code(double w, double l) {
double tmp;
if (w <= 0.22) {
tmp = l;
} else {
tmp = 1.0 / (w / 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.22d0) then
tmp = l
else
tmp = 1.0d0 / (w / l)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.22) {
tmp = l;
} else {
tmp = 1.0 / (w / l);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.22: tmp = l else: tmp = 1.0 / (w / l) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.22) tmp = l; else tmp = Float64(1.0 / Float64(w / l)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.22) tmp = l; else tmp = 1.0 / (w / l); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.22], l, N[(1.0 / N[(w / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.22:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{w}{\ell}}\\
\end{array}
\end{array}
if w < 0.220000000000000001Initial program 99.8%
Taylor expanded in w around 0 74.1%
if 0.220000000000000001 < w Initial program 97.1%
exp-neg97.1%
remove-double-neg97.1%
associate-*l/97.1%
*-lft-identity97.1%
remove-double-neg97.1%
Simplified97.1%
Taylor expanded in w around 0 98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in w around inf 98.6%
Taylor expanded in w around 0 53.3%
clear-num53.4%
inv-pow53.4%
Applied egg-rr53.4%
unpow-153.4%
Simplified53.4%
(FPCore (w l) :precision binary64 (if (<= w 0.55) l (/ l w)))
double code(double w, double l) {
double tmp;
if (w <= 0.55) {
tmp = l;
} else {
tmp = l / w;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.55d0) then
tmp = l
else
tmp = l / w
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.55) {
tmp = l;
} else {
tmp = l / w;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.55: tmp = l else: tmp = l / w return tmp
function code(w, l) tmp = 0.0 if (w <= 0.55) tmp = l; else tmp = Float64(l / w); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.55) tmp = l; else tmp = l / w; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.55], l, N[(l / w), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.55:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w}\\
\end{array}
\end{array}
if w < 0.55000000000000004Initial program 99.8%
Taylor expanded in w around 0 74.1%
if 0.55000000000000004 < w Initial program 97.1%
exp-neg97.1%
remove-double-neg97.1%
associate-*l/97.1%
*-lft-identity97.1%
remove-double-neg97.1%
Simplified97.1%
Taylor expanded in w around 0 98.6%
+-commutative98.6%
Simplified98.6%
Taylor expanded in w around inf 98.6%
Taylor expanded in w around 0 53.3%
(FPCore (w l) :precision binary64 (/ l (+ w 1.0)))
double code(double w, double l) {
return l / (w + 1.0);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l / (w + 1.0d0)
end function
public static double code(double w, double l) {
return l / (w + 1.0);
}
def code(w, l): return l / (w + 1.0)
function code(w, l) return Float64(l / Float64(w + 1.0)) end
function tmp = code(w, l) tmp = l / (w + 1.0); end
code[w_, l_] := N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{w + 1}
\end{array}
Initial program 99.1%
add-sqr-sqrt50.7%
sqrt-unprod88.7%
sqr-neg88.7%
sqrt-unprod38.0%
add-sqr-sqrt87.5%
add-sqr-sqrt87.5%
sqrt-unprod87.5%
add-sqr-sqrt38.0%
sqrt-unprod62.1%
sqr-neg62.1%
sqrt-unprod24.1%
add-sqr-sqrt53.6%
pow153.6%
exp-neg53.6%
inv-pow53.6%
pow-prod-up98.1%
metadata-eval98.1%
metadata-eval98.1%
metadata-eval98.1%
Applied egg-rr98.1%
Taylor expanded in w around inf 98.1%
exp-neg98.1%
associate-*r/98.1%
*-rgt-identity98.1%
Simplified98.1%
Taylor expanded in w around 0 67.9%
+-commutative80.7%
Simplified67.9%
(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.1%
Taylor expanded in w around 0 55.5%
herbie shell --seed 2024180
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))