
(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 -290.0) (/ l (exp w)) (/ (pow l (exp w)) (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -290.0) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-290.0d0)) then
tmp = l / exp(w)
else
tmp = (l ** exp(w)) / (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -290.0) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -290.0: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -290.0) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -290.0) tmp = l / exp(w); else tmp = (l ^ exp(w)) / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -290.0], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -290:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -290Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod46.9%
add-sqr-sqrt46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
if -290 < w Initial program 98.5%
exp-neg98.5%
remove-double-neg98.5%
associate-*l/98.5%
*-lft-identity98.5%
remove-double-neg98.5%
Simplified98.5%
Taylor expanded in w around 0 98.6%
*-commutative98.6%
Simplified98.6%
(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.9%
(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.9%
exp-neg98.9%
remove-double-neg98.9%
associate-*l/98.9%
*-lft-identity98.9%
remove-double-neg98.9%
Simplified98.9%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (/ l (exp w)) (* (pow l (exp w)) (/ 1.0 (+ w 1.0)))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) * (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 = l / exp(w)
else
tmp = (l ** exp(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 = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) * (1.0 / (w + 1.0));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) * (1.0 / (w + 1.0)) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) * Float64(1.0 / Float64(w + 1.0))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = l / exp(w); else tmp = (l ^ exp(w)) * (1.0 / (w + 1.0)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(e^{w}\right)} \cdot \frac{1}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod46.2%
sqr-neg46.2%
sqrt-unprod46.2%
add-sqr-sqrt46.2%
add-sqr-sqrt46.2%
sqrt-unprod46.2%
add-sqr-sqrt46.2%
sqrt-unprod46.2%
sqr-neg46.2%
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 inf 98.5%
exp-neg98.5%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
if -1 < w Initial program 98.5%
exp-neg98.5%
remove-double-neg98.5%
associate-*l/98.5%
*-lft-identity98.5%
remove-double-neg98.5%
Simplified98.5%
Taylor expanded in w around 0 98.8%
+-commutative98.8%
Simplified98.8%
div-inv98.8%
Applied egg-rr98.8%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (/ l (exp w)) (/ (pow l (exp w)) (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) / (w + 1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.0d0)) then
tmp = l / exp(w)
else
tmp = (l ** exp(w)) / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = l / exp(w); else tmp = (l ^ exp(w)) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod46.2%
sqr-neg46.2%
sqrt-unprod46.2%
add-sqr-sqrt46.2%
add-sqr-sqrt46.2%
sqrt-unprod46.2%
add-sqr-sqrt46.2%
sqrt-unprod46.2%
sqr-neg46.2%
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 inf 98.5%
exp-neg98.5%
associate-*r/98.5%
*-rgt-identity98.5%
Simplified98.5%
if -1 < w Initial program 98.5%
exp-neg98.5%
remove-double-neg98.5%
associate-*l/98.5%
*-lft-identity98.5%
remove-double-neg98.5%
Simplified98.5%
Taylor expanded in w around 0 98.8%
+-commutative98.8%
Simplified98.8%
(FPCore (w l) :precision binary64 (* (exp (- w)) l))
double code(double w, double l) {
return exp(-w) * l;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * l
end function
public static double code(double w, double l) {
return Math.exp(-w) * l;
}
def code(w, l): return math.exp(-w) * l
function code(w, l) return Float64(exp(Float64(-w)) * l) end
function tmp = code(w, l) tmp = exp(-w) * l; end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * l), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot \ell
\end{array}
Initial program 98.9%
add-sqr-sqrt42.0%
sqrt-unprod84.2%
sqr-neg84.2%
sqrt-unprod42.1%
add-sqr-sqrt83.5%
add-sqr-sqrt83.5%
sqrt-unprod83.5%
add-sqr-sqrt42.1%
sqrt-unprod60.9%
sqr-neg60.9%
sqrt-unprod18.8%
add-sqr-sqrt49.2%
pow149.2%
exp-neg49.2%
inv-pow49.2%
pow-prod-up96.9%
metadata-eval96.9%
metadata-eval96.9%
metadata-eval96.9%
Applied egg-rr96.9%
Final simplification96.9%
(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.9%
add-sqr-sqrt42.0%
sqrt-unprod84.2%
sqr-neg84.2%
sqrt-unprod42.1%
add-sqr-sqrt83.5%
add-sqr-sqrt83.5%
sqrt-unprod83.5%
add-sqr-sqrt42.1%
sqrt-unprod60.9%
sqr-neg60.9%
sqrt-unprod18.8%
add-sqr-sqrt49.2%
pow149.2%
exp-neg49.2%
inv-pow49.2%
pow-prod-up96.9%
metadata-eval96.9%
metadata-eval96.9%
metadata-eval96.9%
Applied egg-rr96.9%
Taylor expanded in w around inf 96.9%
exp-neg96.9%
associate-*r/96.9%
*-rgt-identity96.9%
Simplified96.9%
(FPCore (w l)
:precision binary64
(let* ((t_0 (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0)))))
(if (<= w 0.078)
(* l t_0)
(if (<= w 2.5e+97)
(* t_0 0.0)
(/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))))
double code(double w, double l) {
double t_0 = 1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0));
double tmp;
if (w <= 0.078) {
tmp = l * t_0;
} else if (w <= 2.5e+97) {
tmp = t_0 * 0.0;
} else {
tmp = l / (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) :: t_0
real(8) :: tmp
t_0 = 1.0d0 + (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0)))
if (w <= 0.078d0) then
tmp = l * t_0
else if (w <= 2.5d+97) then
tmp = t_0 * 0.0d0
else
tmp = l / (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 t_0 = 1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0));
double tmp;
if (w <= 0.078) {
tmp = l * t_0;
} else if (w <= 2.5e+97) {
tmp = t_0 * 0.0;
} else {
tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): t_0 = 1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)) tmp = 0 if w <= 0.078: tmp = l * t_0 elif w <= 2.5e+97: tmp = t_0 * 0.0 else: tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))) return tmp
function code(w, l) t_0 = Float64(1.0 + Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0))) tmp = 0.0 if (w <= 0.078) tmp = Float64(l * t_0); elseif (w <= 2.5e+97) tmp = Float64(t_0 * 0.0); else tmp = Float64(l / 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) t_0 = 1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)); tmp = 0.0; if (w <= 0.078) tmp = l * t_0; elseif (w <= 2.5e+97) tmp = t_0 * 0.0; else tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[(1.0 + N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, 0.078], N[(l * t$95$0), $MachinePrecision], If[LessEqual[w, 2.5e+97], N[(t$95$0 * 0.0), $MachinePrecision], 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]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{if}\;w \leq 0.078:\\
\;\;\;\;\ell \cdot t\_0\\
\mathbf{elif}\;w \leq 2.5 \cdot 10^{+97}:\\
\;\;\;\;t\_0 \cdot 0\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < 0.0779999999999999999Initial program 99.6%
add-sqr-sqrt24.9%
sqrt-unprod80.2%
sqr-neg80.2%
sqrt-unprod55.3%
add-sqr-sqrt79.9%
add-sqr-sqrt79.9%
sqrt-unprod79.9%
add-sqr-sqrt55.3%
sqrt-unprod79.9%
sqr-neg79.9%
sqrt-unprod24.6%
add-sqr-sqrt64.6%
pow164.6%
exp-neg64.6%
inv-pow64.6%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr97.4%
Taylor expanded in w around 0 87.1%
Taylor expanded in l around 0 87.1%
if 0.0779999999999999999 < w < 2.49999999999999999e97Initial program 91.7%
add-sqr-sqrt91.7%
sqrt-unprod91.7%
sqr-neg91.7%
sqrt-unprod0.0%
add-sqr-sqrt87.6%
add-sqr-sqrt87.6%
sqrt-unprod87.6%
add-sqr-sqrt0.0%
sqrt-unprod0.3%
sqr-neg0.3%
sqrt-unprod0.3%
add-sqr-sqrt0.3%
pow10.3%
exp-neg0.3%
inv-pow0.3%
pow-prod-up87.9%
metadata-eval87.9%
metadata-eval87.9%
metadata-eval87.9%
Applied egg-rr87.9%
Taylor expanded in w around 0 3.2%
*-rgt-identity3.2%
expm1-log1p-u3.2%
expm1-undefine79.6%
log1p-undefine79.6%
rem-exp-log79.6%
+-commutative79.6%
Applied egg-rr79.6%
Taylor expanded in l around 0 95.9%
if 2.49999999999999999e97 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
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-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 100.0%
*-commutative100.0%
Simplified100.0%
Final simplification89.8%
(FPCore (w l)
:precision binary64
(if (<= w 2e-13)
(* l (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0))))
(if (<= w 2.8e+84)
(* (+ (+ l 1.0) -1.0) (+ 1.0 (* w (+ (* w 0.5) -1.0))))
(/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666))))))))))
double code(double w, double l) {
double tmp;
if (w <= 2e-13) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else if (w <= 2.8e+84) {
tmp = ((l + 1.0) + -1.0) * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (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 <= 2d-13) then
tmp = l * (1.0d0 + (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
else if (w <= 2.8d+84) then
tmp = ((l + 1.0d0) + (-1.0d0)) * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l / (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 <= 2e-13) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else if (w <= 2.8e+84) {
tmp = ((l + 1.0) + -1.0) * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 2e-13: tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))) elif w <= 2.8e+84: tmp = ((l + 1.0) + -1.0) * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))) return tmp
function code(w, l) tmp = 0.0 if (w <= 2e-13) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0)))); elseif (w <= 2.8e+84) tmp = Float64(Float64(Float64(l + 1.0) + -1.0) * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l / 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 <= 2e-13) tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))); elseif (w <= 2.8e+84) tmp = ((l + 1.0) + -1.0) * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 2e-13], N[(l * N[(1.0 + N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.8e+84], N[(N[(N[(l + 1.0), $MachinePrecision] + -1.0), $MachinePrecision] * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 2 \cdot 10^{-13}:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{elif}\;w \leq 2.8 \cdot 10^{+84}:\\
\;\;\;\;\left(\left(\ell + 1\right) + -1\right) \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < 2.0000000000000001e-13Initial program 99.7%
add-sqr-sqrt24.3%
sqrt-unprod80.2%
sqr-neg80.2%
sqrt-unprod55.9%
add-sqr-sqrt80.1%
add-sqr-sqrt80.1%
sqrt-unprod80.1%
add-sqr-sqrt55.9%
sqrt-unprod80.1%
sqr-neg80.1%
sqrt-unprod24.2%
add-sqr-sqrt64.6%
pow164.6%
exp-neg64.6%
inv-pow64.6%
pow-prod-up97.8%
metadata-eval97.8%
metadata-eval97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in w around 0 87.4%
Taylor expanded in l around 0 87.4%
if 2.0000000000000001e-13 < w < 2.79999999999999982e84Initial program 90.1%
add-sqr-sqrt90.1%
sqrt-unprod90.1%
sqr-neg90.1%
sqrt-unprod0.0%
add-sqr-sqrt83.8%
add-sqr-sqrt83.8%
sqrt-unprod83.8%
add-sqr-sqrt0.0%
sqrt-unprod5.9%
sqr-neg5.9%
sqrt-unprod5.9%
add-sqr-sqrt5.9%
pow15.9%
exp-neg5.9%
inv-pow5.9%
pow-prod-up84.2%
metadata-eval84.2%
metadata-eval84.2%
metadata-eval84.2%
Applied egg-rr84.2%
Taylor expanded in w around 0 8.6%
*-rgt-identity8.6%
expm1-log1p-u8.6%
expm1-undefine79.8%
log1p-undefine79.8%
rem-exp-log79.8%
+-commutative79.8%
Applied egg-rr79.8%
Taylor expanded in w around 0 80.1%
*-commutative80.1%
Simplified80.1%
if 2.79999999999999982e84 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
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-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 97.7%
*-commutative97.7%
Simplified97.7%
Final simplification88.3%
(FPCore (w l)
:precision binary64
(if (<= w 2e-13)
(* l (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0))))
(if (<= w 2.5e+125)
(* (+ (+ l 1.0) -1.0) (+ 1.0 (* w (+ (* w 0.5) -1.0))))
(/ l (+ 1.0 (* w (+ 1.0 (* w 0.5))))))))
double code(double w, double l) {
double tmp;
if (w <= 2e-13) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else if (w <= 2.5e+125) {
tmp = ((l + 1.0) + -1.0) * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (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 <= 2d-13) then
tmp = l * (1.0d0 + (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
else if (w <= 2.5d+125) then
tmp = ((l + 1.0d0) + (-1.0d0)) * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l / (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 <= 2e-13) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else if (w <= 2.5e+125) {
tmp = ((l + 1.0) + -1.0) * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 2e-13: tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))) elif w <= 2.5e+125: tmp = ((l + 1.0) + -1.0) * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 2e-13) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0)))); elseif (w <= 2.5e+125) tmp = Float64(Float64(Float64(l + 1.0) + -1.0) * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l / 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 <= 2e-13) tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))); elseif (w <= 2.5e+125) tmp = ((l + 1.0) + -1.0) * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 2e-13], N[(l * N[(1.0 + N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 2.5e+125], N[(N[(N[(l + 1.0), $MachinePrecision] + -1.0), $MachinePrecision] * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / 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 2 \cdot 10^{-13}:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{elif}\;w \leq 2.5 \cdot 10^{+125}:\\
\;\;\;\;\left(\left(\ell + 1\right) + -1\right) \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 2.0000000000000001e-13Initial program 99.7%
add-sqr-sqrt24.3%
sqrt-unprod80.2%
sqr-neg80.2%
sqrt-unprod55.9%
add-sqr-sqrt80.1%
add-sqr-sqrt80.1%
sqrt-unprod80.1%
add-sqr-sqrt55.9%
sqrt-unprod80.1%
sqr-neg80.1%
sqrt-unprod24.2%
add-sqr-sqrt64.6%
pow164.6%
exp-neg64.6%
inv-pow64.6%
pow-prod-up97.8%
metadata-eval97.8%
metadata-eval97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in w around 0 87.4%
Taylor expanded in l around 0 87.4%
if 2.0000000000000001e-13 < w < 2.49999999999999981e125Initial program 92.9%
add-sqr-sqrt92.9%
sqrt-unprod92.9%
sqr-neg92.9%
sqrt-unprod0.0%
add-sqr-sqrt88.3%
add-sqr-sqrt88.3%
sqrt-unprod88.3%
add-sqr-sqrt0.0%
sqrt-unprod4.2%
sqr-neg4.2%
sqrt-unprod4.2%
add-sqr-sqrt4.2%
pow14.2%
exp-neg4.2%
inv-pow4.2%
pow-prod-up88.7%
metadata-eval88.7%
metadata-eval88.7%
metadata-eval88.7%
Applied egg-rr88.7%
Taylor expanded in w around 0 6.7%
*-rgt-identity6.7%
expm1-log1p-u6.7%
expm1-undefine69.9%
log1p-undefine69.9%
rem-exp-log69.9%
+-commutative69.9%
Applied egg-rr69.9%
Taylor expanded in w around 0 82.7%
*-commutative82.7%
Simplified82.7%
if 2.49999999999999981e125 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
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-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 97.1%
*-commutative100.0%
Simplified97.1%
Final simplification88.0%
(FPCore (w l) :precision binary64 (if (<= w -38.0) (* l (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0)))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -38.0) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = l / (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 <= (-38.0d0)) then
tmp = l * (1.0d0 + (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = l / (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 <= -38.0) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -38.0: tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -38.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0)))); else tmp = Float64(l / 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 <= -38.0) tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -38.0], N[(l * N[(1.0 + N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / 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 -38:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -38Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod46.9%
add-sqr-sqrt46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 68.7%
Taylor expanded in l around 0 68.7%
if -38 < w Initial program 98.5%
add-sqr-sqrt56.0%
sqrt-unprod96.6%
sqr-neg96.6%
sqrt-unprod40.5%
add-sqr-sqrt95.7%
add-sqr-sqrt95.7%
sqrt-unprod95.7%
add-sqr-sqrt40.5%
sqrt-unprod65.6%
sqr-neg65.6%
sqrt-unprod25.1%
add-sqr-sqrt65.6%
pow165.6%
exp-neg65.6%
inv-pow65.6%
pow-prod-up95.9%
metadata-eval95.9%
metadata-eval95.9%
metadata-eval95.9%
Applied egg-rr95.9%
Taylor expanded in w around inf 95.9%
exp-neg95.9%
associate-*r/95.9%
*-rgt-identity95.9%
Simplified95.9%
Taylor expanded in w around 0 87.3%
*-commutative98.6%
Simplified87.3%
Final simplification82.7%
(FPCore (w l) :precision binary64 (if (<= w -130.0) (+ l (* w (- (* w (- l (* w l))) l))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -130.0) {
tmp = l + (w * ((w * (l - (w * l))) - l));
} else {
tmp = l / (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 <= (-130.0d0)) then
tmp = l + (w * ((w * (l - (w * l))) - l))
else
tmp = l / (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 <= -130.0) {
tmp = l + (w * ((w * (l - (w * l))) - l));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -130.0: tmp = l + (w * ((w * (l - (w * l))) - l)) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -130.0) tmp = Float64(l + Float64(w * Float64(Float64(w * Float64(l - Float64(w * l))) - l))); else tmp = Float64(l / 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 <= -130.0) tmp = l + (w * ((w * (l - (w * l))) - l)); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -130.0], N[(l + N[(w * N[(N[(w * N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / 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 -130:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \left(\ell - w \cdot \ell\right) - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -130Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod46.9%
add-sqr-sqrt46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
add-sqr-sqrt46.9%
sqrt-unprod46.9%
sqr-neg46.9%
sqrt-unprod0.0%
add-sqr-sqrt0.0%
pow10.0%
exp-neg0.0%
inv-pow0.0%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 1.0%
+-commutative1.0%
Simplified1.0%
Taylor expanded in w around 0 59.9%
cancel-sign-sub-inv59.9%
metadata-eval59.9%
*-lft-identity59.9%
+-commutative59.9%
associate-*r*59.9%
mul-1-neg59.9%
Simplified59.9%
if -130 < w Initial program 98.5%
add-sqr-sqrt56.0%
sqrt-unprod96.6%
sqr-neg96.6%
sqrt-unprod40.5%
add-sqr-sqrt95.7%
add-sqr-sqrt95.7%
sqrt-unprod95.7%
add-sqr-sqrt40.5%
sqrt-unprod65.6%
sqr-neg65.6%
sqrt-unprod25.1%
add-sqr-sqrt65.6%
pow165.6%
exp-neg65.6%
inv-pow65.6%
pow-prod-up95.9%
metadata-eval95.9%
metadata-eval95.9%
metadata-eval95.9%
Applied egg-rr95.9%
Taylor expanded in w around inf 95.9%
exp-neg95.9%
associate-*r/95.9%
*-rgt-identity95.9%
Simplified95.9%
Taylor expanded in w around 0 87.3%
*-commutative98.6%
Simplified87.3%
Final simplification80.5%
(FPCore (w l) :precision binary64 (if (<= w 3000000.0) (* l (+ 1.0 (* w (+ (* w 0.5) -1.0)))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 3000000.0) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (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 <= 3000000.0d0) then
tmp = l * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l / (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 <= 3000000.0) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 3000000.0: tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 3000000.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l / 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 <= 3000000.0) tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 3000000.0], N[(l * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / 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 3000000:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 3e6Initial program 98.6%
add-sqr-sqrt25.4%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod54.2%
add-sqr-sqrt78.8%
add-sqr-sqrt78.8%
sqrt-unprod78.8%
add-sqr-sqrt54.2%
sqrt-unprod78.4%
sqr-neg78.4%
sqrt-unprod24.2%
add-sqr-sqrt63.3%
pow163.3%
exp-neg63.3%
inv-pow63.3%
pow-prod-up96.0%
metadata-eval96.0%
metadata-eval96.0%
metadata-eval96.0%
Applied egg-rr96.0%
Taylor expanded in w around 0 81.1%
if 3e6 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
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-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 72.9%
*-commutative100.0%
Simplified72.9%
Final simplification79.3%
(FPCore (w l) :precision binary64 (if (<= w 2200000.0) (+ l (* w (- (* w l) l))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 2200000.0) {
tmp = l + (w * ((w * l) - l));
} else {
tmp = l / (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 <= 2200000.0d0) then
tmp = l + (w * ((w * l) - l))
else
tmp = l / (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 <= 2200000.0) {
tmp = l + (w * ((w * l) - l));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 2200000.0: tmp = l + (w * ((w * l) - l)) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 2200000.0) tmp = Float64(l + Float64(w * Float64(Float64(w * l) - l))); else tmp = Float64(l / 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 <= 2200000.0) tmp = l + (w * ((w * l) - l)); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 2200000.0], N[(l + N[(w * N[(N[(w * l), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / 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 2200000:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \ell - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 2.2e6Initial program 98.6%
add-sqr-sqrt25.4%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod54.2%
add-sqr-sqrt78.8%
add-sqr-sqrt78.8%
sqrt-unprod78.8%
add-sqr-sqrt54.2%
sqrt-unprod78.4%
sqr-neg78.4%
sqrt-unprod24.2%
add-sqr-sqrt63.3%
pow163.3%
exp-neg63.3%
inv-pow63.3%
pow-prod-up96.0%
metadata-eval96.0%
metadata-eval96.0%
metadata-eval96.0%
Applied egg-rr96.0%
Taylor expanded in w around inf 96.0%
exp-neg96.0%
associate-*r/96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in w around 0 63.7%
+-commutative66.6%
Simplified63.7%
Taylor expanded in w around 0 77.3%
if 2.2e6 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
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-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 72.9%
*-commutative100.0%
Simplified72.9%
Final simplification76.4%
(FPCore (w l) :precision binary64 (if (<= w 70000.0) (+ l (* w (- (* w l) l))) (/ 1.0 (/ (+ w 1.0) l))))
double code(double w, double l) {
double tmp;
if (w <= 70000.0) {
tmp = l + (w * ((w * l) - l));
} else {
tmp = 1.0 / ((w + 1.0) / l);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 70000.0d0) then
tmp = l + (w * ((w * l) - l))
else
tmp = 1.0d0 / ((w + 1.0d0) / l)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 70000.0) {
tmp = l + (w * ((w * l) - l));
} else {
tmp = 1.0 / ((w + 1.0) / l);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 70000.0: tmp = l + (w * ((w * l) - l)) else: tmp = 1.0 / ((w + 1.0) / l) return tmp
function code(w, l) tmp = 0.0 if (w <= 70000.0) tmp = Float64(l + Float64(w * Float64(Float64(w * l) - l))); else tmp = Float64(1.0 / Float64(Float64(w + 1.0) / l)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 70000.0) tmp = l + (w * ((w * l) - l)); else tmp = 1.0 / ((w + 1.0) / l); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 70000.0], N[(l + N[(w * N[(N[(w * l), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(w + 1.0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 70000:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \ell - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{w + 1}{\ell}}\\
\end{array}
\end{array}
if w < 7e4Initial program 98.6%
add-sqr-sqrt25.4%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod54.2%
add-sqr-sqrt78.8%
add-sqr-sqrt78.8%
sqrt-unprod78.8%
add-sqr-sqrt54.2%
sqrt-unprod78.4%
sqr-neg78.4%
sqrt-unprod24.2%
add-sqr-sqrt63.3%
pow163.3%
exp-neg63.3%
inv-pow63.3%
pow-prod-up96.0%
metadata-eval96.0%
metadata-eval96.0%
metadata-eval96.0%
Applied egg-rr96.0%
Taylor expanded in w around inf 96.0%
exp-neg96.0%
associate-*r/96.0%
*-rgt-identity96.0%
Simplified96.0%
Taylor expanded in w around 0 63.7%
+-commutative66.6%
Simplified63.7%
Taylor expanded in w around 0 77.3%
if 7e4 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
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-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 47.5%
+-commutative100.0%
Simplified47.5%
clear-num50.7%
inv-pow50.7%
Applied egg-rr50.7%
unpow-150.7%
+-commutative50.7%
Simplified50.7%
Final simplification71.4%
(FPCore (w l) :precision binary64 (if (<= w 0.000235) (- l (* w l)) (/ 1.0 (/ (+ w 1.0) l))))
double code(double w, double l) {
double tmp;
if (w <= 0.000235) {
tmp = l - (w * l);
} else {
tmp = 1.0 / ((w + 1.0) / l);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.000235d0) then
tmp = l - (w * l)
else
tmp = 1.0d0 / ((w + 1.0d0) / l)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.000235) {
tmp = l - (w * l);
} else {
tmp = 1.0 / ((w + 1.0) / l);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.000235: tmp = l - (w * l) else: tmp = 1.0 / ((w + 1.0) / l) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.000235) tmp = Float64(l - Float64(w * l)); else tmp = Float64(1.0 / Float64(Float64(w + 1.0) / l)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.000235) tmp = l - (w * l); else tmp = 1.0 / ((w + 1.0) / l); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.000235], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(N[(w + 1.0), $MachinePrecision] / l), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.000235:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{w + 1}{\ell}}\\
\end{array}
\end{array}
if w < 2.34999999999999993e-4Initial program 99.6%
add-sqr-sqrt24.9%
sqrt-unprod80.2%
sqr-neg80.2%
sqrt-unprod55.3%
add-sqr-sqrt79.9%
add-sqr-sqrt79.9%
sqrt-unprod79.9%
add-sqr-sqrt55.3%
sqrt-unprod79.9%
sqr-neg79.9%
sqrt-unprod24.6%
add-sqr-sqrt64.6%
pow164.6%
exp-neg64.6%
inv-pow64.6%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr97.4%
Taylor expanded in w around inf 97.4%
exp-neg97.4%
associate-*r/97.4%
*-rgt-identity97.4%
Simplified97.4%
Taylor expanded in w around 0 64.9%
+-commutative66.4%
Simplified64.9%
Taylor expanded in w around 0 73.7%
mul-1-neg73.7%
unsub-neg73.7%
Simplified73.7%
if 2.34999999999999993e-4 < w Initial program 96.7%
add-sqr-sqrt96.7%
sqrt-unprod96.7%
sqr-neg96.7%
sqrt-unprod0.0%
add-sqr-sqrt95.1%
add-sqr-sqrt95.1%
sqrt-unprod95.1%
add-sqr-sqrt0.0%
sqrt-unprod0.1%
sqr-neg0.1%
sqrt-unprod0.1%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up95.2%
metadata-eval95.2%
metadata-eval95.2%
metadata-eval95.2%
Applied egg-rr95.2%
Taylor expanded in w around inf 95.2%
exp-neg95.2%
associate-*r/95.2%
*-rgt-identity95.2%
Simplified95.2%
Taylor expanded in w around 0 44.7%
+-commutative98.4%
Simplified44.7%
clear-num47.7%
inv-pow47.7%
Applied egg-rr47.7%
unpow-147.7%
+-commutative47.7%
Simplified47.7%
Final simplification67.5%
(FPCore (w l) :precision binary64 (if (<= w 1e-11) (- l (* w l)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 1e-11) {
tmp = l - (w * l);
} 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 <= 1d-11) then
tmp = l - (w * l)
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 1e-11) {
tmp = l - (w * l);
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 1e-11: tmp = l - (w * l) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 1e-11) tmp = Float64(l - Float64(w * l)); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 1e-11) tmp = l - (w * l); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 1e-11], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 10^{-11}:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 9.99999999999999939e-12Initial program 99.6%
add-sqr-sqrt24.6%
sqrt-unprod80.2%
sqr-neg80.2%
sqrt-unprod55.6%
add-sqr-sqrt80.0%
add-sqr-sqrt80.0%
sqrt-unprod80.0%
add-sqr-sqrt55.6%
sqrt-unprod80.0%
sqr-neg80.0%
sqrt-unprod24.4%
add-sqr-sqrt64.6%
pow164.6%
exp-neg64.6%
inv-pow64.6%
pow-prod-up97.6%
metadata-eval97.6%
metadata-eval97.6%
metadata-eval97.6%
Applied egg-rr97.6%
Taylor expanded in w around inf 97.6%
exp-neg97.6%
associate-*r/97.6%
*-rgt-identity97.6%
Simplified97.6%
Taylor expanded in w around 0 64.9%
+-commutative66.3%
Simplified64.9%
Taylor expanded in w around 0 73.8%
mul-1-neg73.8%
unsub-neg73.8%
Simplified73.8%
if 9.99999999999999939e-12 < w Initial program 96.6%
add-sqr-sqrt96.6%
sqrt-unprod96.6%
sqr-neg96.6%
sqrt-unprod0.0%
add-sqr-sqrt94.5%
add-sqr-sqrt94.5%
sqrt-unprod94.5%
add-sqr-sqrt0.0%
sqrt-unprod1.1%
sqr-neg1.1%
sqrt-unprod1.1%
add-sqr-sqrt1.1%
pow11.1%
exp-neg1.1%
inv-pow1.1%
pow-prod-up94.7%
metadata-eval94.7%
metadata-eval94.7%
metadata-eval94.7%
Applied egg-rr94.7%
Taylor expanded in w around inf 94.7%
exp-neg94.7%
associate-*r/94.7%
*-rgt-identity94.7%
Simplified94.7%
Taylor expanded in w around 0 44.9%
+-commutative98.2%
Simplified44.9%
Final simplification66.8%
(FPCore (w l) :precision binary64 (if (<= w 1.0) (- l (* w l)) (/ l w)))
double code(double w, double l) {
double tmp;
if (w <= 1.0) {
tmp = l - (w * l);
} else {
tmp = l / w;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 1.0d0) then
tmp = l - (w * l)
else
tmp = l / w
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 1.0) {
tmp = l - (w * l);
} else {
tmp = l / w;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 1.0: tmp = l - (w * l) else: tmp = l / w return tmp
function code(w, l) tmp = 0.0 if (w <= 1.0) tmp = Float64(l - Float64(w * l)); else tmp = Float64(l / w); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 1.0) tmp = l - (w * l); else tmp = l / w; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 1.0], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], N[(l / w), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 1:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w}\\
\end{array}
\end{array}
if w < 1Initial program 99.6%
add-sqr-sqrt24.9%
sqrt-unprod80.2%
sqr-neg80.2%
sqrt-unprod55.3%
add-sqr-sqrt79.9%
add-sqr-sqrt79.9%
sqrt-unprod79.9%
add-sqr-sqrt55.3%
sqrt-unprod79.9%
sqr-neg79.9%
sqrt-unprod24.6%
add-sqr-sqrt64.6%
pow164.6%
exp-neg64.6%
inv-pow64.6%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr97.4%
Taylor expanded in w around inf 97.4%
exp-neg97.4%
associate-*r/97.4%
*-rgt-identity97.4%
Simplified97.4%
Taylor expanded in w around 0 64.9%
+-commutative66.4%
Simplified64.9%
Taylor expanded in w around 0 73.7%
mul-1-neg73.7%
unsub-neg73.7%
Simplified73.7%
if 1 < w Initial program 96.7%
add-sqr-sqrt96.7%
sqrt-unprod96.7%
sqr-neg96.7%
sqrt-unprod0.0%
add-sqr-sqrt95.1%
add-sqr-sqrt95.1%
sqrt-unprod95.1%
add-sqr-sqrt0.0%
sqrt-unprod0.1%
sqr-neg0.1%
sqrt-unprod0.1%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up95.2%
metadata-eval95.2%
metadata-eval95.2%
metadata-eval95.2%
Applied egg-rr95.2%
Taylor expanded in w around inf 95.2%
exp-neg95.2%
associate-*r/95.2%
*-rgt-identity95.2%
Simplified95.2%
Taylor expanded in w around 0 44.7%
+-commutative98.4%
Simplified44.7%
Taylor expanded in w around inf 44.7%
Final simplification66.8%
(FPCore (w l) :precision binary64 (if (<= w 7800.0) l (/ l w)))
double code(double w, double l) {
double tmp;
if (w <= 7800.0) {
tmp = l;
} else {
tmp = l / w;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 7800.0d0) then
tmp = l
else
tmp = l / w
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 7800.0) {
tmp = l;
} else {
tmp = l / w;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 7800.0: tmp = l else: tmp = l / w return tmp
function code(w, l) tmp = 0.0 if (w <= 7800.0) tmp = l; else tmp = Float64(l / w); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 7800.0) tmp = l; else tmp = l / w; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 7800.0], l, N[(l / w), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 7800:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w}\\
\end{array}
\end{array}
if w < 7800Initial program 98.6%
Taylor expanded in w around 0 64.6%
if 7800 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
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-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around inf 100.0%
exp-neg100.0%
associate-*r/100.0%
*-rgt-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 47.5%
+-commutative100.0%
Simplified47.5%
Taylor expanded in w around inf 47.5%
(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.9%
Taylor expanded in w around 0 51.4%
herbie shell --seed 2024181
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))