
(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 20 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.6)
(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 = 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 = 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 = 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 = 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 = exp(Float64(-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 = 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[Exp[(-w)], $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:\\
\;\;\;\;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%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod0.0%
add-sqr-sqrt0.2%
pow10.2%
exp-neg0.2%
inv-pow0.2%
pow-prod-up95.7%
metadata-eval95.7%
metadata-eval95.7%
metadata-eval95.7%
Applied egg-rr95.7%
add-exp-log95.7%
*-rgt-identity95.7%
log-div95.7%
add-log-exp95.7%
Applied egg-rr95.7%
Taylor expanded in w around inf 99.7%
neg-mul-199.7%
Simplified99.7%
if -1.6000000000000001 < w Initial program 98.2%
exp-neg98.2%
remove-double-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in w around 0 99.3%
*-commutative99.3%
Simplified99.3%
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
Initial program 98.6%
(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 98.6%
exp-neg98.6%
remove-double-neg98.6%
associate-*l/98.6%
*-lft-identity98.6%
remove-double-neg98.6%
Simplified98.6%
(FPCore (w l) :precision binary64 (if (<= w -4.0) (exp (- w)) (/ (pow l (exp w)) (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -4.0) {
tmp = 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 <= (-4.0d0)) then
tmp = 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 <= -4.0) {
tmp = 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 <= -4.0: tmp = 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 <= -4.0) tmp = exp(Float64(-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 <= -4.0) tmp = 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, -4.0], N[Exp[(-w)], $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 -4:\\
\;\;\;\;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 < -4Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod0.0%
add-sqr-sqrt0.2%
pow10.2%
exp-neg0.2%
inv-pow0.2%
pow-prod-up95.7%
metadata-eval95.7%
metadata-eval95.7%
metadata-eval95.7%
Applied egg-rr95.7%
add-exp-log95.7%
*-rgt-identity95.7%
log-div95.7%
add-log-exp95.7%
Applied egg-rr95.7%
Taylor expanded in w around inf 99.7%
neg-mul-199.7%
Simplified99.7%
if -4 < w Initial program 98.2%
exp-neg98.2%
remove-double-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in w around 0 99.2%
*-commutative99.2%
Simplified99.2%
(FPCore (w l) :precision binary64 (let* ((t_0 (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))) (if (<= w -1.55) (exp (- w)) (/ (pow l t_0) t_0))))
double code(double w, double l) {
double t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))));
double tmp;
if (w <= -1.55) {
tmp = exp(-w);
} else {
tmp = pow(l, t_0) / t_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 = 1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0)))))
if (w <= (-1.55d0)) then
tmp = exp(-w)
else
tmp = (l ** t_0) / t_0
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))));
double tmp;
if (w <= -1.55) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, t_0) / t_0;
}
return tmp;
}
def code(w, l): t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))) tmp = 0 if w <= -1.55: tmp = math.exp(-w) else: tmp = math.pow(l, t_0) / t_0 return tmp
function code(w, l) t_0 = Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666)))))) tmp = 0.0 if (w <= -1.55) tmp = exp(Float64(-w)); else tmp = Float64((l ^ t_0) / t_0); end return tmp end
function tmp_2 = code(w, l) t_0 = 1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))); tmp = 0.0; if (w <= -1.55) tmp = exp(-w); else tmp = (l ^ t_0) / t_0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = 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, -1.55], N[Exp[(-w)], $MachinePrecision], N[(N[Power[l, t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\\
\mathbf{if}\;w \leq -1.55:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\
\end{array}
\end{array}
if w < -1.55000000000000004Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod0.0%
add-sqr-sqrt0.2%
pow10.2%
exp-neg0.2%
inv-pow0.2%
pow-prod-up95.7%
metadata-eval95.7%
metadata-eval95.7%
metadata-eval95.7%
Applied egg-rr95.7%
add-exp-log95.7%
*-rgt-identity95.7%
log-div95.7%
add-log-exp95.7%
Applied egg-rr95.7%
Taylor expanded in w around inf 99.7%
neg-mul-199.7%
Simplified99.7%
if -1.55000000000000004 < w Initial program 98.2%
exp-neg98.2%
remove-double-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in w around 0 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in w around 0 99.1%
*-commutative99.3%
Simplified99.1%
(FPCore (w l)
:precision binary64
(if (<= w -1.3)
(exp (- w))
(/
(pow l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))
(+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -1.3) {
tmp = exp(-w);
} else {
tmp = pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (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.3d0)) then
tmp = exp(-w)
else
tmp = (l ** (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))) / (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.3) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.3: tmp = math.exp(-w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.3) tmp = exp(Float64(-w)); else tmp = Float64((l ^ Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))) / 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.3) tmp = exp(-w); else tmp = (l ^ (1.0 + (w * (1.0 + (w * 0.5))))) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.3], N[Exp[(-w)], $MachinePrecision], N[(N[Power[l, N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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.3:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < -1.30000000000000004Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod0.0%
add-sqr-sqrt0.2%
pow10.2%
exp-neg0.2%
inv-pow0.2%
pow-prod-up95.7%
metadata-eval95.7%
metadata-eval95.7%
metadata-eval95.7%
Applied egg-rr95.7%
add-exp-log95.7%
*-rgt-identity95.7%
log-div95.7%
add-log-exp95.7%
Applied egg-rr95.7%
Taylor expanded in w around inf 99.7%
neg-mul-199.7%
Simplified99.7%
if -1.30000000000000004 < w Initial program 98.2%
exp-neg98.2%
remove-double-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in w around 0 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in w around 0 99.0%
*-commutative99.2%
Simplified99.0%
(FPCore (w l)
:precision binary64
(if (<= w -1.0)
(exp (- w))
(/
(pow l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))
(+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = exp(-w);
} else {
tmp = pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (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 = exp(-w)
else
tmp = (l ** (1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0))))))) / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = math.exp(-w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = exp(Float64(-w)); else tmp = Float64((l ^ Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666))))))) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = exp(-w); else tmp = (l ^ (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[Exp[(-w)], $MachinePrecision], N[(N[Power[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] / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod0.0%
add-sqr-sqrt0.2%
pow10.2%
exp-neg0.2%
inv-pow0.2%
pow-prod-up95.7%
metadata-eval95.7%
metadata-eval95.7%
metadata-eval95.7%
Applied egg-rr95.7%
add-exp-log95.7%
*-rgt-identity95.7%
log-div95.7%
add-log-exp95.7%
Applied egg-rr95.7%
Taylor expanded in w around inf 99.7%
neg-mul-199.7%
Simplified99.7%
if -1 < w Initial program 98.2%
exp-neg98.2%
remove-double-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in w around 0 99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in w around 0 99.0%
*-commutative99.3%
Simplified99.0%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (exp (- w)) (/ (pow l (+ 1.0 (* w (+ 1.0 (* w 0.5))))) (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = exp(-w);
} else {
tmp = pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (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 = exp(-w)
else
tmp = (l ** (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))) / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = math.exp(-w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = exp(Float64(-w)); else tmp = Float64((l ^ Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = exp(-w); else tmp = (l ^ (1.0 + (w * (1.0 + (w * 0.5))))) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[Exp[(-w)], $MachinePrecision], N[(N[Power[l, N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod0.0%
add-sqr-sqrt0.2%
pow10.2%
exp-neg0.2%
inv-pow0.2%
pow-prod-up95.7%
metadata-eval95.7%
metadata-eval95.7%
metadata-eval95.7%
Applied egg-rr95.7%
add-exp-log95.7%
*-rgt-identity95.7%
log-div95.7%
add-log-exp95.7%
Applied egg-rr95.7%
Taylor expanded in w around inf 99.7%
neg-mul-199.7%
Simplified99.7%
if -1 < w Initial program 98.2%
exp-neg98.2%
remove-double-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in w around 0 99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in w around 0 99.0%
*-commutative99.2%
Simplified99.0%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (exp (- w)) (/ (pow l (+ w 1.0)) (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = exp(-w);
} else {
tmp = pow(l, (w + 1.0)) / (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 = exp(-w)
else
tmp = (l ** (w + 1.0d0)) / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, (w + 1.0)) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = math.exp(-w) else: tmp = math.pow(l, (w + 1.0)) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = exp(Float64(-w)); else tmp = Float64((l ^ Float64(w + 1.0)) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = exp(-w); else tmp = (l ^ (w + 1.0)) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[Exp[(-w)], $MachinePrecision], N[(N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision] / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(w + 1\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod0.0%
add-sqr-sqrt0.2%
pow10.2%
exp-neg0.2%
inv-pow0.2%
pow-prod-up95.7%
metadata-eval95.7%
metadata-eval95.7%
metadata-eval95.7%
Applied egg-rr95.7%
add-exp-log95.7%
*-rgt-identity95.7%
log-div95.7%
add-log-exp95.7%
Applied egg-rr95.7%
Taylor expanded in w around inf 99.7%
neg-mul-199.7%
Simplified99.7%
if -1 < w Initial program 98.2%
exp-neg98.2%
remove-double-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
remove-double-neg98.2%
Simplified98.2%
Taylor expanded in w around 0 99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in w around 0 98.8%
+-commutative99.0%
Simplified98.8%
(FPCore (w l) :precision binary64 (if (or (<= w -0.7) (not (<= w 620.0))) (exp (- w)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if ((w <= -0.7) || !(w <= 620.0)) {
tmp = exp(-w);
} else {
tmp = l / (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 <= (-0.7d0)) .or. (.not. (w <= 620.0d0))) then
tmp = exp(-w)
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if ((w <= -0.7) || !(w <= 620.0)) {
tmp = Math.exp(-w);
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if (w <= -0.7) or not (w <= 620.0): tmp = math.exp(-w) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if ((w <= -0.7) || !(w <= 620.0)) tmp = exp(Float64(-w)); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((w <= -0.7) || ~((w <= 620.0))) tmp = exp(-w); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[Or[LessEqual[w, -0.7], N[Not[LessEqual[w, 620.0]], $MachinePrecision]], N[Exp[(-w)], $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7 \lor \neg \left(w \leq 620\right):\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -0.69999999999999996 or 620 < w Initial program 97.3%
exp-neg97.3%
remove-double-neg97.3%
associate-*l/97.3%
*-lft-identity97.3%
remove-double-neg97.3%
Simplified97.3%
add-sqr-sqrt37.8%
sqrt-unprod65.9%
sqr-neg65.9%
sqrt-unprod28.0%
add-sqr-sqrt65.9%
add-sqr-sqrt65.9%
sqrt-unprod65.9%
add-sqr-sqrt28.0%
sqrt-unprod28.0%
sqr-neg28.0%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up94.8%
metadata-eval94.8%
metadata-eval94.8%
metadata-eval94.8%
Applied egg-rr94.8%
add-exp-log94.8%
*-rgt-identity94.8%
log-div94.8%
add-log-exp94.8%
Applied egg-rr94.8%
Taylor expanded in w around inf 97.2%
neg-mul-197.2%
Simplified97.2%
if -0.69999999999999996 < w < 620Initial program 99.7%
exp-neg99.7%
remove-double-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
remove-double-neg99.7%
Simplified99.7%
add-sqr-sqrt49.4%
sqrt-unprod98.6%
sqr-neg98.6%
sqrt-unprod49.2%
add-sqr-sqrt97.1%
add-sqr-sqrt97.1%
sqrt-unprod97.1%
add-sqr-sqrt49.2%
sqrt-unprod97.1%
sqr-neg97.1%
sqrt-unprod47.9%
add-sqr-sqrt97.1%
pow197.1%
exp-neg97.1%
inv-pow97.1%
pow-prod-up97.1%
metadata-eval97.1%
metadata-eval97.1%
metadata-eval97.1%
Applied egg-rr97.1%
Taylor expanded in l around 0 97.1%
Taylor expanded in w around 0 97.1%
+-commutative98.7%
Simplified97.1%
Final simplification97.2%
(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 98.6%
exp-neg98.6%
remove-double-neg98.6%
associate-*l/98.6%
*-lft-identity98.6%
remove-double-neg98.6%
Simplified98.6%
add-sqr-sqrt44.4%
sqrt-unprod84.4%
sqr-neg84.4%
sqrt-unprod40.0%
add-sqr-sqrt83.6%
add-sqr-sqrt83.6%
sqrt-unprod83.6%
add-sqr-sqrt40.0%
sqrt-unprod67.2%
sqr-neg67.2%
sqrt-unprod27.1%
add-sqr-sqrt55.1%
pow155.1%
exp-neg55.1%
inv-pow55.1%
pow-prod-up96.1%
metadata-eval96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Taylor expanded in l around 0 96.1%
(FPCore (w l) :precision binary64 (if (<= w 0.12) (+ l (* l (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0)))) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.12) {
tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.12d0) then
tmp = l + (l * (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.12) {
tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.12: tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.12) tmp = Float64(l + Float64(l * Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0)))); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.12) tmp = l + (l * (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.12], N[(l + N[(l * N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.12:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 0.12Initial program 99.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
add-sqr-sqrt33.9%
sqrt-unprod82.5%
sqr-neg82.5%
sqrt-unprod48.6%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt48.6%
sqrt-unprod81.5%
sqr-neg81.5%
sqrt-unprod32.9%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up96.7%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in w around 0 87.7%
Taylor expanded in l around 0 89.4%
if 0.12 < w Initial program 93.3%
exp-neg93.3%
remove-double-neg93.3%
associate-*l/93.3%
*-lft-identity93.3%
remove-double-neg93.3%
Simplified93.3%
add-sqr-sqrt93.3%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod0.0%
add-sqr-sqrt93.4%
add-sqr-sqrt93.4%
sqrt-unprod93.4%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up93.4%
metadata-eval93.4%
metadata-eval93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Taylor expanded in w around 0 3.2%
mul-1-neg3.2%
unsub-neg3.2%
Simplified3.2%
Taylor expanded in w around inf 3.2%
neg-mul-13.2%
distribute-lft-neg-in3.2%
*-commutative3.2%
Simplified3.2%
neg-mul-13.2%
expm1-log1p-u3.2%
expm1-undefine89.0%
neg-mul-189.0%
Applied egg-rr89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
log1p-undefine89.0%
rem-exp-log89.0%
unsub-neg89.0%
Simplified89.0%
Final simplification89.3%
(FPCore (w l) :precision binary64 (if (<= w 0.25) (+ l (* l (* w (+ (* w (* w -0.16666666666666666)) -1.0)))) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.25) {
tmp = l + (l * (w * ((w * (w * -0.16666666666666666)) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.25d0) then
tmp = l + (l * (w * ((w * (w * (-0.16666666666666666d0))) + (-1.0d0))))
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.25) {
tmp = l + (l * (w * ((w * (w * -0.16666666666666666)) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.25: tmp = l + (l * (w * ((w * (w * -0.16666666666666666)) + -1.0))) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.25) tmp = Float64(l + Float64(l * Float64(w * Float64(Float64(w * Float64(w * -0.16666666666666666)) + -1.0)))); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.25) tmp = l + (l * (w * ((w * (w * -0.16666666666666666)) + -1.0))); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.25], N[(l + N[(l * N[(w * N[(N[(w * N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.25:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(w \cdot \left(w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 0.25Initial program 99.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
add-sqr-sqrt33.9%
sqrt-unprod82.5%
sqr-neg82.5%
sqrt-unprod48.6%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt48.6%
sqrt-unprod81.5%
sqr-neg81.5%
sqrt-unprod32.9%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up96.7%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in w around 0 87.7%
Taylor expanded in l around 0 89.4%
Taylor expanded in w around inf 89.4%
*-commutative89.4%
Simplified89.4%
if 0.25 < w Initial program 93.3%
exp-neg93.3%
remove-double-neg93.3%
associate-*l/93.3%
*-lft-identity93.3%
remove-double-neg93.3%
Simplified93.3%
add-sqr-sqrt93.3%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod0.0%
add-sqr-sqrt93.4%
add-sqr-sqrt93.4%
sqrt-unprod93.4%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up93.4%
metadata-eval93.4%
metadata-eval93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Taylor expanded in w around 0 3.2%
mul-1-neg3.2%
unsub-neg3.2%
Simplified3.2%
Taylor expanded in w around inf 3.2%
neg-mul-13.2%
distribute-lft-neg-in3.2%
*-commutative3.2%
Simplified3.2%
neg-mul-13.2%
expm1-log1p-u3.2%
expm1-undefine89.0%
neg-mul-189.0%
Applied egg-rr89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
log1p-undefine89.0%
rem-exp-log89.0%
unsub-neg89.0%
Simplified89.0%
Final simplification89.3%
(FPCore (w l) :precision binary64 (if (<= w 0.23) (* l (+ 1.0 (* w (+ (* w 0.5) -1.0)))) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.23) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.23d0) then
tmp = l * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.23) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.23: tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.23) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.23) tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.23], N[(l * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.23:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 0.23000000000000001Initial program 99.8%
Taylor expanded in w around 0 82.3%
add-sqr-sqrt33.9%
sqrt-unprod82.5%
sqr-neg82.5%
sqrt-unprod48.6%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt48.6%
sqrt-unprod81.5%
sqr-neg81.5%
sqrt-unprod32.9%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up96.7%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
Applied egg-rr87.3%
if 0.23000000000000001 < w Initial program 93.3%
exp-neg93.3%
remove-double-neg93.3%
associate-*l/93.3%
*-lft-identity93.3%
remove-double-neg93.3%
Simplified93.3%
add-sqr-sqrt93.3%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod0.0%
add-sqr-sqrt93.4%
add-sqr-sqrt93.4%
sqrt-unprod93.4%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up93.4%
metadata-eval93.4%
metadata-eval93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Taylor expanded in w around 0 3.2%
mul-1-neg3.2%
unsub-neg3.2%
Simplified3.2%
Taylor expanded in w around inf 3.2%
neg-mul-13.2%
distribute-lft-neg-in3.2%
*-commutative3.2%
Simplified3.2%
neg-mul-13.2%
expm1-log1p-u3.2%
expm1-undefine89.0%
neg-mul-189.0%
Applied egg-rr89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
log1p-undefine89.0%
rem-exp-log89.0%
unsub-neg89.0%
Simplified89.0%
Final simplification87.6%
(FPCore (w l) :precision binary64 (if (<= w 0.18) (+ l (* l (* w (+ (* w 0.5) -1.0)))) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.18) {
tmp = l + (l * (w * ((w * 0.5) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.18d0) then
tmp = l + (l * (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.18) {
tmp = l + (l * (w * ((w * 0.5) + -1.0)));
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.18: tmp = l + (l * (w * ((w * 0.5) + -1.0))) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.18) tmp = Float64(l + Float64(l * Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.18) tmp = l + (l * (w * ((w * 0.5) + -1.0))); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.18], N[(l + N[(l * N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.18:\\
\;\;\;\;\ell + \ell \cdot \left(w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 0.17999999999999999Initial program 99.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
add-sqr-sqrt33.9%
sqrt-unprod82.5%
sqr-neg82.5%
sqrt-unprod48.6%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt48.6%
sqrt-unprod81.5%
sqr-neg81.5%
sqrt-unprod32.9%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up96.7%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in w around 0 87.7%
Taylor expanded in l around 0 89.4%
Taylor expanded in w around 0 87.3%
*-commutative87.3%
Simplified87.3%
if 0.17999999999999999 < w Initial program 93.3%
exp-neg93.3%
remove-double-neg93.3%
associate-*l/93.3%
*-lft-identity93.3%
remove-double-neg93.3%
Simplified93.3%
add-sqr-sqrt93.3%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod0.0%
add-sqr-sqrt93.4%
add-sqr-sqrt93.4%
sqrt-unprod93.4%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up93.4%
metadata-eval93.4%
metadata-eval93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Taylor expanded in w around 0 3.2%
mul-1-neg3.2%
unsub-neg3.2%
Simplified3.2%
Taylor expanded in w around inf 3.2%
neg-mul-13.2%
distribute-lft-neg-in3.2%
*-commutative3.2%
Simplified3.2%
neg-mul-13.2%
expm1-log1p-u3.2%
expm1-undefine89.0%
neg-mul-189.0%
Applied egg-rr89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
log1p-undefine89.0%
rem-exp-log89.0%
unsub-neg89.0%
Simplified89.0%
Final simplification87.6%
(FPCore (w l) :precision binary64 (if (<= w 0.17) (* l (- 1.0 w)) (* w (+ (- 1.0 l) -1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.17) {
tmp = l * (1.0 - w);
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.17d0) then
tmp = l * (1.0d0 - w)
else
tmp = w * ((1.0d0 - l) + (-1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.17) {
tmp = l * (1.0 - w);
} else {
tmp = w * ((1.0 - l) + -1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.17: tmp = l * (1.0 - w) else: tmp = w * ((1.0 - l) + -1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.17) tmp = Float64(l * Float64(1.0 - w)); else tmp = Float64(w * Float64(Float64(1.0 - l) + -1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.17) tmp = l * (1.0 - w); else tmp = w * ((1.0 - l) + -1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.17], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], N[(w * N[(N[(1.0 - l), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.17:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;w \cdot \left(\left(1 - \ell\right) + -1\right)\\
\end{array}
\end{array}
if w < 0.170000000000000012Initial program 99.8%
exp-neg99.8%
remove-double-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
remove-double-neg99.8%
Simplified99.8%
add-sqr-sqrt33.9%
sqrt-unprod82.5%
sqr-neg82.5%
sqrt-unprod48.6%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt48.6%
sqrt-unprod81.5%
sqr-neg81.5%
sqrt-unprod32.9%
add-sqr-sqrt66.8%
pow166.8%
exp-neg66.8%
inv-pow66.8%
pow-prod-up96.7%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in l around 0 96.7%
Taylor expanded in w around 0 74.9%
neg-mul-174.9%
sub-neg74.9%
*-rgt-identity74.9%
distribute-lft-out--74.9%
Simplified74.9%
if 0.170000000000000012 < w Initial program 93.3%
exp-neg93.3%
remove-double-neg93.3%
associate-*l/93.3%
*-lft-identity93.3%
remove-double-neg93.3%
Simplified93.3%
add-sqr-sqrt93.3%
sqrt-unprod93.3%
sqr-neg93.3%
sqrt-unprod0.0%
add-sqr-sqrt93.4%
add-sqr-sqrt93.4%
sqrt-unprod93.4%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up93.4%
metadata-eval93.4%
metadata-eval93.4%
metadata-eval93.4%
Applied egg-rr93.4%
Taylor expanded in w around 0 3.2%
mul-1-neg3.2%
unsub-neg3.2%
Simplified3.2%
Taylor expanded in w around inf 3.2%
neg-mul-13.2%
distribute-lft-neg-in3.2%
*-commutative3.2%
Simplified3.2%
neg-mul-13.2%
expm1-log1p-u3.2%
expm1-undefine89.0%
neg-mul-189.0%
Applied egg-rr89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
log1p-undefine89.0%
rem-exp-log89.0%
unsub-neg89.0%
Simplified89.0%
Final simplification77.4%
(FPCore (w l) :precision binary64 (if (<= w -0.102) (* l (- 1.0 w)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.102) {
tmp = l * (1.0 - w);
} else {
tmp = l / (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 <= (-0.102d0)) then
tmp = l * (1.0d0 - w)
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.102) {
tmp = l * (1.0 - w);
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.102: tmp = l * (1.0 - w) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.102) tmp = Float64(l * Float64(1.0 - w)); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.102) tmp = l * (1.0 - w); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.102], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.102:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -0.101999999999999993Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
add-sqr-sqrt47.1%
sqrt-unprod47.1%
sqr-neg47.1%
sqrt-unprod0.0%
add-sqr-sqrt0.2%
pow10.2%
exp-neg0.2%
inv-pow0.2%
pow-prod-up95.7%
metadata-eval95.7%
metadata-eval95.7%
metadata-eval95.7%
Applied egg-rr95.7%
Taylor expanded in l around 0 95.7%
Taylor expanded in w around 0 26.1%
neg-mul-126.1%
sub-neg26.1%
*-rgt-identity26.1%
distribute-lft-out--26.1%
Simplified26.1%
if -0.101999999999999993 < w Initial program 98.2%
exp-neg98.2%
remove-double-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
remove-double-neg98.2%
Simplified98.2%
add-sqr-sqrt59.8%
sqrt-unprod97.4%
sqr-neg97.4%
sqrt-unprod37.6%
add-sqr-sqrt96.2%
add-sqr-sqrt96.2%
sqrt-unprod96.2%
add-sqr-sqrt37.6%
sqrt-unprod74.1%
sqr-neg74.1%
sqrt-unprod36.5%
add-sqr-sqrt74.1%
pow174.1%
exp-neg74.1%
inv-pow74.1%
pow-prod-up96.3%
metadata-eval96.3%
metadata-eval96.3%
metadata-eval96.3%
Applied egg-rr96.3%
Taylor expanded in l around 0 96.3%
Taylor expanded in w around 0 87.2%
+-commutative99.0%
Simplified87.2%
(FPCore (w l) :precision binary64 (if (<= w -250.0) (* (- w) l) l))
double code(double w, double l) {
double tmp;
if (w <= -250.0) {
tmp = -w * l;
} else {
tmp = l;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-250.0d0)) then
tmp = -w * l
else
tmp = l
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -250.0) {
tmp = -w * l;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -250.0: tmp = -w * l else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -250.0) tmp = Float64(Float64(-w) * l); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -250.0) tmp = -w * l; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -250.0], N[((-w) * l), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -250:\\
\;\;\;\;\left(-w\right) \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -250Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod48.5%
sqr-neg48.5%
sqrt-unprod48.5%
add-sqr-sqrt48.5%
add-sqr-sqrt48.5%
sqrt-unprod48.5%
add-sqr-sqrt48.5%
sqrt-unprod48.5%
sqr-neg48.5%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.5%
metadata-eval98.5%
metadata-eval98.5%
metadata-eval98.5%
Applied egg-rr98.5%
Taylor expanded in w around 0 26.8%
mul-1-neg26.8%
unsub-neg26.8%
Simplified26.8%
Taylor expanded in w around inf 26.8%
neg-mul-126.8%
distribute-lft-neg-in26.8%
*-commutative26.8%
Simplified26.8%
if -250 < w Initial program 98.2%
Taylor expanded in w around 0 74.7%
Final simplification62.7%
(FPCore (w l) :precision binary64 (* l (- 1.0 w)))
double code(double w, double l) {
return l * (1.0 - w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l * (1.0d0 - w)
end function
public static double code(double w, double l) {
return l * (1.0 - w);
}
def code(w, l): return l * (1.0 - w)
function code(w, l) return Float64(l * Float64(1.0 - w)) end
function tmp = code(w, l) tmp = l * (1.0 - w); end
code[w_, l_] := N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell \cdot \left(1 - w\right)
\end{array}
Initial program 98.6%
exp-neg98.6%
remove-double-neg98.6%
associate-*l/98.6%
*-lft-identity98.6%
remove-double-neg98.6%
Simplified98.6%
add-sqr-sqrt44.4%
sqrt-unprod84.4%
sqr-neg84.4%
sqrt-unprod40.0%
add-sqr-sqrt83.6%
add-sqr-sqrt83.6%
sqrt-unprod83.6%
add-sqr-sqrt40.0%
sqrt-unprod67.2%
sqr-neg67.2%
sqrt-unprod27.1%
add-sqr-sqrt55.1%
pow155.1%
exp-neg55.1%
inv-pow55.1%
pow-prod-up96.1%
metadata-eval96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Taylor expanded in l around 0 96.1%
Taylor expanded in w around 0 62.3%
neg-mul-162.3%
sub-neg62.3%
*-rgt-identity62.3%
distribute-lft-out--62.3%
Simplified62.3%
(FPCore (w l) :precision binary64 l)
double code(double w, double l) {
return l;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l
end function
public static double code(double w, double l) {
return l;
}
def code(w, l): return l
function code(w, l) return l end
function tmp = code(w, l) tmp = l; end
code[w_, l_] := l
\begin{array}{l}
\\
\ell
\end{array}
Initial program 98.6%
Taylor expanded in w around 0 57.0%
herbie shell --seed 2024163
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))