
(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 11 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.6%
exp-neg99.6%
remove-double-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
remove-double-neg99.6%
Simplified99.6%
(FPCore (w l)
:precision binary64
(if (<= w -1.6)
(/ l (exp w))
(/
(pow l (exp w))
(+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -1.6) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) / (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 <= (-1.6d0)) then
tmp = l / exp(w)
else
tmp = (l ** exp(w)) / (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 <= -1.6) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.6: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.6) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) / 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 <= -1.6) tmp = l / exp(w); else tmp = (l ^ exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.6], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / 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 -1.6:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < -1.6000000000000001Initial 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-unprod51.3%
sqr-neg51.3%
sqrt-unprod51.3%
add-sqr-sqrt51.3%
add-sqr-sqrt51.3%
sqrt-unprod51.3%
add-sqr-sqrt51.3%
sqrt-unprod51.3%
sqr-neg51.3%
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 l around 0 100.0%
if -1.6000000000000001 < w Initial program 99.5%
exp-neg99.5%
remove-double-neg99.5%
associate-*l/99.5%
*-lft-identity99.5%
remove-double-neg99.5%
Simplified99.5%
Taylor expanded in w around 0 99.1%
*-commutative99.1%
Simplified99.1%
(FPCore (w l) :precision binary64 (let* ((t_0 (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))) (if (<= w -1.6) (/ l (exp w)) (/ (pow l t_0) t_0))))
double code(double w, double l) {
double t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))));
double tmp;
if (w <= -1.6) {
tmp = l / exp(w);
} else {
tmp = pow(l, t_0) / t_0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0)))))
if (w <= (-1.6d0)) then
tmp = l / exp(w)
else
tmp = (l ** t_0) / t_0
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))));
double tmp;
if (w <= -1.6) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, t_0) / t_0;
}
return tmp;
}
def code(w, l): t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))) tmp = 0 if w <= -1.6: tmp = l / math.exp(w) else: tmp = math.pow(l, t_0) / t_0 return tmp
function code(w, l) t_0 = Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666)))))) tmp = 0.0 if (w <= -1.6) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ t_0) / t_0); end return tmp end
function tmp_2 = code(w, l) t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))); tmp = 0.0; if (w <= -1.6) tmp = l / exp(w); else tmp = (l ^ t_0) / t_0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[(1.0 + N[(w * N[(1.0 + N[(w * N[(0.5 + N[(w * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -1.6], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\\
\mathbf{if}\;w \leq -1.6:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\
\end{array}
\end{array}
if w < -1.6000000000000001Initial 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-unprod51.3%
sqr-neg51.3%
sqrt-unprod51.3%
add-sqr-sqrt51.3%
add-sqr-sqrt51.3%
sqrt-unprod51.3%
add-sqr-sqrt51.3%
sqrt-unprod51.3%
sqr-neg51.3%
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 l around 0 100.0%
if -1.6000000000000001 < w Initial program 99.5%
exp-neg99.5%
remove-double-neg99.5%
associate-*l/99.5%
*-lft-identity99.5%
remove-double-neg99.5%
Simplified99.5%
Taylor expanded in w around 0 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in w around 0 98.8%
*-commutative99.1%
Simplified98.8%
(FPCore (w l)
:precision binary64
(if (<= w -62000000000.0)
(/ l (exp w))
(/
(pow l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))
(+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -62000000000.0) {
tmp = l / exp(w);
} else {
tmp = pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (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 <= (-62000000000.0d0)) then
tmp = l / exp(w)
else
tmp = (l ** (1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0))))))) / (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 <= -62000000000.0) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -62000000000.0: tmp = l / math.exp(w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -62000000000.0) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666))))))) / 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 <= -62000000000.0) tmp = l / exp(w); else tmp = (l ^ (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -62000000000.0], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[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] / 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 -62000000000:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)}}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -6.2e10Initial 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-unprod52.7%
sqr-neg52.7%
sqrt-unprod52.7%
add-sqr-sqrt52.7%
add-sqr-sqrt52.7%
sqrt-unprod52.7%
add-sqr-sqrt52.7%
sqrt-unprod52.7%
sqr-neg52.7%
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 l around 0 100.0%
if -6.2e10 < w Initial program 99.5%
exp-neg99.5%
remove-double-neg99.5%
associate-*l/99.5%
*-lft-identity99.5%
remove-double-neg99.5%
Simplified99.5%
Taylor expanded in w around 0 97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in w around 0 98.7%
*-commutative98.0%
Simplified98.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.6%
exp-neg99.6%
remove-double-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
remove-double-neg99.6%
Simplified99.6%
add-sqr-sqrt37.7%
sqrt-unprod84.2%
sqr-neg84.2%
sqrt-unprod46.5%
add-sqr-sqrt82.7%
add-sqr-sqrt82.7%
sqrt-unprod82.7%
add-sqr-sqrt46.5%
sqrt-unprod71.1%
sqr-neg71.1%
sqrt-unprod24.5%
add-sqr-sqrt55.9%
pow155.9%
exp-neg55.9%
inv-pow55.9%
pow-prod-up97.3%
metadata-eval97.3%
metadata-eval97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Taylor expanded in l around 0 97.3%
(FPCore (w l) :precision binary64 (if (<= w 0.46) (+ 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.46) {
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.46d0) 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.46) {
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.46: 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.46) 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.46) 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.46], 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.46:\\
\;\;\;\;\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.46000000000000002Initial 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-sqrt29.1%
sqrt-unprod82.0%
sqr-neg82.0%
sqrt-unprod53.0%
add-sqr-sqrt80.8%
add-sqr-sqrt80.8%
sqrt-unprod80.8%
add-sqr-sqrt53.0%
sqrt-unprod80.8%
sqr-neg80.8%
sqrt-unprod27.9%
add-sqr-sqrt63.5%
pow163.5%
exp-neg63.5%
inv-pow63.5%
pow-prod-up97.3%
metadata-eval97.3%
metadata-eval97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Taylor expanded in w around 0 90.1%
Taylor expanded in l around 0 90.1%
*-commutative90.1%
*-commutative90.1%
associate-*l*90.1%
Simplified90.1%
Taylor expanded in l around 0 90.9%
if 0.46000000000000002 < 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-sqrt96.9%
add-sqr-sqrt96.9%
sqrt-unprod96.9%
add-sqr-sqrt0.0%
sqrt-unprod0.1%
sqr-neg0.1%
sqrt-unprod0.1%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up96.9%
metadata-eval96.9%
metadata-eval96.9%
metadata-eval96.9%
Applied egg-rr96.9%
Taylor expanded in w around 0 3.2%
mul-1-neg3.2%
unsub-neg3.2%
Simplified3.2%
Taylor expanded in w around inf 3.2%
mul-1-neg3.2%
distribute-rgt-neg-in3.2%
Simplified3.2%
add-sqr-sqrt0.0%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-unprod3.3%
add-sqr-sqrt3.3%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.5%
add-sqr-sqrt1.5%
sqrt-unprod1.5%
add-sqr-sqrt0.0%
sqrt-unprod0.1%
sqr-neg0.1%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up96.8%
metadata-eval96.8%
metadata-eval96.8%
Applied egg-rr96.8%
Final simplification91.6%
(FPCore (w l) :precision binary64 (if (<= w 5.8) (+ l (* w (- (* l (* w 0.5)) l))) (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 5.8) {
tmp = l + (w * ((l * (w * 0.5)) - 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 <= 5.8d0) then
tmp = l + (w * ((l * (w * 0.5d0)) - l))
else
tmp = l * 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 5.8) {
tmp = l + (w * ((l * (w * 0.5)) - l));
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 5.8: tmp = l + (w * ((l * (w * 0.5)) - l)) else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 5.8) tmp = Float64(l + Float64(w * Float64(Float64(l * Float64(w * 0.5)) - l))); else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 5.8) tmp = l + (w * ((l * (w * 0.5)) - l)); else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 5.8], N[(l + N[(w * N[(N[(l * N[(w * 0.5), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 5.8:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \left(w \cdot 0.5\right) - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 5.79999999999999982Initial 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-sqrt29.4%
sqrt-unprod82.1%
sqr-neg82.1%
sqrt-unprod52.7%
add-sqr-sqrt80.5%
add-sqr-sqrt80.5%
sqrt-unprod80.5%
add-sqr-sqrt52.7%
sqrt-unprod80.5%
sqr-neg80.5%
sqrt-unprod27.8%
add-sqr-sqrt63.3%
pow163.3%
exp-neg63.3%
inv-pow63.3%
pow-prod-up96.9%
metadata-eval96.9%
metadata-eval96.9%
metadata-eval96.9%
Applied egg-rr96.9%
Taylor expanded in w around 0 89.7%
Taylor expanded in l around 0 89.7%
*-commutative89.7%
*-commutative89.7%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in w around 0 84.4%
mul-1-neg84.4%
distribute-rgt-out84.4%
metadata-eval84.4%
*-commutative84.4%
distribute-lft-neg-in84.4%
distribute-rgt-neg-in84.4%
metadata-eval84.4%
associate-*l*84.4%
*-commutative84.4%
Simplified84.4%
if 5.79999999999999982 < 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.3%
mul-1-neg3.3%
unsub-neg3.3%
Simplified3.3%
Taylor expanded in w around inf 3.3%
mul-1-neg3.3%
distribute-rgt-neg-in3.3%
Simplified3.3%
add-sqr-sqrt0.0%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-unprod3.3%
add-sqr-sqrt3.3%
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 -1.05) (* l (- w)) (if (<= w 5.8) l (* l 0.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.05) {
tmp = l * -w;
} else if (w <= 5.8) {
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 <= (-1.05d0)) then
tmp = l * -w
else if (w <= 5.8d0) 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 <= -1.05) {
tmp = l * -w;
} else if (w <= 5.8) {
tmp = l;
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.05: tmp = l * -w elif w <= 5.8: tmp = l else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -1.05) tmp = Float64(l * Float64(-w)); elseif (w <= 5.8) tmp = l; else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.05) tmp = l * -w; elseif (w <= 5.8) tmp = l; else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.05], N[(l * (-w)), $MachinePrecision], If[LessEqual[w, 5.8], l, N[(l * 0.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.05:\\
\;\;\;\;\ell \cdot \left(-w\right)\\
\mathbf{elif}\;w \leq 5.8:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < -1.05000000000000004Initial 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-unprod51.3%
sqr-neg51.3%
sqrt-unprod51.3%
add-sqr-sqrt51.3%
add-sqr-sqrt51.3%
sqrt-unprod51.3%
add-sqr-sqrt51.3%
sqrt-unprod51.3%
sqr-neg51.3%
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 29.1%
mul-1-neg29.1%
unsub-neg29.1%
Simplified29.1%
Taylor expanded in w around inf 29.1%
mul-1-neg29.1%
distribute-rgt-neg-in29.1%
Simplified29.1%
if -1.05000000000000004 < w < 5.79999999999999982Initial program 99.3%
Taylor expanded in w around 0 95.3%
if 5.79999999999999982 < 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.3%
mul-1-neg3.3%
unsub-neg3.3%
Simplified3.3%
Taylor expanded in w around inf 3.3%
mul-1-neg3.3%
distribute-rgt-neg-in3.3%
Simplified3.3%
add-sqr-sqrt0.0%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-unprod3.3%
add-sqr-sqrt3.3%
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.23) (* l (- 1.0 w)) (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.23) {
tmp = l * (1.0 - w);
} 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 * (1.0d0 - w)
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 * (1.0 - w);
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.23: tmp = l * (1.0 - w) else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.23) tmp = Float64(l * Float64(1.0 - w)); 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 * (1.0 - w); else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.23], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.23:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 0.23000000000000001Initial 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-sqrt29.1%
sqrt-unprod82.0%
sqr-neg82.0%
sqrt-unprod53.0%
add-sqr-sqrt80.8%
add-sqr-sqrt80.8%
sqrt-unprod80.8%
add-sqr-sqrt53.0%
sqrt-unprod80.8%
sqr-neg80.8%
sqrt-unprod27.9%
add-sqr-sqrt63.5%
pow163.5%
exp-neg63.5%
inv-pow63.5%
pow-prod-up97.3%
metadata-eval97.3%
metadata-eval97.3%
metadata-eval97.3%
Applied egg-rr97.3%
Taylor expanded in w around 0 73.3%
mul-1-neg73.3%
unsub-neg73.3%
Simplified73.3%
Taylor expanded in l around 0 73.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-sqrt96.9%
add-sqr-sqrt96.9%
sqrt-unprod96.9%
add-sqr-sqrt0.0%
sqrt-unprod0.1%
sqr-neg0.1%
sqrt-unprod0.1%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up96.9%
metadata-eval96.9%
metadata-eval96.9%
metadata-eval96.9%
Applied egg-rr96.9%
Taylor expanded in w around 0 3.2%
mul-1-neg3.2%
unsub-neg3.2%
Simplified3.2%
Taylor expanded in w around inf 3.2%
mul-1-neg3.2%
distribute-rgt-neg-in3.2%
Simplified3.2%
add-sqr-sqrt0.0%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-unprod3.3%
add-sqr-sqrt3.3%
add-log-exp1.6%
pow11.6%
pow11.6%
add-sqr-sqrt1.6%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod0.0%
add-sqr-sqrt1.5%
add-sqr-sqrt1.5%
sqrt-unprod1.5%
add-sqr-sqrt0.0%
sqrt-unprod0.1%
sqr-neg0.1%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up96.8%
metadata-eval96.8%
metadata-eval96.8%
Applied egg-rr96.8%
(FPCore (w l) :precision binary64 (if (<= w 5.8) l (* l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= 5.8) {
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 <= 5.8d0) 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 <= 5.8) {
tmp = l;
} else {
tmp = l * 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 5.8: tmp = l else: tmp = l * 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 5.8) tmp = l; else tmp = Float64(l * 0.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 5.8) tmp = l; else tmp = l * 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 5.8], l, N[(l * 0.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 5.8:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot 0\\
\end{array}
\end{array}
if w < 5.79999999999999982Initial program 99.6%
Taylor expanded in w around 0 64.5%
if 5.79999999999999982 < 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.3%
mul-1-neg3.3%
unsub-neg3.3%
Simplified3.3%
Taylor expanded in w around inf 3.3%
mul-1-neg3.3%
distribute-rgt-neg-in3.3%
Simplified3.3%
add-sqr-sqrt0.0%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-unprod3.3%
add-sqr-sqrt3.3%
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.6%
Taylor expanded in w around 0 57.6%
herbie shell --seed 2024135
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))