
(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 (/ (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%
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.9%
(FPCore (w l) :precision binary64 (if (<= w -0.68) (/ 1.0 (exp w)) (if (<= w 2.4) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.68) {
tmp = 1.0 / exp(w);
} else if (w <= 2.4) {
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.68d0)) then
tmp = 1.0d0 / exp(w)
else if (w <= 2.4d0) 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.68) {
tmp = 1.0 / Math.exp(w);
} else if (w <= 2.4) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.68: tmp = 1.0 / math.exp(w) elif w <= 2.4: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.68) tmp = Float64(1.0 / exp(w)); elseif (w <= 2.4) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.68) tmp = 1.0 / exp(w); elseif (w <= 2.4) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.68], N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.68:\\
\;\;\;\;\frac{1}{e^{w}}\\
\mathbf{elif}\;w \leq 2.4:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.680000000000000049Initial program 100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval99.1%
Applied egg-rr99.1%
*-rgt-identityN/A
exp-negN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6499.1%
Applied egg-rr99.1%
if -0.680000000000000049 < w < 2.39999999999999991Initial program 99.8%
Taylor expanded in w around 0
Simplified97.3%
if 2.39999999999999991 < 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 (/ 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%
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.9%
Taylor expanded in w around 0
Simplified98.3%
(FPCore (w l)
:precision binary64
(let* ((t_0 (* w (* w w))))
(if (<= w -5.6e+102)
(+ 1.0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666))))))
(if (<= w -0.7)
(+
1.0
(/
(/ (* w (+ 1.0 (* -0.015625 (* t_0 t_0)))) (+ -1.0 (* t_0 -0.125)))
(+ 1.0 (* (* w 0.5) (- (* w 0.5) -1.0)))))
(if (<= w 2.4) l 0.0)))))
double code(double w, double l) {
double t_0 = w * (w * w);
double tmp;
if (w <= -5.6e+102) {
tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
} else if (w <= -0.7) {
tmp = 1.0 + (((w * (1.0 + (-0.015625 * (t_0 * t_0)))) / (-1.0 + (t_0 * -0.125))) / (1.0 + ((w * 0.5) * ((w * 0.5) - -1.0))));
} else if (w <= 2.4) {
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) :: t_0
real(8) :: tmp
t_0 = w * (w * w)
if (w <= (-5.6d+102)) then
tmp = 1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0))))))
else if (w <= (-0.7d0)) then
tmp = 1.0d0 + (((w * (1.0d0 + ((-0.015625d0) * (t_0 * t_0)))) / ((-1.0d0) + (t_0 * (-0.125d0)))) / (1.0d0 + ((w * 0.5d0) * ((w * 0.5d0) - (-1.0d0)))))
else if (w <= 2.4d0) then
tmp = l
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = w * (w * w);
double tmp;
if (w <= -5.6e+102) {
tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
} else if (w <= -0.7) {
tmp = 1.0 + (((w * (1.0 + (-0.015625 * (t_0 * t_0)))) / (-1.0 + (t_0 * -0.125))) / (1.0 + ((w * 0.5) * ((w * 0.5) - -1.0))));
} else if (w <= 2.4) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): t_0 = w * (w * w) tmp = 0 if w <= -5.6e+102: tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))) elif w <= -0.7: tmp = 1.0 + (((w * (1.0 + (-0.015625 * (t_0 * t_0)))) / (-1.0 + (t_0 * -0.125))) / (1.0 + ((w * 0.5) * ((w * 0.5) - -1.0)))) elif w <= 2.4: tmp = l else: tmp = 0.0 return tmp
function code(w, l) t_0 = Float64(w * Float64(w * w)) tmp = 0.0 if (w <= -5.6e+102) tmp = Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666)))))); elseif (w <= -0.7) tmp = Float64(1.0 + Float64(Float64(Float64(w * Float64(1.0 + Float64(-0.015625 * Float64(t_0 * t_0)))) / Float64(-1.0 + Float64(t_0 * -0.125))) / Float64(1.0 + Float64(Float64(w * 0.5) * Float64(Float64(w * 0.5) - -1.0))))); elseif (w <= 2.4) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) t_0 = w * (w * w); tmp = 0.0; if (w <= -5.6e+102) tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))); elseif (w <= -0.7) tmp = 1.0 + (((w * (1.0 + (-0.015625 * (t_0 * t_0)))) / (-1.0 + (t_0 * -0.125))) / (1.0 + ((w * 0.5) * ((w * 0.5) - -1.0)))); elseif (w <= 2.4) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[(w * N[(w * w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -5.6e+102], N[(1.0 + N[(w * N[(-1.0 + N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, -0.7], N[(1.0 + N[(N[(N[(w * N[(1.0 + N[(-0.015625 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 + N[(t$95$0 * -0.125), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(N[(w * 0.5), $MachinePrecision] * N[(N[(w * 0.5), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], l, 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \left(w \cdot w\right)\\
\mathbf{if}\;w \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\
\mathbf{elif}\;w \leq -0.7:\\
\;\;\;\;1 + \frac{\frac{w \cdot \left(1 + -0.015625 \cdot \left(t\_0 \cdot t\_0\right)\right)}{-1 + t\_0 \cdot -0.125}}{1 + \left(w \cdot 0.5\right) \cdot \left(w \cdot 0.5 - -1\right)}\\
\mathbf{elif}\;w \leq 2.4:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -5.60000000000000037e102Initial program 100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
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-*.f64100.0%
Simplified100.0%
if -5.60000000000000037e102 < w < -0.69999999999999996Initial program 100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval97.6%
Applied egg-rr97.6%
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-*.f644.4%
Simplified4.4%
*-commutativeN/A
flip3-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
*-commutativeN/A
unpow-prod-downN/A
*-lowering-*.f64N/A
metadata-evalN/A
cube-multN/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
metadata-evalN/A
+-lowering-+.f64N/A
distribute-rgt-out--N/A
*-lowering-*.f64N/A
Applied egg-rr25.8%
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr53.6%
if -0.69999999999999996 < w < 2.39999999999999991Initial program 99.8%
Taylor expanded in w around 0
Simplified97.3%
if 2.39999999999999991 < 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 simplification93.0%
(FPCore (w l) :precision binary64 (if (<= w 0.13) (+ l (* w (- (* w (- (* l 0.5) (* (* l w) 0.16666666666666666))) l))) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.13) {
tmp = l + (w * ((w * ((l * 0.5) - ((l * w) * 0.16666666666666666))) - 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.13d0) then
tmp = l + (w * ((w * ((l * 0.5d0) - ((l * w) * 0.16666666666666666d0))) - l))
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 + (w * ((w * ((l * 0.5) - ((l * w) * 0.16666666666666666))) - l));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.13: tmp = l + (w * ((w * ((l * 0.5) - ((l * w) * 0.16666666666666666))) - l)) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.13) tmp = Float64(l + Float64(w * Float64(Float64(w * Float64(Float64(l * 0.5) - Float64(Float64(l * w) * 0.16666666666666666))) - l))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.13) tmp = l + (w * ((w * ((l * 0.5) - ((l * w) * 0.16666666666666666))) - l)); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.13], N[(l + N[(w * N[(N[(w * N[(N[(l * 0.5), $MachinePrecision] - N[(N[(l * w), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.13:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \left(\ell \cdot 0.5 - \left(\ell \cdot w\right) \cdot 0.16666666666666666\right) - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.13Initial program 99.9%
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.9%
Taylor expanded in w around 0
Simplified98.3%
Taylor expanded in w around 0
Simplified86.6%
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-rr97.9%
(FPCore (w l) :precision binary64 (if (<= w -3e+97) (+ 1.0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666)))))) (if (<= w 2.4) (+ l (* w (* l (+ -1.0 (* w 0.5))))) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -3e+97) {
tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
} else if (w <= 2.4) {
tmp = l + (w * (l * (-1.0 + (w * 0.5))));
} 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 <= (-3d+97)) then
tmp = 1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0))))))
else if (w <= 2.4d0) then
tmp = l + (w * (l * ((-1.0d0) + (w * 0.5d0))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -3e+97) {
tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
} else if (w <= 2.4) {
tmp = l + (w * (l * (-1.0 + (w * 0.5))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -3e+97: tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))) elif w <= 2.4: tmp = l + (w * (l * (-1.0 + (w * 0.5)))) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -3e+97) tmp = Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666)))))); elseif (w <= 2.4) tmp = Float64(l + Float64(w * Float64(l * Float64(-1.0 + Float64(w * 0.5))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -3e+97) tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))); elseif (w <= 2.4) tmp = l + (w * (l * (-1.0 + (w * 0.5)))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -3e+97], N[(1.0 + N[(w * N[(-1.0 + N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], N[(l + N[(w * N[(l * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -3 \cdot 10^{+97}:\\
\;\;\;\;1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\
\mathbf{elif}\;w \leq 2.4:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \left(-1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -2.9999999999999998e97Initial program 100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
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-*.f6496.5%
Simplified96.5%
if -2.9999999999999998e97 < w < 2.39999999999999991Initial program 99.8%
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.8%
Taylor expanded in w around 0
Simplified97.2%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/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
associate-*r*N/A
*-commutativeN/A
mul-1-negN/A
distribute-rgt-outN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
Simplified82.8%
if 2.39999999999999991 < 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 (if (<= w -1.9e+154) (* w (* w 0.5)) (if (<= w 2.4) (+ l (* w (* l (+ -1.0 (* w 0.5))))) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -1.9e+154) {
tmp = w * (w * 0.5);
} else if (w <= 2.4) {
tmp = l + (w * (l * (-1.0 + (w * 0.5))));
} 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 <= (-1.9d+154)) then
tmp = w * (w * 0.5d0)
else if (w <= 2.4d0) then
tmp = l + (w * (l * ((-1.0d0) + (w * 0.5d0))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.9e+154) {
tmp = w * (w * 0.5);
} else if (w <= 2.4) {
tmp = l + (w * (l * (-1.0 + (w * 0.5))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.9e+154: tmp = w * (w * 0.5) elif w <= 2.4: tmp = l + (w * (l * (-1.0 + (w * 0.5)))) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -1.9e+154) tmp = Float64(w * Float64(w * 0.5)); elseif (w <= 2.4) tmp = Float64(l + Float64(w * Float64(l * Float64(-1.0 + Float64(w * 0.5))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.9e+154) tmp = w * (w * 0.5); elseif (w <= 2.4) tmp = l + (w * (l * (-1.0 + (w * 0.5)))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.9e+154], N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], N[(l + N[(w * N[(l * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.9 \cdot 10^{+154}:\\
\;\;\;\;w \cdot \left(w \cdot 0.5\right)\\
\mathbf{elif}\;w \leq 2.4:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \left(-1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.8999999999999999e154Initial program 100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
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-*.f64100.0%
Simplified100.0%
Taylor expanded in w around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
if -1.8999999999999999e154 < w < 2.39999999999999991Initial program 99.8%
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.8%
Taylor expanded in w around 0
Simplified97.4%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/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
associate-*r*N/A
*-commutativeN/A
mul-1-negN/A
distribute-rgt-outN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
Simplified81.4%
if 2.39999999999999991 < 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 (if (<= w -1.8e+142) (* w (* w 0.5)) (if (<= w 0.19) (* l (- 1.0 w)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -1.8e+142) {
tmp = w * (w * 0.5);
} else if (w <= 0.19) {
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 <= (-1.8d+142)) then
tmp = w * (w * 0.5d0)
else if (w <= 0.19d0) 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 <= -1.8e+142) {
tmp = w * (w * 0.5);
} else if (w <= 0.19) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.8e+142: tmp = w * (w * 0.5) elif w <= 0.19: tmp = l * (1.0 - w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -1.8e+142) tmp = Float64(w * Float64(w * 0.5)); elseif (w <= 0.19) 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 <= -1.8e+142) tmp = w * (w * 0.5); elseif (w <= 0.19) tmp = l * (1.0 - w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.8e+142], N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.19], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.8 \cdot 10^{+142}:\\
\;\;\;\;w \cdot \left(w \cdot 0.5\right)\\
\mathbf{elif}\;w \leq 0.19:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.8000000000000001e142Initial program 100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
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-*.f6497.7%
Simplified97.7%
Taylor expanded in w around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6497.7%
Simplified97.7%
if -1.8000000000000001e142 < w < 0.19Initial program 99.8%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f6475.9%
Simplified75.9%
Taylor expanded in w around 0
Simplified79.3%
if 0.19 < 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-rr97.9%
Final simplification85.5%
(FPCore (w l) :precision binary64 (if (<= w -3.5e+65) (* w (* w 0.5)) (if (<= w 2.4) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -3.5e+65) {
tmp = w * (w * 0.5);
} else if (w <= 2.4) {
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 <= (-3.5d+65)) then
tmp = w * (w * 0.5d0)
else if (w <= 2.4d0) 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 <= -3.5e+65) {
tmp = w * (w * 0.5);
} else if (w <= 2.4) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -3.5e+65: tmp = w * (w * 0.5) elif w <= 2.4: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -3.5e+65) tmp = Float64(w * Float64(w * 0.5)); elseif (w <= 2.4) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -3.5e+65) tmp = w * (w * 0.5); elseif (w <= 2.4) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -3.5e+65], N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.4], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -3.5 \cdot 10^{+65}:\\
\;\;\;\;w \cdot \left(w \cdot 0.5\right)\\
\mathbf{elif}\;w \leq 2.4:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -3.5000000000000001e65Initial program 100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
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-*.f6467.1%
Simplified67.1%
Taylor expanded in w around inf
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6467.1%
Simplified67.1%
if -3.5000000000000001e65 < w < 2.39999999999999991Initial program 99.8%
Taylor expanded in w around 0
Simplified84.4%
if 2.39999999999999991 < 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 (if (<= w 2.4) l 0.0))
double code(double w, double l) {
double tmp;
if (w <= 2.4) {
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 <= 2.4d0) 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 <= 2.4) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 2.4: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 2.4) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 2.4) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 2.4], l, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 2.4:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 2.39999999999999991Initial program 99.9%
Taylor expanded in w around 0
Simplified61.6%
if 2.39999999999999991 < 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.9%
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-rr20.0%
herbie shell --seed 2024185
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))