
(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.9%
Final simplification99.9%
(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%
Final simplification99.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%
Final simplification98.3%
(FPCore (w l)
:precision binary64
(if (<= w 0.06)
(-
l
(*
w
(+
l
(*
w
(+
(- (* l 0.5) l)
(* w (+ (- l (* l 0.5)) (+ (* l -0.5) (* l 0.16666666666666666)))))))))
(/ (+ -1.0 (* (+ l 1.0) (+ l 1.0))) 2.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.06) {
tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666))))))));
} else {
tmp = (-1.0 + ((l + 1.0) * (l + 1.0))) / 2.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.06d0) then
tmp = l - (w * (l + (w * (((l * 0.5d0) - l) + (w * ((l - (l * 0.5d0)) + ((l * (-0.5d0)) + (l * 0.16666666666666666d0))))))))
else
tmp = ((-1.0d0) + ((l + 1.0d0) * (l + 1.0d0))) / 2.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.06) {
tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666))))))));
} else {
tmp = (-1.0 + ((l + 1.0) * (l + 1.0))) / 2.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.06: tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666)))))))) else: tmp = (-1.0 + ((l + 1.0) * (l + 1.0))) / 2.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.06) tmp = Float64(l - Float64(w * Float64(l + Float64(w * Float64(Float64(Float64(l * 0.5) - l) + Float64(w * Float64(Float64(l - Float64(l * 0.5)) + Float64(Float64(l * -0.5) + Float64(l * 0.16666666666666666))))))))); else tmp = Float64(Float64(-1.0 + Float64(Float64(l + 1.0) * Float64(l + 1.0))) / 2.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.06) tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666)))))))); else tmp = (-1.0 + ((l + 1.0) * (l + 1.0))) / 2.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.06], N[(l - N[(w * N[(l + N[(w * N[(N[(N[(l * 0.5), $MachinePrecision] - l), $MachinePrecision] + N[(w * N[(N[(l - N[(l * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(l * -0.5), $MachinePrecision] + N[(l * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 + N[(N[(l + 1.0), $MachinePrecision] * N[(l + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.06:\\
\;\;\;\;\ell - w \cdot \left(\ell + w \cdot \left(\left(\ell \cdot 0.5 - \ell\right) + w \cdot \left(\left(\ell - \ell \cdot 0.5\right) + \left(\ell \cdot -0.5 + \ell \cdot 0.16666666666666666\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 + \left(\ell + 1\right) \cdot \left(\ell + 1\right)}{2}\\
\end{array}
\end{array}
if w < 0.059999999999999998Initial 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.5%
Taylor expanded in w around 0 84.7%
if 0.059999999999999998 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
exp-neg100.0%
inv-pow100.0%
add-sqr-sqrt0.0%
sqrt-unprod3.8%
sqr-neg3.8%
sqrt-unprod3.8%
add-sqr-sqrt3.8%
pow13.8%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt3.1%
add-sqr-sqrt3.1%
Applied egg-rr62.9%
unpow1/362.9%
rem-cbrt-cube5.0%
expm1-log1p-u5.0%
expm1-undefine96.4%
Applied egg-rr96.4%
expm1-define5.0%
Simplified5.0%
expm1-undefine96.4%
flip--100.0%
log1p-undefine100.0%
rem-exp-log100.0%
log1p-undefine100.0%
rem-exp-log100.0%
metadata-eval100.0%
log1p-undefine100.0%
rem-exp-log100.0%
Applied egg-rr100.0%
Taylor expanded in l around 0 100.0%
Final simplification86.3%
(FPCore (w l) :precision binary64 (if (<= w 0.075) (+ l (* l (* w (+ -1.0 (* w 0.5))))) (+ -1.0 (+ l 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.075) {
tmp = l + (l * (w * (-1.0 + (w * 0.5))));
} else {
tmp = -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.075d0) then
tmp = l + (l * (w * ((-1.0d0) + (w * 0.5d0))))
else
tmp = (-1.0d0) + (l + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.075) {
tmp = l + (l * (w * (-1.0 + (w * 0.5))));
} else {
tmp = -1.0 + (l + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.075: tmp = l + (l * (w * (-1.0 + (w * 0.5)))) else: tmp = -1.0 + (l + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.075) tmp = Float64(l + Float64(l * Float64(w * Float64(-1.0 + Float64(w * 0.5))))); else tmp = Float64(-1.0 + Float64(l + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.075) tmp = l + (l * (w * (-1.0 + (w * 0.5)))); else tmp = -1.0 + (l + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.075], N[(l + N[(l * N[(w * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(l + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.075:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(-1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(\ell + 1\right)\\
\end{array}
\end{array}
if w < 0.0749999999999999972Initial 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.5%
Taylor expanded in w around 0 81.1%
associate-*r*81.1%
neg-mul-181.1%
distribute-rgt-out81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in l around 0 84.7%
if 0.0749999999999999972 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
exp-neg100.0%
inv-pow100.0%
add-sqr-sqrt0.0%
sqrt-unprod3.8%
sqr-neg3.8%
sqrt-unprod3.8%
add-sqr-sqrt3.8%
pow13.8%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt3.1%
add-sqr-sqrt3.1%
Applied egg-rr62.9%
unpow1/362.9%
rem-cbrt-cube5.0%
expm1-log1p-u5.0%
expm1-undefine96.4%
Applied egg-rr96.4%
expm1-define5.0%
Simplified5.0%
expm1-undefine96.4%
log1p-undefine96.4%
rem-exp-log96.4%
Applied egg-rr96.4%
Final simplification85.9%
(FPCore (w l) :precision binary64 (if (<= w 0.052) (+ l (* l (* w (+ -1.0 (* w 0.5))))) (/ (+ -1.0 (* (+ l 1.0) (+ l 1.0))) 2.0)))
double code(double w, double l) {
double tmp;
if (w <= 0.052) {
tmp = l + (l * (w * (-1.0 + (w * 0.5))));
} else {
tmp = (-1.0 + ((l + 1.0) * (l + 1.0))) / 2.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.052d0) then
tmp = l + (l * (w * ((-1.0d0) + (w * 0.5d0))))
else
tmp = ((-1.0d0) + ((l + 1.0d0) * (l + 1.0d0))) / 2.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.052) {
tmp = l + (l * (w * (-1.0 + (w * 0.5))));
} else {
tmp = (-1.0 + ((l + 1.0) * (l + 1.0))) / 2.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.052: tmp = l + (l * (w * (-1.0 + (w * 0.5)))) else: tmp = (-1.0 + ((l + 1.0) * (l + 1.0))) / 2.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.052) tmp = Float64(l + Float64(l * Float64(w * Float64(-1.0 + Float64(w * 0.5))))); else tmp = Float64(Float64(-1.0 + Float64(Float64(l + 1.0) * Float64(l + 1.0))) / 2.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.052) tmp = l + (l * (w * (-1.0 + (w * 0.5)))); else tmp = (-1.0 + ((l + 1.0) * (l + 1.0))) / 2.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.052], N[(l + N[(l * N[(w * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 + N[(N[(l + 1.0), $MachinePrecision] * N[(l + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.052:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(-1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1 + \left(\ell + 1\right) \cdot \left(\ell + 1\right)}{2}\\
\end{array}
\end{array}
if w < 0.0519999999999999976Initial 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.5%
Taylor expanded in w around 0 81.1%
associate-*r*81.1%
neg-mul-181.1%
distribute-rgt-out81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in l around 0 84.7%
if 0.0519999999999999976 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
exp-neg100.0%
inv-pow100.0%
add-sqr-sqrt0.0%
sqrt-unprod3.8%
sqr-neg3.8%
sqrt-unprod3.8%
add-sqr-sqrt3.8%
pow13.8%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt3.1%
add-sqr-sqrt3.1%
Applied egg-rr62.9%
unpow1/362.9%
rem-cbrt-cube5.0%
expm1-log1p-u5.0%
expm1-undefine96.4%
Applied egg-rr96.4%
expm1-define5.0%
Simplified5.0%
expm1-undefine96.4%
flip--100.0%
log1p-undefine100.0%
rem-exp-log100.0%
log1p-undefine100.0%
rem-exp-log100.0%
metadata-eval100.0%
log1p-undefine100.0%
rem-exp-log100.0%
Applied egg-rr100.0%
Taylor expanded in l around 0 100.0%
Final simplification86.2%
(FPCore (w l) :precision binary64 (if (<= w 1.4) (+ l (* w (* 0.5 (* w l)))) (+ -1.0 (+ l 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 1.4) {
tmp = l + (w * (0.5 * (w * l)));
} else {
tmp = -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 <= 1.4d0) then
tmp = l + (w * (0.5d0 * (w * l)))
else
tmp = (-1.0d0) + (l + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 1.4) {
tmp = l + (w * (0.5 * (w * l)));
} else {
tmp = -1.0 + (l + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 1.4: tmp = l + (w * (0.5 * (w * l))) else: tmp = -1.0 + (l + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 1.4) tmp = Float64(l + Float64(w * Float64(0.5 * Float64(w * l)))); else tmp = Float64(-1.0 + Float64(l + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 1.4) tmp = l + (w * (0.5 * (w * l))); else tmp = -1.0 + (l + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 1.4], N[(l + N[(w * N[(0.5 * N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(l + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 1.4:\\
\;\;\;\;\ell + w \cdot \left(0.5 \cdot \left(w \cdot \ell\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(\ell + 1\right)\\
\end{array}
\end{array}
if w < 1.3999999999999999Initial 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.1%
Taylor expanded in w around 0 80.8%
associate-*r*80.8%
neg-mul-180.8%
distribute-rgt-out80.8%
metadata-eval80.8%
Simplified80.8%
Taylor expanded in w around inf 80.8%
if 1.3999999999999999 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
exp-neg100.0%
inv-pow100.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt3.1%
add-sqr-sqrt3.1%
Applied egg-rr61.4%
unpow1/361.4%
rem-cbrt-cube5.0%
expm1-log1p-u5.0%
expm1-undefine100.0%
Applied egg-rr100.0%
expm1-define5.0%
Simplified5.0%
expm1-undefine100.0%
log1p-undefine100.0%
rem-exp-log100.0%
Applied egg-rr100.0%
Final simplification82.6%
(FPCore (w l) :precision binary64 (if (<= w 0.09) (- l (* w l)) (+ -1.0 (+ l 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.09) {
tmp = l - (w * l);
} else {
tmp = -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.09d0) then
tmp = l - (w * l)
else
tmp = (-1.0d0) + (l + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.09) {
tmp = l - (w * l);
} else {
tmp = -1.0 + (l + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.09: tmp = l - (w * l) else: tmp = -1.0 + (l + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.09) tmp = Float64(l - Float64(w * l)); else tmp = Float64(-1.0 + Float64(l + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.09) tmp = l - (w * l); else tmp = -1.0 + (l + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.09], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], N[(-1.0 + N[(l + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.09:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;-1 + \left(\ell + 1\right)\\
\end{array}
\end{array}
if w < 0.089999999999999997Initial 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.5%
Taylor expanded in w around 0 81.1%
associate-*r*81.1%
neg-mul-181.1%
distribute-rgt-out81.1%
metadata-eval81.1%
Simplified81.1%
Taylor expanded in w around 0 71.5%
mul-1-neg71.5%
*-commutative71.5%
unsub-neg71.5%
*-commutative71.5%
Simplified71.5%
if 0.089999999999999997 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
exp-neg100.0%
inv-pow100.0%
add-sqr-sqrt0.0%
sqrt-unprod3.8%
sqr-neg3.8%
sqrt-unprod3.8%
add-sqr-sqrt3.8%
pow13.8%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt3.1%
add-sqr-sqrt3.1%
Applied egg-rr62.9%
unpow1/362.9%
rem-cbrt-cube5.0%
expm1-log1p-u5.0%
expm1-undefine96.4%
Applied egg-rr96.4%
expm1-define5.0%
Simplified5.0%
expm1-undefine96.4%
log1p-undefine96.4%
rem-exp-log96.4%
Applied egg-rr96.4%
Final simplification74.0%
(FPCore (w l) :precision binary64 (if (<= w -410.0) (* w (- l)) l))
double code(double w, double l) {
double tmp;
if (w <= -410.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 <= (-410.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 <= -410.0) {
tmp = w * -l;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -410.0: tmp = w * -l else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -410.0) tmp = Float64(w * Float64(-l)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -410.0) tmp = w * -l; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -410.0], N[(w * (-l)), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -410:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -410Initial 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 53.5%
associate-*r*53.5%
neg-mul-153.5%
distribute-rgt-out53.5%
metadata-eval53.5%
Simplified53.5%
Taylor expanded in w around 0 27.9%
mul-1-neg27.9%
*-commutative27.9%
unsub-neg27.9%
*-commutative27.9%
Simplified27.9%
Taylor expanded in w around inf 27.9%
mul-1-neg27.9%
Simplified27.9%
if -410 < 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 97.4%
Taylor expanded in w around 0 83.4%
Final simplification64.7%
(FPCore (w l) :precision binary64 (- l (* w l)))
double code(double w, double l) {
return l - (w * l);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l - (w * l)
end function
public static double code(double w, double l) {
return l - (w * l);
}
def code(w, l): return l - (w * l)
function code(w, l) return Float64(l - Float64(w * l)) end
function tmp = code(w, l) tmp = l - (w * l); end
code[w_, l_] := N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell - w \cdot \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 98.3%
Taylor expanded in w around 0 73.1%
associate-*r*73.1%
neg-mul-173.1%
distribute-rgt-out73.1%
metadata-eval73.1%
Simplified73.1%
Taylor expanded in w around 0 64.6%
mul-1-neg64.6%
*-commutative64.6%
unsub-neg64.6%
*-commutative64.6%
Simplified64.6%
Final simplification64.6%
(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 98.3%
Taylor expanded in w around 0 56.7%
Final simplification56.7%
herbie shell --seed 2024077
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))