
(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 (/ (* l (pow l (expm1 w))) (exp w)))
double code(double w, double l) {
return (l * pow(l, expm1(w))) / exp(w);
}
public static double code(double w, double l) {
return (l * Math.pow(l, Math.expm1(w))) / Math.exp(w);
}
def code(w, l): return (l * math.pow(l, math.expm1(w))) / math.exp(w)
function code(w, l) return Float64(Float64(l * (l ^ expm1(w))) / exp(w)) end
code[w_, l_] := N[(N[(l * N[Power[l, N[(Exp[w] - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell \cdot {\ell}^{\left(\mathsf{expm1}\left(w\right)\right)}}{e^{w}}
\end{array}
Initial program 99.9%
exp-neg99.9%
remove-double-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
remove-double-neg99.9%
Simplified99.9%
expm1-log1p-u97.5%
Applied egg-rr97.5%
expm1-log1p-u99.9%
expm1-log1p-u99.8%
log1p-define99.8%
expm1-define99.8%
add-exp-log99.8%
associate--l+99.8%
unpow-prod-up99.8%
pow199.8%
expm1-define100.0%
Applied egg-rr100.0%
(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.9%
exp-neg99.9%
remove-double-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
remove-double-neg99.9%
Simplified99.9%
(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.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 98.3%
Taylor expanded in l around 0 98.3%
(FPCore (w l) :precision binary64 (if (<= w 2.4) (+ l (* l (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0)))) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 2.4) {
tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -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 <= 2.4d0) then
tmp = l + (l * (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 2.4) {
tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 2.4: tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 2.4) tmp = Float64(l + Float64(l * Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0)))); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 2.4) tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 2.4], 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[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 2.4:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 2.39999999999999991Initial 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 97.9%
Taylor expanded in w around 0 86.2%
Taylor expanded in l around 0 88.0%
if 2.39999999999999991 < 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%
Taylor expanded in w around 0 100.0%
Taylor expanded in w around 0 3.5%
mul-1-neg3.5%
unsub-neg3.5%
Simplified3.5%
Taylor expanded in w around inf 3.5%
mul-1-neg3.5%
*-commutative3.5%
distribute-rgt-neg-in3.5%
Simplified3.5%
expm1-log1p-u3.5%
expm1-undefine89.1%
Applied egg-rr89.1%
sub-neg89.1%
log1p-undefine89.1%
rem-exp-log89.1%
unsub-neg89.1%
metadata-eval89.1%
Simplified89.1%
Final simplification88.2%
(FPCore (w l) :precision binary64 (if (<= w 0.11) (+ l (* w (- (* w (* l (* w -0.16666666666666666))) l))) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.11) {
tmp = l + (w * ((w * (l * (w * -0.16666666666666666))) - l));
} else {
tmp = w * ((1.0 - l) + -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.11d0) then
tmp = l + (w * ((w * (l * (w * (-0.16666666666666666d0)))) - l))
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.11) {
tmp = l + (w * ((w * (l * (w * -0.16666666666666666))) - l));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.11: tmp = l + (w * ((w * (l * (w * -0.16666666666666666))) - l)) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.11) tmp = Float64(l + Float64(w * Float64(Float64(w * Float64(l * Float64(w * -0.16666666666666666))) - l))); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.11) tmp = l + (w * ((w * (l * (w * -0.16666666666666666))) - l)); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.11], N[(l + N[(w * N[(N[(w * N[(l * N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.11:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \left(\ell \cdot \left(w \cdot -0.16666666666666666\right)\right) - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 0.110000000000000001Initial 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 98.3%
Taylor expanded in w around 0 86.6%
Taylor expanded in w around inf 86.6%
Simplified86.6%
if 0.110000000000000001 < 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%
Taylor expanded in w around 0 98.0%
Taylor expanded in w around 0 3.4%
mul-1-neg3.4%
unsub-neg3.4%
Simplified3.4%
Taylor expanded in w around inf 3.4%
mul-1-neg3.4%
*-commutative3.4%
distribute-rgt-neg-in3.4%
Simplified3.4%
expm1-log1p-u3.4%
expm1-undefine87.2%
Applied egg-rr87.2%
sub-neg87.2%
log1p-undefine87.2%
rem-exp-log87.2%
unsub-neg87.2%
metadata-eval87.2%
Simplified87.2%
(FPCore (w l) :precision binary64 (if (<= w 2.4) (+ l (* w (- (* w (* l 0.5)) l))) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 2.4) {
tmp = l + (w * ((w * (l * 0.5)) - l));
} else {
tmp = w * ((1.0 - l) + -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 <= 2.4d0) then
tmp = l + (w * ((w * (l * 0.5d0)) - l))
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 2.4) {
tmp = l + (w * ((w * (l * 0.5)) - l));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 2.4: tmp = l + (w * ((w * (l * 0.5)) - l)) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 2.4) tmp = Float64(l + Float64(w * Float64(Float64(w * Float64(l * 0.5)) - l))); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 2.4) tmp = l + (w * ((w * (l * 0.5)) - l)); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 2.4], N[(l + N[(w * N[(N[(w * N[(l * 0.5), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 2.4:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \left(\ell \cdot 0.5\right) - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 2.39999999999999991Initial 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 97.9%
Taylor expanded in w around 0 86.2%
Taylor expanded in w around 0 81.3%
neg-mul-181.3%
+-commutative81.3%
sub-neg81.3%
mul-1-neg81.3%
distribute-rgt-out81.3%
metadata-eval81.3%
distribute-rgt-neg-out81.3%
distribute-rgt-neg-in81.3%
metadata-eval81.3%
Simplified81.3%
if 2.39999999999999991 < 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%
Taylor expanded in w around 0 100.0%
Taylor expanded in w around 0 3.5%
mul-1-neg3.5%
unsub-neg3.5%
Simplified3.5%
Taylor expanded in w around inf 3.5%
mul-1-neg3.5%
*-commutative3.5%
distribute-rgt-neg-in3.5%
Simplified3.5%
expm1-log1p-u3.5%
expm1-undefine89.1%
Applied egg-rr89.1%
sub-neg89.1%
log1p-undefine89.1%
rem-exp-log89.1%
unsub-neg89.1%
metadata-eval89.1%
Simplified89.1%
(FPCore (w l) :precision binary64 (if (<= w 30500000000.0) (- l (* l w)) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 30500000000.0) {
tmp = l - (l * w);
} else {
tmp = w * ((1.0 - l) + -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 <= 30500000000.0d0) then
tmp = l - (l * w)
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 30500000000.0) {
tmp = l - (l * w);
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 30500000000.0: tmp = l - (l * w) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 30500000000.0) tmp = Float64(l - Float64(l * w)); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 30500000000.0) tmp = l - (l * w); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 30500000000.0], N[(l - N[(l * w), $MachinePrecision]), $MachinePrecision], N[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 30500000000:\\
\;\;\;\;\ell - \ell \cdot w\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 3.05e10Initial 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 97.9%
Taylor expanded in w around 0 72.7%
mul-1-neg72.7%
unsub-neg72.7%
Simplified72.7%
if 3.05e10 < 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%
Taylor expanded in w around 0 100.0%
Taylor expanded in w around 0 3.5%
mul-1-neg3.5%
unsub-neg3.5%
Simplified3.5%
Taylor expanded in w around inf 3.5%
mul-1-neg3.5%
*-commutative3.5%
distribute-rgt-neg-in3.5%
Simplified3.5%
expm1-log1p-u3.5%
expm1-undefine91.1%
Applied egg-rr91.1%
sub-neg91.1%
log1p-undefine91.1%
rem-exp-log91.1%
unsub-neg91.1%
metadata-eval91.1%
Simplified91.1%
(FPCore (w l) :precision binary64 (if (<= w -0.6) (* w (- l)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.6) {
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.6d0)) 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.6) {
tmp = w * -l;
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.6: tmp = w * -l else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.6) tmp = Float64(w * Float64(-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.6) tmp = w * -l; else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.6], N[(w * (-l)), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.6:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -0.599999999999999978Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in w around 0 98.8%
Taylor expanded in w around 0 34.1%
mul-1-neg34.1%
unsub-neg34.1%
Simplified34.1%
Taylor expanded in w around inf 34.1%
mul-1-neg34.1%
*-commutative34.1%
distribute-rgt-neg-in34.1%
Simplified34.1%
if -0.599999999999999978 < 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 98.0%
Taylor expanded in l around 0 98.0%
Taylor expanded in w around 0 84.1%
+-commutative84.1%
Simplified84.1%
(FPCore (w l) :precision binary64 (if (<= w -150.0) (* w (- l)) l))
double code(double w, double l) {
double tmp;
if (w <= -150.0) {
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 <= (-150.0d0)) 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 <= -150.0) {
tmp = w * -l;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -150.0: tmp = w * -l else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -150.0) tmp = Float64(w * Float64(-l)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -150.0) tmp = w * -l; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -150.0], N[(w * (-l)), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -150:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -150Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in w around 0 100.0%
Taylor expanded in w around 0 34.5%
mul-1-neg34.5%
unsub-neg34.5%
Simplified34.5%
Taylor expanded in w around inf 34.5%
mul-1-neg34.5%
*-commutative34.5%
distribute-rgt-neg-in34.5%
Simplified34.5%
if -150 < 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 73.3%
(FPCore (w l) :precision binary64 (- l (* l w)))
double code(double w, double l) {
return l - (l * w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l - (l * w)
end function
public static double code(double w, double l) {
return l - (l * w);
}
def code(w, l): return l - (l * w)
function code(w, l) return Float64(l - Float64(l * w)) end
function tmp = code(w, l) tmp = l - (l * w); end
code[w_, l_] := N[(l - N[(l * w), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell - \ell \cdot w
\end{array}
Initial program 99.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 98.3%
Taylor expanded in w around 0 60.8%
mul-1-neg60.8%
unsub-neg60.8%
Simplified60.8%
(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.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 51.7%
herbie shell --seed 2024185
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))