
(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 (* (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.8%
(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.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
(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.8%
add-sqr-sqrt53.4%
sqrt-unprod86.8%
sqr-neg86.8%
sqrt-unprod33.4%
add-sqr-sqrt86.4%
add-sqr-sqrt86.4%
sqrt-unprod86.4%
add-sqr-sqrt33.4%
sqrt-unprod55.6%
sqr-neg55.6%
sqrt-unprod22.1%
add-sqr-sqrt41.9%
pow141.9%
exp-neg41.9%
inv-pow41.9%
pow-prod-up97.8%
metadata-eval97.8%
metadata-eval97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Final simplification97.8%
(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.8%
add-sqr-sqrt53.4%
sqrt-unprod86.8%
sqr-neg86.8%
sqrt-unprod33.4%
add-sqr-sqrt86.4%
add-sqr-sqrt86.4%
sqrt-unprod86.4%
add-sqr-sqrt33.4%
sqrt-unprod55.6%
sqr-neg55.6%
sqrt-unprod22.1%
add-sqr-sqrt41.9%
pow141.9%
exp-neg41.9%
inv-pow41.9%
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%
(FPCore (w l) :precision binary64 (if (<= w 3e-8) (* l (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0)))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 3e-8) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 3d-8) then
tmp = l * (1.0d0 + (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 3e-8) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 3e-8: tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 3e-8) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0)))); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 3e-8) tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 3e-8], N[(l * N[(1.0 + N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 3 \cdot 10^{-8}:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 2.99999999999999973e-8Initial program 99.7%
add-sqr-sqrt32.3%
sqrt-unprod80.9%
sqr-neg80.9%
sqrt-unprod48.6%
add-sqr-sqrt80.6%
add-sqr-sqrt80.6%
sqrt-unprod80.6%
add-sqr-sqrt48.6%
sqrt-unprod80.6%
sqr-neg80.6%
sqrt-unprod32.0%
add-sqr-sqrt60.8%
pow160.8%
exp-neg60.8%
inv-pow60.8%
pow-prod-up97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Applied egg-rr97.2%
Taylor expanded in w around 0 90.6%
Taylor expanded in l around 0 90.6%
if 2.99999999999999973e-8 < w Initial program 99.9%
exp-neg99.9%
remove-double-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in w around 0 99.7%
+-commutative99.7%
Simplified99.7%
add-sqr-sqrt99.9%
sqrt-unprod99.9%
sqr-neg99.9%
sqrt-unprod0.0%
add-sqr-sqrt99.1%
add-sqr-sqrt99.1%
sqrt-unprod99.1%
add-sqr-sqrt0.0%
sqrt-unprod0.4%
sqr-neg0.4%
sqrt-unprod0.4%
add-sqr-sqrt0.4%
pow10.4%
exp-neg0.4%
inv-pow0.4%
pow-prod-up99.2%
metadata-eval99.2%
metadata-eval99.2%
metadata-eval99.2%
Applied egg-rr62.0%
Final simplification81.7%
(FPCore (w l) :precision binary64 (if (<= w 1.85e-7) (* l (+ 1.0 (* w (+ (* w 0.5) -1.0)))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 1.85e-7) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 1.85d-7) then
tmp = l * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 1.85e-7) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 1.85e-7: tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 1.85e-7) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 1.85e-7) tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 1.85e-7], N[(l * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 1.85 \cdot 10^{-7}:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 1.85000000000000002e-7Initial program 99.7%
add-sqr-sqrt32.3%
sqrt-unprod80.9%
sqr-neg80.9%
sqrt-unprod48.6%
add-sqr-sqrt80.6%
add-sqr-sqrt80.6%
sqrt-unprod80.6%
add-sqr-sqrt48.6%
sqrt-unprod80.6%
sqr-neg80.6%
sqrt-unprod32.0%
add-sqr-sqrt60.8%
pow160.8%
exp-neg60.8%
inv-pow60.8%
pow-prod-up97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Applied egg-rr97.2%
Taylor expanded in w around 0 85.7%
if 1.85000000000000002e-7 < w Initial program 99.9%
exp-neg99.9%
remove-double-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in w around 0 99.7%
+-commutative99.7%
Simplified99.7%
add-sqr-sqrt99.9%
sqrt-unprod99.9%
sqr-neg99.9%
sqrt-unprod0.0%
add-sqr-sqrt99.1%
add-sqr-sqrt99.1%
sqrt-unprod99.1%
add-sqr-sqrt0.0%
sqrt-unprod0.4%
sqr-neg0.4%
sqrt-unprod0.4%
add-sqr-sqrt0.4%
pow10.4%
exp-neg0.4%
inv-pow0.4%
pow-prod-up99.2%
metadata-eval99.2%
metadata-eval99.2%
metadata-eval99.2%
Applied egg-rr62.0%
Final simplification78.3%
(FPCore (w l) :precision binary64 (if (<= w -1.62e-6) (+ l (* w (* l (+ (* w 0.5) -1.0)))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.62e-6) {
tmp = l + (w * (l * ((w * 0.5) + -1.0)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.62d-6)) then
tmp = l + (w * (l * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.62e-6) {
tmp = l + (w * (l * ((w * 0.5) + -1.0)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.62e-6: tmp = l + (w * (l * ((w * 0.5) + -1.0))) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.62e-6) tmp = Float64(l + Float64(w * Float64(l * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.62e-6) tmp = l + (w * (l * ((w * 0.5) + -1.0))); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.62e-6], N[(l + N[(w * N[(l * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.62 \cdot 10^{-6}:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -1.61999999999999995e-6Initial program 99.7%
add-sqr-sqrt0.0%
sqrt-unprod51.8%
sqr-neg51.8%
sqrt-unprod51.8%
add-sqr-sqrt51.8%
add-sqr-sqrt51.8%
sqrt-unprod51.8%
add-sqr-sqrt51.8%
sqrt-unprod51.8%
sqr-neg51.8%
sqrt-unprod0.0%
add-sqr-sqrt0.5%
pow10.5%
exp-neg0.5%
inv-pow0.5%
pow-prod-up94.6%
metadata-eval94.6%
metadata-eval94.6%
metadata-eval94.6%
Applied egg-rr94.6%
Taylor expanded in w around 0 67.8%
Taylor expanded in w around 0 56.5%
neg-mul-156.5%
+-commutative56.5%
*-commutative56.5%
associate-*r*56.5%
*-commutative56.5%
neg-mul-156.5%
*-commutative56.5%
distribute-lft-out56.5%
*-commutative56.5%
Simplified56.5%
if -1.61999999999999995e-6 < w Initial program 99.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in w around 0 99.7%
+-commutative99.7%
Simplified99.7%
add-sqr-sqrt72.7%
sqrt-unprod99.5%
sqr-neg99.5%
sqrt-unprod26.8%
add-sqr-sqrt98.9%
add-sqr-sqrt98.9%
sqrt-unprod98.9%
add-sqr-sqrt26.8%
sqrt-unprod56.9%
sqr-neg56.9%
sqrt-unprod30.1%
add-sqr-sqrt56.9%
pow156.9%
exp-neg56.9%
inv-pow56.9%
pow-prod-up99.0%
metadata-eval99.0%
metadata-eval99.0%
metadata-eval99.0%
Applied egg-rr83.1%
Final simplification76.1%
(FPCore (w l) :precision binary64 (if (<= w -0.0132) (* (- w) l) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.0132) {
tmp = -w * l;
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.0132d0)) then
tmp = -w * l
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.0132) {
tmp = -w * l;
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.0132: tmp = -w * l else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.0132) tmp = Float64(Float64(-w) * l); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.0132) tmp = -w * l; else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.0132], N[((-w) * l), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.0132:\\
\;\;\;\;\left(-w\right) \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -0.0132Initial program 99.7%
add-sqr-sqrt0.0%
sqrt-unprod51.8%
sqr-neg51.8%
sqrt-unprod51.8%
add-sqr-sqrt51.8%
add-sqr-sqrt51.8%
sqrt-unprod51.8%
add-sqr-sqrt51.8%
sqrt-unprod51.8%
sqr-neg51.8%
sqrt-unprod0.0%
add-sqr-sqrt0.5%
pow10.5%
exp-neg0.5%
inv-pow0.5%
pow-prod-up94.6%
metadata-eval94.6%
metadata-eval94.6%
metadata-eval94.6%
Applied egg-rr94.6%
Taylor expanded in w around 0 32.6%
mul-1-neg32.6%
unsub-neg32.6%
Simplified32.6%
Taylor expanded in w around inf 32.6%
mul-1-neg32.6%
Simplified32.6%
if -0.0132 < w Initial program 99.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
Taylor expanded in w around 0 99.7%
+-commutative99.7%
Simplified99.7%
add-sqr-sqrt72.7%
sqrt-unprod99.5%
sqr-neg99.5%
sqrt-unprod26.8%
add-sqr-sqrt98.9%
add-sqr-sqrt98.9%
sqrt-unprod98.9%
add-sqr-sqrt26.8%
sqrt-unprod56.9%
sqr-neg56.9%
sqrt-unprod30.1%
add-sqr-sqrt56.9%
pow156.9%
exp-neg56.9%
inv-pow56.9%
pow-prod-up99.0%
metadata-eval99.0%
metadata-eval99.0%
metadata-eval99.0%
Applied egg-rr83.1%
Final simplification69.7%
(FPCore (w l) :precision binary64 (if (<= w -0.058) (* (- w) l) l))
double code(double w, double l) {
double tmp;
if (w <= -0.058) {
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.058d0)) 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.058) {
tmp = -w * l;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.058: tmp = -w * l else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -0.058) tmp = Float64(Float64(-w) * l); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.058) tmp = -w * l; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.058], N[((-w) * l), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.058:\\
\;\;\;\;\left(-w\right) \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -0.0580000000000000029Initial program 99.7%
add-sqr-sqrt0.0%
sqrt-unprod51.8%
sqr-neg51.8%
sqrt-unprod51.8%
add-sqr-sqrt51.8%
add-sqr-sqrt51.8%
sqrt-unprod51.8%
add-sqr-sqrt51.8%
sqrt-unprod51.8%
sqr-neg51.8%
sqrt-unprod0.0%
add-sqr-sqrt0.5%
pow10.5%
exp-neg0.5%
inv-pow0.5%
pow-prod-up94.6%
metadata-eval94.6%
metadata-eval94.6%
metadata-eval94.6%
Applied egg-rr94.6%
Taylor expanded in w around 0 32.6%
mul-1-neg32.6%
unsub-neg32.6%
Simplified32.6%
Taylor expanded in w around inf 32.6%
mul-1-neg32.6%
Simplified32.6%
if -0.0580000000000000029 < w Initial program 99.8%
Taylor expanded in w around 0 59.3%
Final simplification52.2%
(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.8%
add-sqr-sqrt53.4%
sqrt-unprod86.8%
sqr-neg86.8%
sqrt-unprod33.4%
add-sqr-sqrt86.4%
add-sqr-sqrt86.4%
sqrt-unprod86.4%
add-sqr-sqrt33.4%
sqrt-unprod55.6%
sqr-neg55.6%
sqrt-unprod22.1%
add-sqr-sqrt41.9%
pow141.9%
exp-neg41.9%
inv-pow41.9%
pow-prod-up97.8%
metadata-eval97.8%
metadata-eval97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in w around 0 51.5%
mul-1-neg51.5%
unsub-neg51.5%
Simplified51.5%
Taylor expanded in l around 0 51.5%
(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.8%
Taylor expanded in w around 0 44.6%
herbie shell --seed 2024172
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))