
(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 14 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 (if (<= w -1.35e-14) (exp (- (* (exp w) (log l)) w)) (pow l (exp w))))
double code(double w, double l) {
double tmp;
if (w <= -1.35e-14) {
tmp = exp(((exp(w) * log(l)) - w));
} else {
tmp = pow(l, exp(w));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.35d-14)) then
tmp = exp(((exp(w) * log(l)) - w))
else
tmp = l ** exp(w)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.35e-14) {
tmp = Math.exp(((Math.exp(w) * Math.log(l)) - w));
} else {
tmp = Math.pow(l, Math.exp(w));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.35e-14: tmp = math.exp(((math.exp(w) * math.log(l)) - w)) else: tmp = math.pow(l, math.exp(w)) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.35e-14) tmp = exp(Float64(Float64(exp(w) * log(l)) - w)); else tmp = l ^ exp(w); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.35e-14) tmp = exp(((exp(w) * log(l)) - w)); else tmp = l ^ exp(w); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.35e-14], N[Exp[N[(N[(N[Exp[w], $MachinePrecision] * N[Log[l], $MachinePrecision]), $MachinePrecision] - w), $MachinePrecision]], $MachinePrecision], N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.35 \cdot 10^{-14}:\\
\;\;\;\;e^{e^{w} \cdot \log \ell - w}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(e^{w}\right)}\\
\end{array}
\end{array}
if w < -1.3499999999999999e-14Initial program 99.6%
Taylor expanded in w around inf
*-commutativeN/A
exp-to-powN/A
remove-double-negN/A
distribute-lft-neg-outN/A
log-recN/A
*-commutativeN/A
mul-1-negN/A
+-rgt-identityN/A
exp-sumN/A
+-rgt-identityN/A
+-commutativeN/A
exp-lowering-exp.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
Simplified99.6%
+-rgt-identityN/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
exp-lowering-exp.f6499.6
Applied egg-rr99.6%
if -1.3499999999999999e-14 < w Initial program 98.2%
Taylor expanded in w around 0
Simplified99.0%
*-lft-identityN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f6499.0
Applied egg-rr99.0%
Final simplification99.2%
(FPCore (w l) :precision binary64 (let* ((t_0 (* (exp (- 0.0 w)) (pow l (exp w))))) (if (<= t_0 1e-306) 0.0 (if (<= t_0 4e+307) l (* l (* w (* w 0.5)))))))
double code(double w, double l) {
double t_0 = exp((0.0 - w)) * pow(l, exp(w));
double tmp;
if (t_0 <= 1e-306) {
tmp = 0.0;
} else if (t_0 <= 4e+307) {
tmp = l;
} else {
tmp = l * (w * (w * 0.5));
}
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 = exp((0.0d0 - w)) * (l ** exp(w))
if (t_0 <= 1d-306) then
tmp = 0.0d0
else if (t_0 <= 4d+307) then
tmp = l
else
tmp = l * (w * (w * 0.5d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = Math.exp((0.0 - w)) * Math.pow(l, Math.exp(w));
double tmp;
if (t_0 <= 1e-306) {
tmp = 0.0;
} else if (t_0 <= 4e+307) {
tmp = l;
} else {
tmp = l * (w * (w * 0.5));
}
return tmp;
}
def code(w, l): t_0 = math.exp((0.0 - w)) * math.pow(l, math.exp(w)) tmp = 0 if t_0 <= 1e-306: tmp = 0.0 elif t_0 <= 4e+307: tmp = l else: tmp = l * (w * (w * 0.5)) return tmp
function code(w, l) t_0 = Float64(exp(Float64(0.0 - w)) * (l ^ exp(w))) tmp = 0.0 if (t_0 <= 1e-306) tmp = 0.0; elseif (t_0 <= 4e+307) tmp = l; else tmp = Float64(l * Float64(w * Float64(w * 0.5))); end return tmp end
function tmp_2 = code(w, l) t_0 = exp((0.0 - w)) * (l ^ exp(w)); tmp = 0.0; if (t_0 <= 1e-306) tmp = 0.0; elseif (t_0 <= 4e+307) tmp = l; else tmp = l * (w * (w * 0.5)); end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[(N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 1e-306], 0.0, If[LessEqual[t$95$0, 4e+307], l, N[(l * N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{0 - w} \cdot {\ell}^{\left(e^{w}\right)}\\
\mathbf{if}\;t\_0 \leq 10^{-306}:\\
\;\;\;\;0\\
\mathbf{elif}\;t\_0 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left(w \cdot \left(w \cdot 0.5\right)\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 1.00000000000000003e-306Initial program 99.6%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr97.6%
if 1.00000000000000003e-306 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 3.99999999999999994e307Initial program 99.6%
Taylor expanded in w around 0
Simplified97.0%
if 3.99999999999999994e307 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 95.6%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6455.3
Simplified55.3%
Taylor expanded in w around inf
unpow2N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate--r-N/A
unpow2N/A
associate-/r*N/A
div-subN/A
unsub-negN/A
mul-1-negN/A
associate-*l*N/A
*-lowering-*.f64N/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
associate-*r/N/A
*-rgt-identityN/A
Simplified55.3%
Taylor expanded in w around inf
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6455.3
Simplified55.3%
Taylor expanded in w around 0
Simplified62.0%
Final simplification87.8%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- 0.0 w)) (pow l (exp w))) 1e-306) 0.0 (* l (fma w (fma w 0.5 -1.0) 1.0))))
double code(double w, double l) {
double tmp;
if ((exp((0.0 - w)) * pow(l, exp(w))) <= 1e-306) {
tmp = 0.0;
} else {
tmp = l * fma(w, fma(w, 0.5, -1.0), 1.0);
}
return tmp;
}
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(0.0 - w)) * (l ^ exp(w))) <= 1e-306) tmp = 0.0; else tmp = Float64(l * fma(w, fma(w, 0.5, -1.0), 1.0)); end return tmp end
code[w_, l_] := If[LessEqual[N[(N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e-306], 0.0, N[(l * N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{0 - w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{-306}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 1.00000000000000003e-306Initial program 99.6%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr97.6%
if 1.00000000000000003e-306 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 98.4%
Taylor expanded in w around 0
Simplified96.6%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6486.2
Simplified86.2%
Final simplification87.8%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- 0.0 w)) (pow l (exp w))) 1e-306) 0.0 l))
double code(double w, double l) {
double tmp;
if ((exp((0.0 - w)) * pow(l, exp(w))) <= 1e-306) {
tmp = 0.0;
} 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 ((exp((0.0d0 - w)) * (l ** exp(w))) <= 1d-306) then
tmp = 0.0d0
else
tmp = l
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if ((Math.exp((0.0 - w)) * Math.pow(l, Math.exp(w))) <= 1e-306) {
tmp = 0.0;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if (math.exp((0.0 - w)) * math.pow(l, math.exp(w))) <= 1e-306: tmp = 0.0 else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(0.0 - w)) * (l ^ exp(w))) <= 1e-306) tmp = 0.0; else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((exp((0.0 - w)) * (l ^ exp(w))) <= 1e-306) tmp = 0.0; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[N[(N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e-306], 0.0, l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{0 - w} \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{-306}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 1.00000000000000003e-306Initial program 99.6%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr97.6%
if 1.00000000000000003e-306 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 98.4%
Taylor expanded in w around 0
Simplified68.4%
Final simplification72.4%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- 0.0 w)) (pow l (exp w))) 1.1e-154) 0.0 1.0))
double code(double w, double l) {
double tmp;
if ((exp((0.0 - w)) * pow(l, exp(w))) <= 1.1e-154) {
tmp = 0.0;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if ((exp((0.0d0 - w)) * (l ** exp(w))) <= 1.1d-154) then
tmp = 0.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if ((Math.exp((0.0 - w)) * Math.pow(l, Math.exp(w))) <= 1.1e-154) {
tmp = 0.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(w, l): tmp = 0 if (math.exp((0.0 - w)) * math.pow(l, math.exp(w))) <= 1.1e-154: tmp = 0.0 else: tmp = 1.0 return tmp
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(0.0 - w)) * (l ^ exp(w))) <= 1.1e-154) tmp = 0.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((exp((0.0 - w)) * (l ^ exp(w))) <= 1.1e-154) tmp = 0.0; else tmp = 1.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[N[(N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.1e-154], 0.0, 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{0 - w} \cdot {\ell}^{\left(e^{w}\right)} \leq 1.1 \cdot 10^{-154}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 1.10000000000000004e-154Initial program 99.6%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr48.6%
if 1.10000000000000004e-154 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 98.1%
Taylor expanded in w around inf
*-commutativeN/A
exp-to-powN/A
remove-double-negN/A
distribute-lft-neg-outN/A
log-recN/A
*-commutativeN/A
mul-1-negN/A
+-rgt-identityN/A
exp-sumN/A
+-rgt-identityN/A
+-commutativeN/A
exp-lowering-exp.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
Simplified94.9%
Taylor expanded in w around inf
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6440.0
Simplified40.0%
Taylor expanded in w around 0
Simplified5.1%
Final simplification18.0%
(FPCore (w l) :precision binary64 (* (exp (- 0.0 w)) (pow l (exp w))))
double code(double w, double l) {
return exp((0.0 - w)) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp((0.0d0 - w)) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp((0.0 - w)) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp((0.0 - w)) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(0.0 - w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp((0.0 - w)) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{0 - w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
Initial program 98.6%
Final simplification98.6%
(FPCore (w l) :precision binary64 (if (<= l 0.0066) (pow l (fma w (fma w (fma w 0.16666666666666666 0.5) 1.0) 1.0)) (* (fma w (fma w 0.5 -1.0) 1.0) (pow l (fma w (fma w 0.5 1.0) 1.0)))))
double code(double w, double l) {
double tmp;
if (l <= 0.0066) {
tmp = pow(l, fma(w, fma(w, fma(w, 0.16666666666666666, 0.5), 1.0), 1.0));
} else {
tmp = fma(w, fma(w, 0.5, -1.0), 1.0) * pow(l, fma(w, fma(w, 0.5, 1.0), 1.0));
}
return tmp;
}
function code(w, l) tmp = 0.0 if (l <= 0.0066) tmp = l ^ fma(w, fma(w, fma(w, 0.16666666666666666, 0.5), 1.0), 1.0); else tmp = Float64(fma(w, fma(w, 0.5, -1.0), 1.0) * (l ^ fma(w, fma(w, 0.5, 1.0), 1.0))); end return tmp end
code[w_, l_] := If[LessEqual[l, 0.0066], N[Power[l, N[(w * N[(w * N[(w * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision], N[(N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[l, N[(w * N[(w * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.0066:\\
\;\;\;\;{\ell}^{\left(\mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.16666666666666666, 0.5\right), 1\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, 1\right), 1\right)\right)}\\
\end{array}
\end{array}
if l < 0.0066Initial program 99.8%
Taylor expanded in w around 0
Simplified77.4%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6498.7
Simplified98.7%
*-lft-identityN/A
pow-lowering-pow.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f6498.7
Applied egg-rr98.7%
if 0.0066 < l Initial program 97.1%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6485.8
Simplified85.8%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6498.8
Simplified98.8%
(FPCore (w l) :precision binary64 (if (<= w -0.7) (exp (- 0.0 w)) (if (<= w 36000000.0) (* l (fma w (fma w 0.5 -1.0) 1.0)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.7) {
tmp = exp((0.0 - w));
} else if (w <= 36000000.0) {
tmp = l * fma(w, fma(w, 0.5, -1.0), 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -0.7) tmp = exp(Float64(0.0 - w)); elseif (w <= 36000000.0) tmp = Float64(l * fma(w, fma(w, 0.5, -1.0), 1.0)); else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, -0.7], N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision], If[LessEqual[w, 36000000.0], N[(l * N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7:\\
\;\;\;\;e^{0 - w}\\
\mathbf{elif}\;w \leq 36000000:\\
\;\;\;\;\ell \cdot \mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.69999999999999996Initial program 100.0%
Taylor expanded in w around inf
*-commutativeN/A
exp-to-powN/A
remove-double-negN/A
distribute-lft-neg-outN/A
log-recN/A
*-commutativeN/A
mul-1-negN/A
+-rgt-identityN/A
exp-sumN/A
+-rgt-identityN/A
+-commutativeN/A
exp-lowering-exp.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
Simplified100.0%
Taylor expanded in w around inf
neg-mul-1N/A
neg-sub0N/A
--lowering--.f6498.7
Simplified98.7%
sub0-negN/A
neg-lowering-neg.f6498.7
Applied egg-rr98.7%
if -0.69999999999999996 < w < 3.6e7Initial program 97.7%
Taylor expanded in w around 0
Simplified95.2%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6495.3
Simplified95.3%
if 3.6e7 < w Initial program 100.0%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr100.0%
Final simplification96.8%
(FPCore (w l) :precision binary64 (* (exp (- 0.0 w)) l))
double code(double w, double l) {
return exp((0.0 - w)) * l;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp((0.0d0 - w)) * l
end function
public static double code(double w, double l) {
return Math.exp((0.0 - w)) * l;
}
def code(w, l): return math.exp((0.0 - w)) * l
function code(w, l) return Float64(exp(Float64(0.0 - w)) * l) end
function tmp = code(w, l) tmp = exp((0.0 - w)) * l; end
code[w_, l_] := N[(N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision] * l), $MachinePrecision]
\begin{array}{l}
\\
e^{0 - w} \cdot \ell
\end{array}
Initial program 98.6%
Taylor expanded in w around 0
Simplified96.7%
Final simplification96.7%
(FPCore (w l) :precision binary64 (if (<= w -6.6e+101) (fma w (fma w (fma w -0.16666666666666666 0.5) -1.0) 1.0) (if (<= w 36000000.0) (* l (fma w (fma w 0.5 -1.0) 1.0)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -6.6e+101) {
tmp = fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0);
} else if (w <= 36000000.0) {
tmp = l * fma(w, fma(w, 0.5, -1.0), 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -6.6e+101) tmp = fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0); elseif (w <= 36000000.0) tmp = Float64(l * fma(w, fma(w, 0.5, -1.0), 1.0)); else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, -6.6e+101], N[(w * N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 36000000.0], N[(l * N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -6.6 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\mathbf{elif}\;w \leq 36000000:\\
\;\;\;\;\ell \cdot \mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -6.60000000000000022e101Initial program 100.0%
Taylor expanded in w around inf
*-commutativeN/A
exp-to-powN/A
remove-double-negN/A
distribute-lft-neg-outN/A
log-recN/A
*-commutativeN/A
mul-1-negN/A
+-rgt-identityN/A
exp-sumN/A
+-rgt-identityN/A
+-commutativeN/A
exp-lowering-exp.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
Simplified100.0%
Taylor expanded in w around inf
neg-mul-1N/A
neg-sub0N/A
--lowering--.f64100.0
Simplified100.0%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6498.0
Simplified98.0%
if -6.60000000000000022e101 < w < 3.6e7Initial program 97.9%
Taylor expanded in w around 0
Simplified95.3%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f6486.3
Simplified86.3%
if 3.6e7 < w Initial program 100.0%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr100.0%
Final simplification90.1%
(FPCore (w l) :precision binary64 (if (<= w 0.0075) (* l (fma w (fma w (fma w -0.16666666666666666 0.5) -1.0) 1.0)) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.0075) {
tmp = l * fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= 0.0075) tmp = Float64(l * fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0)); else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, 0.0075], N[(l * N[(w * N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.0075:\\
\;\;\;\;\ell \cdot \mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.0074999999999999997Initial program 99.8%
Taylor expanded in w around 0
Simplified97.9%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6491.3
Simplified91.3%
if 0.0074999999999999997 < w Initial program 91.7%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr90.0%
Final simplification91.1%
(FPCore (w l) :precision binary64 (if (<= w -1.75e+154) (fma w (fma w 0.5 -1.0) 1.0) (if (<= w 0.0075) (* l (- 1.0 w)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -1.75e+154) {
tmp = fma(w, fma(w, 0.5, -1.0), 1.0);
} else if (w <= 0.0075) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -1.75e+154) tmp = fma(w, fma(w, 0.5, -1.0), 1.0); elseif (w <= 0.0075) tmp = Float64(l * Float64(1.0 - w)); else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, -1.75e+154], N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 0.0075], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.75 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right)\\
\mathbf{elif}\;w \leq 0.0075:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.7500000000000001e154Initial program 100.0%
Taylor expanded in w around inf
*-commutativeN/A
exp-to-powN/A
remove-double-negN/A
distribute-lft-neg-outN/A
log-recN/A
*-commutativeN/A
mul-1-negN/A
+-rgt-identityN/A
exp-sumN/A
+-rgt-identityN/A
+-commutativeN/A
exp-lowering-exp.f64N/A
+-commutativeN/A
unsub-negN/A
--lowering--.f64N/A
Simplified100.0%
Taylor expanded in w around inf
neg-mul-1N/A
neg-sub0N/A
--lowering--.f64100.0
Simplified100.0%
Taylor expanded in w around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
accelerator-lowering-fma.f64100.0
Simplified100.0%
if -1.7500000000000001e154 < w < 0.0074999999999999997Initial program 99.7%
Taylor expanded in w around 0
Simplified97.5%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f6484.0
Simplified84.0%
if 0.0074999999999999997 < w Initial program 91.7%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr90.0%
Final simplification86.9%
(FPCore (w l) :precision binary64 (if (<= w 0.0075) (* l (- 1.0 w)) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.0075) {
tmp = l * (1.0 - w);
} else {
tmp = 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.0075d0) then
tmp = l * (1.0d0 - w)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.0075) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.0075: tmp = l * (1.0 - w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.0075) tmp = Float64(l * Float64(1.0 - w)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.0075) tmp = l * (1.0 - w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.0075], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.0075:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.0074999999999999997Initial program 99.8%
Taylor expanded in w around 0
Simplified97.9%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f6478.1
Simplified78.1%
if 0.0074999999999999997 < w Initial program 91.7%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr90.0%
Final simplification79.9%
(FPCore (w l) :precision binary64 0.0)
double code(double w, double l) {
return 0.0;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = 0.0d0
end function
public static double code(double w, double l) {
return 0.0;
}
def code(w, l): return 0.0
function code(w, l) return 0.0 end
function tmp = code(w, l) tmp = 0.0; end
code[w_, l_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 98.6%
exp-negN/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
Applied egg-rr16.1%
herbie shell --seed 2024195
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))