
(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 9 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 (/ (pow l (exp w)) (exp w)))
double code(double w, double l) {
return pow(l, exp(w)) / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = (l ** exp(w)) / exp(w)
end function
public static double code(double w, double l) {
return Math.pow(l, Math.exp(w)) / Math.exp(w);
}
def code(w, l): return math.pow(l, math.exp(w)) / math.exp(w)
function code(w, l) return Float64((l ^ exp(w)) / exp(w)) end
function tmp = code(w, l) tmp = (l ^ exp(w)) / exp(w); end
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}
\end{array}
Initial program 99.8%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.8%
Simplified99.8%
(FPCore (w l) :precision binary64 (/ l (exp w)))
double code(double w, double l) {
return l / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l / exp(w)
end function
public static double code(double w, double l) {
return l / Math.exp(w);
}
def code(w, l): return l / math.exp(w)
function code(w, l) return Float64(l / exp(w)) end
function tmp = code(w, l) tmp = l / exp(w); end
code[w_, l_] := N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{e^{w}}
\end{array}
Initial program 99.8%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.8%
Simplified99.8%
Taylor expanded in w around 0
Simplified99.0%
(FPCore (w l)
:precision binary64
(let* ((t_0 (+ -1.0 (* w 0.5))) (t_1 (* w t_0)))
(if (<= w -1.65e+77)
(* l (* -0.16666666666666666 (* w (* w w))))
(if (<= w 0.08)
(/
(* l (+ 1.0 (* w (* (* w w) (* t_0 (* t_0 t_0))))))
(+ 1.0 (* t_1 (+ -1.0 t_1))))
0.0))))
double code(double w, double l) {
double t_0 = -1.0 + (w * 0.5);
double t_1 = w * t_0;
double tmp;
if (w <= -1.65e+77) {
tmp = l * (-0.16666666666666666 * (w * (w * w)));
} else if (w <= 0.08) {
tmp = (l * (1.0 + (w * ((w * w) * (t_0 * (t_0 * t_0)))))) / (1.0 + (t_1 * (-1.0 + t_1)));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (-1.0d0) + (w * 0.5d0)
t_1 = w * t_0
if (w <= (-1.65d+77)) then
tmp = l * ((-0.16666666666666666d0) * (w * (w * w)))
else if (w <= 0.08d0) then
tmp = (l * (1.0d0 + (w * ((w * w) * (t_0 * (t_0 * t_0)))))) / (1.0d0 + (t_1 * ((-1.0d0) + t_1)))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = -1.0 + (w * 0.5);
double t_1 = w * t_0;
double tmp;
if (w <= -1.65e+77) {
tmp = l * (-0.16666666666666666 * (w * (w * w)));
} else if (w <= 0.08) {
tmp = (l * (1.0 + (w * ((w * w) * (t_0 * (t_0 * t_0)))))) / (1.0 + (t_1 * (-1.0 + t_1)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): t_0 = -1.0 + (w * 0.5) t_1 = w * t_0 tmp = 0 if w <= -1.65e+77: tmp = l * (-0.16666666666666666 * (w * (w * w))) elif w <= 0.08: tmp = (l * (1.0 + (w * ((w * w) * (t_0 * (t_0 * t_0)))))) / (1.0 + (t_1 * (-1.0 + t_1))) else: tmp = 0.0 return tmp
function code(w, l) t_0 = Float64(-1.0 + Float64(w * 0.5)) t_1 = Float64(w * t_0) tmp = 0.0 if (w <= -1.65e+77) tmp = Float64(l * Float64(-0.16666666666666666 * Float64(w * Float64(w * w)))); elseif (w <= 0.08) tmp = Float64(Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * w) * Float64(t_0 * Float64(t_0 * t_0)))))) / Float64(1.0 + Float64(t_1 * Float64(-1.0 + t_1)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) t_0 = -1.0 + (w * 0.5); t_1 = w * t_0; tmp = 0.0; if (w <= -1.65e+77) tmp = l * (-0.16666666666666666 * (w * (w * w))); elseif (w <= 0.08) tmp = (l * (1.0 + (w * ((w * w) * (t_0 * (t_0 * t_0)))))) / (1.0 + (t_1 * (-1.0 + t_1))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(w * t$95$0), $MachinePrecision]}, If[LessEqual[w, -1.65e+77], N[(l * N[(-0.16666666666666666 * N[(w * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.08], N[(N[(l * N[(1.0 + N[(w * N[(N[(w * w), $MachinePrecision] * N[(t$95$0 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(t$95$1 * N[(-1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := -1 + w \cdot 0.5\\
t_1 := w \cdot t\_0\\
\mathbf{if}\;w \leq -1.65 \cdot 10^{+77}:\\
\;\;\;\;\ell \cdot \left(-0.16666666666666666 \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\\
\mathbf{elif}\;w \leq 0.08:\\
\;\;\;\;\frac{\ell \cdot \left(1 + w \cdot \left(\left(w \cdot w\right) \cdot \left(t\_0 \cdot \left(t\_0 \cdot t\_0\right)\right)\right)\right)}{1 + t\_1 \cdot \left(-1 + t\_1\right)}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.6499999999999999e77Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified84.9%
Taylor expanded in w around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6494.8%
Simplified94.8%
if -1.6499999999999999e77 < w < 0.0800000000000000017Initial program 99.7%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.7%
Simplified99.7%
Taylor expanded in w around 0
Simplified98.4%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6490.6%
Simplified90.6%
flip3-+N/A
/-lowering-/.f64N/A
Applied egg-rr34.9%
Taylor expanded in l around 0
/-lowering-/.f64N/A
Simplified94.2%
if 0.0800000000000000017 < w Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Applied egg-rr100.0%
(FPCore (w l) :precision binary64 (if (<= w 0.07) (* 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.07) {
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.07d0) 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.07) {
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.07: 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.07) 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.07) 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.07], 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.07:\\
\;\;\;\;\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.070000000000000007Initial program 99.8%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.8%
Simplified99.8%
Taylor expanded in w around 0
Simplified98.8%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f6498.7%
Applied egg-rr98.7%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified89.6%
Taylor expanded in l around 0
*-lowering-*.f64N/A
+-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-*.f6492.2%
Simplified92.2%
if 0.070000000000000007 < w Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Applied egg-rr100.0%
(FPCore (w l) :precision binary64 (if (<= w -12.8) (* l (* -0.16666666666666666 (* w (* w w)))) (if (<= w 0.135) (- l (* l w)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -12.8) {
tmp = l * (-0.16666666666666666 * (w * (w * w)));
} else if (w <= 0.135) {
tmp = l - (l * 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 <= (-12.8d0)) then
tmp = l * ((-0.16666666666666666d0) * (w * (w * w)))
else if (w <= 0.135d0) then
tmp = l - (l * w)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -12.8) {
tmp = l * (-0.16666666666666666 * (w * (w * w)));
} else if (w <= 0.135) {
tmp = l - (l * w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -12.8: tmp = l * (-0.16666666666666666 * (w * (w * w))) elif w <= 0.135: tmp = l - (l * w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -12.8) tmp = Float64(l * Float64(-0.16666666666666666 * Float64(w * Float64(w * w)))); elseif (w <= 0.135) tmp = Float64(l - Float64(l * w)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -12.8) tmp = l * (-0.16666666666666666 * (w * (w * w))); elseif (w <= 0.135) tmp = l - (l * w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -12.8], N[(l * N[(-0.16666666666666666 * N[(w * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.135], N[(l - N[(l * w), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -12.8:\\
\;\;\;\;\ell \cdot \left(-0.16666666666666666 \cdot \left(w \cdot \left(w \cdot w\right)\right)\right)\\
\mathbf{elif}\;w \leq 0.135:\\
\;\;\;\;\ell - \ell \cdot w\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -12.800000000000001Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f64100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
Simplified71.8%
Taylor expanded in w around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
cube-multN/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6479.7%
Simplified79.7%
if -12.800000000000001 < w < 0.13500000000000001Initial program 99.7%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.7%
Simplified99.7%
Taylor expanded in w around 0
Simplified98.3%
Taylor expanded in w around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6498.3%
Simplified98.3%
if 0.13500000000000001 < w Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Applied egg-rr100.0%
(FPCore (w l) :precision binary64 (if (<= w -13.6) (* l (* (* w w) 0.5)) (if (<= w 0.235) (- l (* l w)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -13.6) {
tmp = l * ((w * w) * 0.5);
} else if (w <= 0.235) {
tmp = l - (l * 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 <= (-13.6d0)) then
tmp = l * ((w * w) * 0.5d0)
else if (w <= 0.235d0) then
tmp = l - (l * w)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -13.6) {
tmp = l * ((w * w) * 0.5);
} else if (w <= 0.235) {
tmp = l - (l * w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -13.6: tmp = l * ((w * w) * 0.5) elif w <= 0.235: tmp = l - (l * w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -13.6) tmp = Float64(l * Float64(Float64(w * w) * 0.5)); elseif (w <= 0.235) tmp = Float64(l - Float64(l * w)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -13.6) tmp = l * ((w * w) * 0.5); elseif (w <= 0.235) tmp = l - (l * w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -13.6], N[(l * N[(N[(w * w), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.235], N[(l - N[(l * w), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -13.6:\\
\;\;\;\;\ell \cdot \left(\left(w \cdot w\right) \cdot 0.5\right)\\
\mathbf{elif}\;w \leq 0.235:\\
\;\;\;\;\ell - \ell \cdot w\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -13.5999999999999996Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6454.3%
Simplified54.3%
flip3-+N/A
/-lowering-/.f64N/A
Applied egg-rr7.6%
Taylor expanded in w around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6467.6%
Simplified67.6%
if -13.5999999999999996 < w < 0.23499999999999999Initial program 99.7%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.7%
Simplified99.7%
Taylor expanded in w around 0
Simplified98.3%
Taylor expanded in w around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6498.3%
Simplified98.3%
if 0.23499999999999999 < w Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Applied egg-rr100.0%
Final simplification90.0%
(FPCore (w l) :precision binary64 (if (<= w 0.215) (- l (* l w)) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.215) {
tmp = l - (l * 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.215d0) then
tmp = l - (l * w)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.215) {
tmp = l - (l * w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.215: tmp = l - (l * w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.215) tmp = Float64(l - Float64(l * w)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.215) tmp = l - (l * w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.215], N[(l - N[(l * w), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.215:\\
\;\;\;\;\ell - \ell \cdot w\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.214999999999999997Initial program 99.8%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.8%
Simplified99.8%
Taylor expanded in w around 0
Simplified98.8%
Taylor expanded in w around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6473.7%
Simplified73.7%
if 0.214999999999999997 < w Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Applied egg-rr100.0%
(FPCore (w l) :precision binary64 (if (<= w 0.1) l 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.1) {
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.1d0) 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.1) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.1: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.1) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.1) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.1], l, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.1:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.10000000000000001Initial program 99.8%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.8%
Simplified99.8%
Taylor expanded in w around 0
Simplified67.1%
if 0.10000000000000001 < w Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
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.8%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.8%
Simplified99.8%
Applied egg-rr18.2%
herbie shell --seed 2024158
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))