
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
(FPCore (w l) :precision binary64 (let* ((t_0 (cbrt (exp w)))) (/ (* (pow t_0 -2.0) (pow l (exp w))) t_0)))
double code(double w, double l) {
double t_0 = cbrt(exp(w));
return (pow(t_0, -2.0) * pow(l, exp(w))) / t_0;
}
public static double code(double w, double l) {
double t_0 = Math.cbrt(Math.exp(w));
return (Math.pow(t_0, -2.0) * Math.pow(l, Math.exp(w))) / t_0;
}
function code(w, l) t_0 = cbrt(exp(w)) return Float64(Float64((t_0 ^ -2.0) * (l ^ exp(w))) / t_0) end
code[w_, l_] := Block[{t$95$0 = N[Power[N[Exp[w], $MachinePrecision], 1/3], $MachinePrecision]}, N[(N[(N[Power[t$95$0, -2.0], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt[3]{e^{w}}\\
\frac{{t_0}^{-2} \cdot {\ell}^{\left(e^{w}\right)}}{t_0}
\end{array}
\end{array}
Initial program 99.7%
exp-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
add-sqr-sqrt99.3%
unpow-prod-down99.3%
Applied egg-rr99.3%
pow-sqr99.3%
*-commutative99.3%
Simplified99.3%
pow-unpow99.3%
unpow299.3%
unpow-prod-down99.3%
add-sqr-sqrt99.7%
*-un-lft-identity99.7%
add-cube-cbrt99.7%
times-frac99.7%
pow299.7%
Applied egg-rr99.7%
associate-*r/99.7%
pow-flip99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Final simplification99.7%
(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(Float64(-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}
\\
{\ell}^{\left(e^{w}\right)} \cdot e^{-w}
\end{array}
Initial program 99.7%
Final simplification99.7%
(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%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (w l) :precision binary64 (if (or (<= w -0.7) (not (<= w 700.0))) (exp (- w)) (+ l (* w l))))
double code(double w, double l) {
double tmp;
if ((w <= -0.7) || !(w <= 700.0)) {
tmp = exp(-w);
} else {
tmp = l + (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.7d0)) .or. (.not. (w <= 700.0d0))) then
tmp = exp(-w)
else
tmp = l + (w * l)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if ((w <= -0.7) || !(w <= 700.0)) {
tmp = Math.exp(-w);
} else {
tmp = l + (w * l);
}
return tmp;
}
def code(w, l): tmp = 0 if (w <= -0.7) or not (w <= 700.0): tmp = math.exp(-w) else: tmp = l + (w * l) return tmp
function code(w, l) tmp = 0.0 if ((w <= -0.7) || !(w <= 700.0)) tmp = exp(Float64(-w)); else tmp = Float64(l + Float64(w * l)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((w <= -0.7) || ~((w <= 700.0))) tmp = exp(-w); else tmp = l + (w * l); end tmp_2 = tmp; end
code[w_, l_] := If[Or[LessEqual[w, -0.7], N[Not[LessEqual[w, 700.0]], $MachinePrecision]], N[Exp[(-w)], $MachinePrecision], N[(l + N[(w * l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7 \lor \neg \left(w \leq 700\right):\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\ell + w \cdot \ell\\
\end{array}
\end{array}
if w < -0.69999999999999996 or 700 < w Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
add-sqr-sqrt100.0%
unpow-prod-down100.0%
Applied egg-rr100.0%
pow-sqr100.0%
*-commutative100.0%
Simplified100.0%
pow-unpow100.0%
unpow2100.0%
unpow-prod-down100.0%
add-sqr-sqrt100.0%
expm1-log1p-u100.0%
expm1-udef100.0%
log1p-udef100.0%
add-exp-log100.0%
add-exp-log99.9%
log-div99.9%
add-exp-log99.9%
log1p-udef99.9%
expm1-udef99.9%
expm1-log1p-u99.9%
log-pow99.9%
add-log-exp99.9%
Applied egg-rr99.9%
Taylor expanded in w around inf 99.6%
neg-mul-199.6%
Simplified99.6%
if -0.69999999999999996 < w < 700Initial program 99.5%
exp-neg99.5%
associate-*l/99.5%
*-lft-identity99.5%
Simplified99.5%
Taylor expanded in w around 0 97.3%
Taylor expanded in w around 0 97.3%
+-commutative97.3%
mul-1-neg97.3%
unsub-neg97.3%
Simplified97.3%
sub-neg97.3%
flip-+48.5%
distribute-rgt-neg-in48.5%
distribute-rgt-neg-in48.5%
distribute-rgt-neg-in48.5%
Applied egg-rr48.5%
flip-+97.3%
*-commutative97.3%
add-sqr-sqrt45.6%
sqrt-unprod97.3%
sqr-neg97.3%
sqrt-unprod51.7%
add-sqr-sqrt97.3%
cancel-sign-sub97.3%
*-commutative97.3%
*-un-lft-identity97.3%
sub-neg97.3%
distribute-rgt-in97.3%
add-sqr-sqrt96.6%
sqrt-prod49.0%
sqr-neg49.0%
sqrt-unprod0.0%
add-sqr-sqrt2.5%
*-rgt-identity2.5%
add-sqr-sqrt0.0%
sqrt-unprod49.0%
sqr-neg49.0%
sqrt-prod96.6%
add-sqr-sqrt97.3%
Applied egg-rr97.3%
Final simplification98.3%
(FPCore (w l) :precision binary64 (* l (/ 1.0 (exp w))))
double code(double w, double l) {
return l * (1.0 / exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l * (1.0d0 / exp(w))
end function
public static double code(double w, double l) {
return l * (1.0 / Math.exp(w));
}
def code(w, l): return l * (1.0 / math.exp(w))
function code(w, l) return Float64(l * Float64(1.0 / exp(w))) end
function tmp = code(w, l) tmp = l * (1.0 / exp(w)); end
code[w_, l_] := N[(l * N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell \cdot \frac{1}{e^{w}}
\end{array}
Initial program 99.7%
exp-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in w around 0 98.1%
frac-2neg98.1%
div-inv98.1%
Applied egg-rr98.1%
Taylor expanded in w around inf 98.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.7%
exp-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in w around 0 98.1%
Final simplification98.1%
(FPCore (w l) :precision binary64 (if (<= w 0.065) (- (- l (* w l)) (* (* l -0.5) (* w w))) (/ (* l l) (+ l (* w l)))))
double code(double w, double l) {
double tmp;
if (w <= 0.065) {
tmp = (l - (w * l)) - ((l * -0.5) * (w * w));
} else {
tmp = (l * l) / (l + (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.065d0) then
tmp = (l - (w * l)) - ((l * (-0.5d0)) * (w * w))
else
tmp = (l * l) / (l + (w * l))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.065) {
tmp = (l - (w * l)) - ((l * -0.5) * (w * w));
} else {
tmp = (l * l) / (l + (w * l));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.065: tmp = (l - (w * l)) - ((l * -0.5) * (w * w)) else: tmp = (l * l) / (l + (w * l)) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.065) tmp = Float64(Float64(l - Float64(w * l)) - Float64(Float64(l * -0.5) * Float64(w * w))); else tmp = Float64(Float64(l * l) / Float64(l + Float64(w * l))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.065) tmp = (l - (w * l)) - ((l * -0.5) * (w * w)); else tmp = (l * l) / (l + (w * l)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.065], N[(N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision] - N[(N[(l * -0.5), $MachinePrecision] * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(l + N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.065:\\
\;\;\;\;\left(\ell - w \cdot \ell\right) - \left(\ell \cdot -0.5\right) \cdot \left(w \cdot w\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\ell + w \cdot \ell}\\
\end{array}
\end{array}
if w < 0.065000000000000002Initial program 99.7%
exp-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
expm1-log1p-u97.2%
expm1-udef63.1%
log1p-udef63.1%
add-exp-log65.5%
Applied egg-rr65.5%
Taylor expanded in w around 0 49.0%
Taylor expanded in w around 0 85.7%
mul-1-neg85.7%
distribute-rgt-neg-out85.7%
associate-+r+85.7%
+-commutative85.7%
*-commutative85.7%
cancel-sign-sub-inv85.7%
associate-*r*85.7%
mul-1-neg85.7%
distribute-rgt-out85.7%
metadata-eval85.7%
unpow285.7%
Simplified85.7%
if 0.065000000000000002 < w Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 97.7%
Taylor expanded in w around 0 3.4%
+-commutative3.4%
mul-1-neg3.4%
unsub-neg3.4%
Simplified3.4%
sub-neg3.4%
flip-+19.4%
distribute-rgt-neg-in19.4%
distribute-rgt-neg-in19.4%
distribute-rgt-neg-in19.4%
Applied egg-rr19.4%
Taylor expanded in w around 0 65.6%
unpow265.6%
Simplified65.6%
Final simplification82.5%
(FPCore (w l) :precision binary64 (if (<= w 0.052) (/ (- 1.0 (* w w)) (/ (+ w 1.0) l)) (/ (* l l) (+ l (* w l)))))
double code(double w, double l) {
double tmp;
if (w <= 0.052) {
tmp = (1.0 - (w * w)) / ((w + 1.0) / l);
} else {
tmp = (l * l) / (l + (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.052d0) then
tmp = (1.0d0 - (w * w)) / ((w + 1.0d0) / l)
else
tmp = (l * l) / (l + (w * l))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.052) {
tmp = (1.0 - (w * w)) / ((w + 1.0) / l);
} else {
tmp = (l * l) / (l + (w * l));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.052: tmp = (1.0 - (w * w)) / ((w + 1.0) / l) else: tmp = (l * l) / (l + (w * l)) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.052) tmp = Float64(Float64(1.0 - Float64(w * w)) / Float64(Float64(w + 1.0) / l)); else tmp = Float64(Float64(l * l) / Float64(l + Float64(w * l))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.052) tmp = (1.0 - (w * w)) / ((w + 1.0) / l); else tmp = (l * l) / (l + (w * l)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.052], N[(N[(1.0 - N[(w * w), $MachinePrecision]), $MachinePrecision] / N[(N[(w + 1.0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(l + N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.052:\\
\;\;\;\;\frac{1 - w \cdot w}{\frac{w + 1}{\ell}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\ell + w \cdot \ell}\\
\end{array}
\end{array}
if w < 0.0519999999999999976Initial program 99.7%
exp-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in w around 0 98.2%
Taylor expanded in w around 0 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
Simplified74.6%
sub-neg74.6%
flip-+37.8%
distribute-rgt-neg-in37.8%
distribute-rgt-neg-in37.8%
distribute-rgt-neg-in37.8%
Applied egg-rr37.8%
Taylor expanded in l around 0 85.6%
associate-/l*78.9%
unpow278.9%
sub-neg78.9%
mul-1-neg78.9%
remove-double-neg78.9%
Simplified78.9%
if 0.0519999999999999976 < w Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 97.7%
Taylor expanded in w around 0 3.4%
+-commutative3.4%
mul-1-neg3.4%
unsub-neg3.4%
Simplified3.4%
sub-neg3.4%
flip-+19.4%
distribute-rgt-neg-in19.4%
distribute-rgt-neg-in19.4%
distribute-rgt-neg-in19.4%
Applied egg-rr19.4%
Taylor expanded in w around 0 65.6%
unpow265.6%
Simplified65.6%
Final simplification76.8%
(FPCore (w l) :precision binary64 (if (<= w 0.125) (* l (- 1.0 w)) (/ (* l l) (+ l (* w l)))))
double code(double w, double l) {
double tmp;
if (w <= 0.125) {
tmp = l * (1.0 - w);
} else {
tmp = (l * l) / (l + (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.125d0) then
tmp = l * (1.0d0 - w)
else
tmp = (l * l) / (l + (w * l))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.125) {
tmp = l * (1.0 - w);
} else {
tmp = (l * l) / (l + (w * l));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.125: tmp = l * (1.0 - w) else: tmp = (l * l) / (l + (w * l)) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.125) tmp = Float64(l * Float64(1.0 - w)); else tmp = Float64(Float64(l * l) / Float64(l + Float64(w * l))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.125) tmp = l * (1.0 - w); else tmp = (l * l) / (l + (w * l)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.125], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], N[(N[(l * l), $MachinePrecision] / N[(l + N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.125:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot \ell}{\ell + w \cdot \ell}\\
\end{array}
\end{array}
if w < 0.125Initial program 99.7%
exp-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in w around 0 98.2%
Taylor expanded in w around 0 74.6%
+-commutative74.6%
mul-1-neg74.6%
unsub-neg74.6%
Simplified74.6%
Taylor expanded in l around 0 74.6%
if 0.125 < w Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 97.7%
Taylor expanded in w around 0 3.4%
+-commutative3.4%
mul-1-neg3.4%
unsub-neg3.4%
Simplified3.4%
sub-neg3.4%
flip-+19.4%
distribute-rgt-neg-in19.4%
distribute-rgt-neg-in19.4%
distribute-rgt-neg-in19.4%
Applied egg-rr19.4%
Taylor expanded in w around 0 65.6%
unpow265.6%
Simplified65.6%
Final simplification73.1%
(FPCore (w l) :precision binary64 (if (<= w -0.64) (* w (- l)) l))
double code(double w, double l) {
double tmp;
if (w <= -0.64) {
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 <= (-0.64d0)) 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 <= -0.64) {
tmp = w * -l;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.64: tmp = w * -l else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -0.64) tmp = Float64(w * Float64(-l)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.64) tmp = w * -l; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.64], N[(w * (-l)), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.64:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -0.640000000000000013Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 98.7%
Taylor expanded in w around 0 30.1%
+-commutative30.1%
mul-1-neg30.1%
unsub-neg30.1%
Simplified30.1%
Taylor expanded in w around inf 30.1%
mul-1-neg30.1%
distribute-rgt-neg-out30.1%
Simplified30.1%
if -0.640000000000000013 < w Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
add-sqr-sqrt99.1%
unpow-prod-down99.1%
Applied egg-rr99.1%
pow-sqr99.1%
*-commutative99.1%
Simplified99.1%
pow-unpow99.1%
unpow299.1%
unpow-prod-down99.1%
add-sqr-sqrt99.6%
*-un-lft-identity99.6%
add-cube-cbrt99.6%
times-frac99.6%
pow299.6%
Applied egg-rr99.6%
associate-*r/99.6%
pow-flip99.6%
metadata-eval99.6%
Applied egg-rr99.6%
Taylor expanded in w around 0 77.1%
Final simplification63.5%
(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%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
Taylor expanded in w around 0 98.1%
Taylor expanded in w around 0 63.2%
+-commutative63.2%
mul-1-neg63.2%
unsub-neg63.2%
Simplified63.2%
Taylor expanded in l around 0 63.2%
Final simplification63.2%
(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%
exp-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
add-sqr-sqrt99.3%
unpow-prod-down99.3%
Applied egg-rr99.3%
pow-sqr99.3%
*-commutative99.3%
Simplified99.3%
pow-unpow99.3%
unpow299.3%
unpow-prod-down99.3%
add-sqr-sqrt99.7%
*-un-lft-identity99.7%
add-cube-cbrt99.7%
times-frac99.7%
pow299.7%
Applied egg-rr99.7%
associate-*r/99.7%
pow-flip99.7%
metadata-eval99.7%
Applied egg-rr99.7%
Taylor expanded in w around 0 56.0%
Final simplification56.0%
herbie shell --seed 2023224
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))