
(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 13 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 (- 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 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%
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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified99.7%
(FPCore (w l)
:precision binary64
(if (<= w -1.6)
(/ l (exp w))
(/
(pow l (exp w))
(+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -1.6) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.6d0)) then
tmp = l / exp(w)
else
tmp = (l ** exp(w)) / (1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.6) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.6: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.6) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.6) tmp = l / exp(w); else tmp = (l ^ exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.6], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(1.0 + N[(w * N[(1.0 + N[(w * N[(0.5 + N[(w * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.6:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < -1.6000000000000001Initial 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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
if -1.6000000000000001 < w Initial 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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified99.6%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.3%
Simplified99.3%
(FPCore (w l) :precision binary64 (if (<= w -220.0) (/ l (exp w)) (/ (pow l (exp w)) (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -220.0) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-220.0d0)) then
tmp = l / exp(w)
else
tmp = (l ** exp(w)) / (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -220.0) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -220.0: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -220.0) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -220.0) tmp = l / exp(w); else tmp = (l ^ exp(w)) / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -220.0], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -220:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -220Initial 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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
if -220 < w Initial 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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified99.6%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.0%
Simplified99.0%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (/ l (exp w)) (/ (pow l (exp w)) (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) / (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.0d0)) then
tmp = l / exp(w)
else
tmp = (l ** exp(w)) / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = l / exp(w); else tmp = (l ^ exp(w)) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial 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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
if -1 < w Initial 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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified99.6%
Taylor expanded in w around 0
+-commutativeN/A
+-lowering-+.f6498.6%
Simplified98.6%
(FPCore (w l) :precision binary64 (if (<= w -310.0) (/ l (exp w)) (* (pow l (exp w)) (- 1.0 w))))
double code(double w, double l) {
double tmp;
if (w <= -310.0) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) * (1.0 - w);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-310.0d0)) then
tmp = l / exp(w)
else
tmp = (l ** exp(w)) * (1.0d0 - w)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -310.0) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) * (1.0 - w);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -310.0: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) * (1.0 - w) return tmp
function code(w, l) tmp = 0.0 if (w <= -310.0) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) * Float64(1.0 - w)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -310.0) tmp = l / exp(w); else tmp = (l ^ exp(w)) * (1.0 - w); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -310.0], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * N[(1.0 - w), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -310:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(e^{w}\right)} \cdot \left(1 - w\right)\\
\end{array}
\end{array}
if w < -310Initial 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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
if -310 < w Initial program 99.6%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f6498.6%
Simplified98.6%
Final simplification99.0%
(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 99.7%
Taylor expanded in w around 0
Simplified97.1%
Final simplification97.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%
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
unsub-negN/A
div-expN/A
/-lowering-/.f64N/A
Simplified99.7%
Taylor expanded in w around 0
Simplified97.1%
(FPCore (w l) :precision binary64 (if (<= w 0.18) (* l (+ 1.0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666))))))) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.18) {
tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))));
} 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.18d0) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0)))))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.18) {
tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.18: tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))))) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.18) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.18) tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.18], N[(l * N[(1.0 + N[(w * N[(-1.0 + N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.18:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.17999999999999999Initial program 99.6%
Taylor expanded in w around 0
Simplified97.5%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6489.2%
Simplified89.2%
if 0.17999999999999999 < 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.7%
(FPCore (w l) :precision binary64 (if (<= w 0.13) (* l (+ 1.0 (* w (+ (* w 0.5) -1.0)))) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.13) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} 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.13d0) then
tmp = l * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.13) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.13: tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.13) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.13) tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.13], N[(l * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.13:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.13Initial program 99.6%
Taylor expanded in w around 0
Simplified97.5%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6484.4%
Simplified84.4%
if 0.13 < 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 simplification86.6%
(FPCore (w l) :precision binary64 (if (<= w 0.12) (* l (- 1.0 w)) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.12) {
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.12d0) 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.12) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.12: tmp = l * (1.0 - w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.12) 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.12) tmp = l * (1.0 - w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.12], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.12:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.12Initial program 99.6%
Taylor expanded in w around 0
Simplified97.5%
Taylor expanded in w around 0
neg-mul-1N/A
sub-negN/A
--lowering--.f6472.6%
Simplified72.6%
if 0.12 < 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 simplification76.5%
(FPCore (w l) :precision binary64 (if (<= w 0.26) l 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.26) {
tmp = l;
} 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.26d0) then
tmp = l
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.26) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.26: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.26) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.26) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.26], l, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.26:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.26000000000000001Initial program 99.6%
Taylor expanded in w around 0
Simplified64.9%
if 0.26000000000000001 < 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%
(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 99.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-rr17.1%
herbie shell --seed 2024191
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))