
(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 19 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)
(/ l (exp w))
(/
(pow l (exp w))
(+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -1.6) {
tmp = l / exp(w);
} else {
tmp = pow(l, exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.6d0)) then
tmp = l / exp(w)
else
tmp = (l ** exp(w)) / (1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.6) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.6: tmp = l / math.exp(w) else: tmp = math.pow(l, math.exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.6) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ exp(w)) / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.6) tmp = l / exp(w); else tmp = (l ^ exp(w)) / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.6], N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(1.0 + N[(w * N[(1.0 + N[(w * N[(0.5 + N[(w * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.6:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < -1.6000000000000001Initial program 100.0%
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-unprod45.3%
sqr-neg45.3%
sqrt-unprod45.3%
add-sqr-sqrt45.3%
add-sqr-sqrt45.3%
sqrt-unprod45.3%
add-sqr-sqrt45.3%
sqrt-unprod45.3%
sqr-neg45.3%
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 l around 0 100.0%
if -1.6000000000000001 < w Initial program 99.1%
exp-neg99.1%
remove-double-neg99.1%
associate-*l/99.1%
*-lft-identity99.1%
remove-double-neg99.1%
Simplified99.1%
Taylor expanded in w around 0 99.6%
*-commutative99.6%
Simplified99.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 99.3%
(FPCore (w l) :precision binary64 (/ (pow l (exp w)) (exp w)))
double code(double w, double l) {
return pow(l, exp(w)) / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = (l ** exp(w)) / exp(w)
end function
public static double code(double w, double l) {
return Math.pow(l, Math.exp(w)) / Math.exp(w);
}
def code(w, l): return math.pow(l, math.exp(w)) / math.exp(w)
function code(w, l) return Float64((l ^ exp(w)) / exp(w)) end
function tmp = code(w, l) tmp = (l ^ exp(w)) / exp(w); end
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}
\end{array}
Initial program 99.3%
exp-neg99.3%
remove-double-neg99.3%
associate-*l/99.3%
*-lft-identity99.3%
remove-double-neg99.3%
Simplified99.3%
(FPCore (w l) :precision binary64 (if (<= w -320.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 <= -320.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 <= (-320.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 <= -320.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 <= -320.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 <= -320.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 <= -320.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, -320.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 -320:\\
\;\;\;\;\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 < -320Initial 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-unprod45.3%
sqr-neg45.3%
sqrt-unprod45.3%
add-sqr-sqrt45.3%
add-sqr-sqrt45.3%
sqrt-unprod45.3%
add-sqr-sqrt45.3%
sqrt-unprod45.3%
sqr-neg45.3%
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 l around 0 100.0%
if -320 < w Initial program 99.1%
exp-neg99.1%
remove-double-neg99.1%
associate-*l/99.1%
*-lft-identity99.1%
remove-double-neg99.1%
Simplified99.1%
Taylor expanded in w around 0 99.4%
*-commutative99.4%
Simplified99.4%
(FPCore (w l)
:precision binary64
(if (<= w -2.4)
(/ l (exp w))
(/
(pow l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))
(+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -2.4) {
tmp = l / exp(w);
} else {
tmp = pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (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 <= (-2.4d0)) then
tmp = l / exp(w)
else
tmp = (l ** (1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0))))))) / (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 <= -2.4) {
tmp = l / Math.exp(w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -2.4: tmp = l / math.exp(w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -2.4) tmp = Float64(l / exp(w)); else tmp = Float64((l ^ Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666))))))) / 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 <= -2.4) tmp = l / exp(w); else tmp = (l ^ (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -2.4], N[(l / N[Exp[w], $MachinePrecision]), $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[(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.4:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)}}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -2.39999999999999991Initial 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-unprod45.3%
sqr-neg45.3%
sqrt-unprod45.3%
add-sqr-sqrt45.3%
add-sqr-sqrt45.3%
sqrt-unprod45.3%
add-sqr-sqrt45.3%
sqrt-unprod45.3%
sqr-neg45.3%
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 l around 0 100.0%
if -2.39999999999999991 < w Initial program 99.1%
exp-neg99.1%
remove-double-neg99.1%
associate-*l/99.1%
*-lft-identity99.1%
remove-double-neg99.1%
Simplified99.1%
Taylor expanded in w around 0 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in w around 0 99.4%
*-commutative99.6%
Simplified99.4%
(FPCore (w l) :precision binary64 (let* ((t_0 (+ 1.0 (* w (+ 1.0 (* w 0.5)))))) (if (<= w -9500000.0) (/ l (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)));
double tmp;
if (w <= -9500000.0) {
tmp = l / 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)))
if (w <= (-9500000.0d0)) then
tmp = l / 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)));
double tmp;
if (w <= -9500000.0) {
tmp = l / 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))) tmp = 0 if w <= -9500000.0: tmp = l / 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 * 0.5)))) tmp = 0.0 if (w <= -9500000.0) tmp = Float64(l / exp(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))); tmp = 0.0; if (w <= -9500000.0) tmp = l / 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 * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -9500000.0], N[(l / N[Exp[w], $MachinePrecision]), $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 0.5\right)\\
\mathbf{if}\;w \leq -9500000:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\
\end{array}
\end{array}
if w < -9.5e6Initial 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-unprod44.4%
sqr-neg44.4%
sqrt-unprod44.4%
add-sqr-sqrt44.4%
add-sqr-sqrt44.4%
sqrt-unprod44.4%
add-sqr-sqrt44.4%
sqrt-unprod44.4%
sqr-neg44.4%
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 l around 0 100.0%
if -9.5e6 < w Initial program 99.1%
exp-neg99.1%
remove-double-neg99.1%
associate-*l/99.1%
*-lft-identity99.1%
remove-double-neg99.1%
Simplified99.1%
Taylor expanded in w around 0 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in w around 0 99.2%
*-commutative98.9%
Simplified99.2%
(FPCore (w l)
:precision binary64
(if (<= l 4.2e-9)
(* (* l (pow l w)) (- 1.0 w))
(*
(pow l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))
(+ 1.0 (* w (+ (* w 0.5) -1.0))))))
double code(double w, double l) {
double tmp;
if (l <= 4.2e-9) {
tmp = (l * pow(l, w)) * (1.0 - w);
} else {
tmp = pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) * (1.0 + (w * ((w * 0.5) + -1.0)));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (l <= 4.2d-9) then
tmp = (l * (l ** w)) * (1.0d0 - w)
else
tmp = (l ** (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))) * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (l <= 4.2e-9) {
tmp = (l * Math.pow(l, w)) * (1.0 - w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) * (1.0 + (w * ((w * 0.5) + -1.0)));
}
return tmp;
}
def code(w, l): tmp = 0 if l <= 4.2e-9: tmp = (l * math.pow(l, w)) * (1.0 - w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) * (1.0 + (w * ((w * 0.5) + -1.0))) return tmp
function code(w, l) tmp = 0.0 if (l <= 4.2e-9) tmp = Float64(Float64(l * (l ^ w)) * Float64(1.0 - w)); else tmp = Float64((l ^ Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))) * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (l <= 4.2e-9) tmp = (l * (l ^ w)) * (1.0 - w); else tmp = (l ^ (1.0 + (w * (1.0 + (w * 0.5))))) * (1.0 + (w * ((w * 0.5) + -1.0))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[l, 4.2e-9], N[(N[(l * N[Power[l, w], $MachinePrecision]), $MachinePrecision] * N[(1.0 - w), $MachinePrecision]), $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[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 4.2 \cdot 10^{-9}:\\
\;\;\;\;\left(\ell \cdot {\ell}^{w}\right) \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)} \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\end{array}
\end{array}
if l < 4.20000000000000039e-9Initial program 99.8%
Taylor expanded in w around 0 75.5%
Taylor expanded in w around 0 87.3%
+-commutative87.3%
Simplified87.3%
Taylor expanded in w around 0 99.4%
neg-mul-199.4%
Simplified99.4%
pow-plus99.4%
Applied egg-rr99.4%
if 4.20000000000000039e-9 < l Initial program 98.8%
Taylor expanded in w around 0 87.9%
Taylor expanded in w around 0 99.3%
*-commutative74.7%
Simplified99.3%
Final simplification99.4%
(FPCore (w l) :precision binary64 (/ l (exp w)))
double code(double w, double l) {
return l / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l / exp(w)
end function
public static double code(double w, double l) {
return l / Math.exp(w);
}
def code(w, l): return l / math.exp(w)
function code(w, l) return Float64(l / exp(w)) end
function tmp = code(w, l) tmp = l / exp(w); end
code[w_, l_] := N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{e^{w}}
\end{array}
Initial program 99.3%
exp-neg99.3%
remove-double-neg99.3%
associate-*l/99.3%
*-lft-identity99.3%
remove-double-neg99.3%
Simplified99.3%
add-sqr-sqrt45.1%
sqrt-unprod85.3%
sqr-neg85.3%
sqrt-unprod40.2%
add-sqr-sqrt84.1%
add-sqr-sqrt84.1%
sqrt-unprod84.1%
add-sqr-sqrt40.2%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-unprod29.4%
add-sqr-sqrt58.3%
pow158.3%
exp-neg58.3%
inv-pow58.3%
pow-prod-up97.8%
metadata-eval97.8%
metadata-eval97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in l around 0 97.8%
(FPCore (w l)
:precision binary64
(if (<= w 0.125)
(-
l
(*
w
(+
l
(*
w
(+
(- (* l 0.5) l)
(* w (+ (- l (* l 0.5)) (+ (* l -0.5) (* l 0.16666666666666666)))))))))
0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.125) {
tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666))))))));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.125d0) then
tmp = l - (w * (l + (w * (((l * 0.5d0) - l) + (w * ((l - (l * 0.5d0)) + ((l * (-0.5d0)) + (l * 0.16666666666666666d0))))))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.125) {
tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666))))))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.125: tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666)))))))) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.125) tmp = Float64(l - Float64(w * Float64(l + Float64(w * Float64(Float64(Float64(l * 0.5) - l) + Float64(w * Float64(Float64(l - Float64(l * 0.5)) + Float64(Float64(l * -0.5) + Float64(l * 0.16666666666666666))))))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.125) tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666)))))))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.125], N[(l - N[(w * N[(l + N[(w * N[(N[(N[(l * 0.5), $MachinePrecision] - l), $MachinePrecision] + N[(w * N[(N[(l - N[(l * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(l * -0.5), $MachinePrecision] + N[(l * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.125:\\
\;\;\;\;\ell - w \cdot \left(\ell + w \cdot \left(\left(\ell \cdot 0.5 - \ell\right) + w \cdot \left(\left(\ell - \ell \cdot 0.5\right) + \left(\ell \cdot -0.5 + \ell \cdot 0.16666666666666666\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.125Initial 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-sqrt35.7%
sqrt-unprod83.2%
sqr-neg83.2%
sqrt-unprod47.5%
add-sqr-sqrt82.1%
add-sqr-sqrt82.1%
sqrt-unprod82.1%
add-sqr-sqrt47.5%
sqrt-unprod82.2%
sqr-neg82.2%
sqrt-unprod34.7%
add-sqr-sqrt68.8%
pow168.8%
exp-neg68.8%
inv-pow68.8%
pow-prod-up98.3%
metadata-eval98.3%
metadata-eval98.3%
metadata-eval98.3%
Applied egg-rr98.3%
Taylor expanded in w around 0 87.7%
if 0.125 < w Initial program 97.4%
add-sqr-sqrt97.4%
sqrt-unprod97.4%
add-sqr-sqrt0.0%
sqrt-unprod2.6%
sqr-neg2.6%
sqrt-unprod2.6%
add-sqr-sqrt2.6%
pow12.6%
exp-neg2.6%
inv-pow2.6%
pow-prod-up100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
*-un-lft-identity100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt3.1%
Applied egg-rr95.0%
Taylor expanded in l around 0 97.5%
Final simplification89.2%
(FPCore (w l)
:precision binary64
(if (<= w -0.002)
(-
l
(*
w
(+
l
(*
w
(+
(- (* l 0.5) l)
(* w (+ (- l (* l 0.5)) (+ (* l -0.5) (* l 0.16666666666666666)))))))))
(/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -0.002) {
tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666))))))));
} 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 <= (-0.002d0)) then
tmp = l - (w * (l + (w * (((l * 0.5d0) - l) + (w * ((l - (l * 0.5d0)) + ((l * (-0.5d0)) + (l * 0.16666666666666666d0))))))))
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 <= -0.002) {
tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666))))))));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.002: tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666)))))))) 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 <= -0.002) tmp = Float64(l - Float64(w * Float64(l + Float64(w * Float64(Float64(Float64(l * 0.5) - l) + Float64(w * Float64(Float64(l - Float64(l * 0.5)) + Float64(Float64(l * -0.5) + Float64(l * 0.16666666666666666))))))))); 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 <= -0.002) tmp = l - (w * (l + (w * (((l * 0.5) - l) + (w * ((l - (l * 0.5)) + ((l * -0.5) + (l * 0.16666666666666666)))))))); 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, -0.002], N[(l - N[(w * N[(l + N[(w * N[(N[(N[(l * 0.5), $MachinePrecision] - l), $MachinePrecision] + N[(w * N[(N[(l - N[(l * 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(l * -0.5), $MachinePrecision] + N[(l * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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 -0.002:\\
\;\;\;\;\ell - w \cdot \left(\ell + w \cdot \left(\left(\ell \cdot 0.5 - \ell\right) + w \cdot \left(\left(\ell - \ell \cdot 0.5\right) + \left(\ell \cdot -0.5 + \ell \cdot 0.16666666666666666\right)\right)\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 < -2e-3Initial 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-sqrt0.0%
sqrt-unprod44.9%
sqr-neg44.9%
sqrt-unprod44.9%
add-sqr-sqrt44.9%
add-sqr-sqrt44.9%
sqrt-unprod44.9%
add-sqr-sqrt44.9%
sqrt-unprod44.9%
sqr-neg44.9%
sqrt-unprod0.0%
add-sqr-sqrt0.3%
pow10.3%
exp-neg0.3%
inv-pow0.3%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around 0 63.5%
if -2e-3 < w Initial program 99.2%
exp-neg99.2%
remove-double-neg99.2%
associate-*l/99.2%
*-lft-identity99.2%
remove-double-neg99.2%
Simplified99.2%
add-sqr-sqrt60.4%
sqrt-unprod99.1%
sqr-neg99.1%
sqrt-unprod38.7%
add-sqr-sqrt97.4%
add-sqr-sqrt97.4%
sqrt-unprod97.4%
add-sqr-sqrt38.7%
sqrt-unprod78.1%
sqr-neg78.1%
sqrt-unprod39.4%
add-sqr-sqrt78.1%
pow178.1%
exp-neg78.1%
inv-pow78.1%
pow-prod-up97.5%
metadata-eval97.5%
metadata-eval97.5%
metadata-eval97.5%
Applied egg-rr97.5%
Taylor expanded in w around 0 95.0%
*-commutative99.7%
Simplified95.0%
Taylor expanded in l around 0 95.0%
Final simplification87.0%
(FPCore (w l) :precision binary64 (if (<= w 38000.0) (* l (+ 1.0 (+ w (* w (* w 0.5))))) (/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= 38000.0) {
tmp = l * (1.0 + (w + (w * (w * 0.5))));
} 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 <= 38000.0d0) then
tmp = l * (1.0d0 + (w + (w * (w * 0.5d0))))
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 <= 38000.0) {
tmp = l * (1.0 + (w + (w * (w * 0.5))));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 38000.0: tmp = l * (1.0 + (w + (w * (w * 0.5)))) 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 <= 38000.0) tmp = Float64(l * Float64(1.0 + Float64(w + Float64(w * Float64(w * 0.5))))); 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 <= 38000.0) tmp = l * (1.0 + (w + (w * (w * 0.5)))); 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, 38000.0], N[(l * N[(1.0 + N[(w + N[(w * N[(w * 0.5), $MachinePrecision]), $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 38000:\\
\;\;\;\;\ell \cdot \left(1 + \left(w + w \cdot \left(w \cdot 0.5\right)\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 < 38000Initial program 99.2%
Taylor expanded in w around 0 85.7%
add-sqr-sqrt36.1%
sqrt-unprod82.9%
sqr-neg82.9%
sqrt-unprod46.8%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt46.8%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod34.2%
add-sqr-sqrt67.9%
pow167.9%
exp-neg67.9%
inv-pow67.9%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr84.9%
sub-neg84.9%
distribute-rgt-in84.9%
*-commutative84.9%
metadata-eval84.9%
neg-mul-184.9%
add-sqr-sqrt50.6%
sqrt-unprod84.9%
sqr-neg84.9%
sqrt-unprod34.3%
add-sqr-sqrt84.9%
Applied egg-rr84.9%
if 38000 < w Initial 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-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 0 89.4%
*-commutative100.0%
Simplified89.4%
Taylor expanded in l around 0 89.4%
Final simplification85.5%
(FPCore (w l) :precision binary64 (if (<= w 45000.0) (* l (+ 1.0 (+ w (* w (* w 0.5))))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 45000.0) {
tmp = l * (1.0 + (w + (w * (w * 0.5))));
} 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 <= 45000.0d0) then
tmp = l * (1.0d0 + (w + (w * (w * 0.5d0))))
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 <= 45000.0) {
tmp = l * (1.0 + (w + (w * (w * 0.5))));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 45000.0: tmp = l * (1.0 + (w + (w * (w * 0.5)))) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 45000.0) tmp = Float64(l * Float64(1.0 + Float64(w + Float64(w * Float64(w * 0.5))))); 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 <= 45000.0) tmp = l * (1.0 + (w + (w * (w * 0.5)))); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 45000.0], N[(l * N[(1.0 + N[(w + N[(w * N[(w * 0.5), $MachinePrecision]), $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 45000:\\
\;\;\;\;\ell \cdot \left(1 + \left(w + w \cdot \left(w \cdot 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 45000Initial program 99.2%
Taylor expanded in w around 0 85.7%
add-sqr-sqrt36.1%
sqrt-unprod82.9%
sqr-neg82.9%
sqrt-unprod46.8%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt46.8%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod34.2%
add-sqr-sqrt67.9%
pow167.9%
exp-neg67.9%
inv-pow67.9%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr84.9%
sub-neg84.9%
distribute-rgt-in84.9%
*-commutative84.9%
metadata-eval84.9%
neg-mul-184.9%
add-sqr-sqrt50.6%
sqrt-unprod84.9%
sqr-neg84.9%
sqrt-unprod34.3%
add-sqr-sqrt84.9%
Applied egg-rr84.9%
if 45000 < w Initial 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-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 l around 0 100.0%
Taylor expanded in w around 0 77.7%
*-commutative100.0%
Simplified77.7%
Final simplification83.9%
(FPCore (w l) :precision binary64 (if (<= w 90000.0) (* l (+ 1.0 (* w (* w 0.5)))) (/ l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 90000.0) {
tmp = l * (1.0 + (w * (w * 0.5)));
} 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 <= 90000.0d0) then
tmp = l * (1.0d0 + (w * (w * 0.5d0)))
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 <= 90000.0) {
tmp = l * (1.0 + (w * (w * 0.5)));
} else {
tmp = l / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 90000.0: tmp = l * (1.0 + (w * (w * 0.5))) else: tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= 90000.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(w * 0.5)))); 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 <= 90000.0) tmp = l * (1.0 + (w * (w * 0.5))); else tmp = l / (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 90000.0], N[(l * N[(1.0 + N[(w * N[(w * 0.5), $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 90000:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < 9e4Initial program 99.2%
Taylor expanded in w around 0 85.7%
add-sqr-sqrt36.1%
sqrt-unprod82.9%
sqr-neg82.9%
sqrt-unprod46.8%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt46.8%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod34.2%
add-sqr-sqrt67.9%
pow167.9%
exp-neg67.9%
inv-pow67.9%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr84.9%
Taylor expanded in w around inf 84.9%
*-commutative84.9%
Simplified84.9%
if 9e4 < w Initial 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-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 l around 0 100.0%
Taylor expanded in w around 0 77.7%
*-commutative100.0%
Simplified77.7%
Final simplification83.9%
(FPCore (w l) :precision binary64 (if (<= w 52000.0) (* l (+ 1.0 (* w (+ (* w 0.5) -1.0)))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 52000.0) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} 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 <= 52000.0d0) then
tmp = l * (1.0d0 + (w * ((w * 0.5d0) + (-1.0d0))))
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 52000.0) {
tmp = l * (1.0 + (w * ((w * 0.5) + -1.0)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 52000.0: tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 52000.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * 0.5) + -1.0)))); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 52000.0) tmp = l * (1.0 + (w * ((w * 0.5) + -1.0))); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 52000.0], N[(l * N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 52000:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 52000Initial program 99.2%
Taylor expanded in w around 0 85.7%
add-sqr-sqrt36.1%
sqrt-unprod82.9%
sqr-neg82.9%
sqrt-unprod46.8%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt46.8%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod34.2%
add-sqr-sqrt67.9%
pow167.9%
exp-neg67.9%
inv-pow67.9%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr84.9%
Taylor expanded in l around 0 84.9%
if 52000 < w Initial 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-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 l around 0 100.0%
Taylor expanded in w around 0 50.4%
+-commutative52.8%
Simplified50.4%
Final simplification80.0%
(FPCore (w l) :precision binary64 (if (<= w 70000.0) (* l (+ 1.0 (* w (* w 0.5)))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 70000.0) {
tmp = l * (1.0 + (w * (w * 0.5)));
} 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 <= 70000.0d0) then
tmp = l * (1.0d0 + (w * (w * 0.5d0)))
else
tmp = l / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 70000.0) {
tmp = l * (1.0 + (w * (w * 0.5)));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 70000.0: tmp = l * (1.0 + (w * (w * 0.5))) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 70000.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(w * 0.5)))); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 70000.0) tmp = l * (1.0 + (w * (w * 0.5))); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 70000.0], N[(l * N[(1.0 + N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 70000:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 7e4Initial program 99.2%
Taylor expanded in w around 0 85.7%
add-sqr-sqrt36.1%
sqrt-unprod82.9%
sqr-neg82.9%
sqrt-unprod46.8%
add-sqr-sqrt81.5%
add-sqr-sqrt81.5%
sqrt-unprod81.5%
add-sqr-sqrt46.8%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod34.2%
add-sqr-sqrt67.9%
pow167.9%
exp-neg67.9%
inv-pow67.9%
pow-prod-up97.4%
metadata-eval97.4%
metadata-eval97.4%
metadata-eval97.4%
Applied egg-rr84.9%
Taylor expanded in w around inf 84.9%
*-commutative84.9%
Simplified84.9%
if 7e4 < w Initial 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-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 l around 0 100.0%
Taylor expanded in w around 0 50.4%
+-commutative52.8%
Simplified50.4%
Final simplification80.0%
(FPCore (w l) :precision binary64 (if (<= w 0.24) (* l (- 1.0 w)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.24) {
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.24d0) 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.24) {
tmp = l * (1.0 - w);
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.24: tmp = l * (1.0 - w) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.24) 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.24) tmp = l * (1.0 - w); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.24], 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.24:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 0.23999999999999999Initial 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-sqrt35.7%
sqrt-unprod83.2%
sqr-neg83.2%
sqrt-unprod47.5%
add-sqr-sqrt82.1%
add-sqr-sqrt82.1%
sqrt-unprod82.1%
add-sqr-sqrt47.5%
sqrt-unprod82.2%
sqr-neg82.2%
sqrt-unprod34.7%
add-sqr-sqrt68.8%
pow168.8%
exp-neg68.8%
inv-pow68.8%
pow-prod-up98.3%
metadata-eval98.3%
metadata-eval98.3%
metadata-eval98.3%
Applied egg-rr98.3%
Taylor expanded in w around 0 75.3%
mul-1-neg75.3%
unsub-neg75.3%
Simplified75.3%
Taylor expanded in l around 0 75.3%
if 0.23999999999999999 < w Initial program 97.4%
exp-neg97.4%
remove-double-neg97.4%
associate-*l/97.4%
*-lft-identity97.4%
remove-double-neg97.4%
Simplified97.4%
add-sqr-sqrt97.4%
sqrt-unprod97.4%
sqr-neg97.4%
sqrt-unprod0.0%
add-sqr-sqrt95.0%
add-sqr-sqrt95.0%
sqrt-unprod95.0%
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.0%
metadata-eval95.0%
metadata-eval95.0%
metadata-eval95.0%
Applied egg-rr95.0%
Taylor expanded in l around 0 95.0%
Taylor expanded in w around 0 46.8%
+-commutative56.4%
Simplified46.8%
(FPCore (w l) :precision binary64 (if (<= w -0.75) (* (- w) l) l))
double code(double w, double l) {
double tmp;
if (w <= -0.75) {
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 <= (-0.75d0)) 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 <= -0.75) {
tmp = -w * l;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.75: tmp = -w * l else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -0.75) tmp = Float64(Float64(-w) * l); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.75) tmp = -w * l; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.75], N[((-w) * l), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.75:\\
\;\;\;\;\left(-w\right) \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -0.75Initial 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-unprod45.3%
sqr-neg45.3%
sqrt-unprod45.3%
add-sqr-sqrt45.3%
add-sqr-sqrt45.3%
sqrt-unprod45.3%
add-sqr-sqrt45.3%
sqrt-unprod45.3%
sqr-neg45.3%
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 22.1%
mul-1-neg22.1%
unsub-neg22.1%
Simplified22.1%
Taylor expanded in w around inf 22.1%
associate-*r*22.1%
*-commutative22.1%
neg-mul-122.1%
Simplified22.1%
if -0.75 < w Initial program 99.1%
Taylor expanded in w around 0 78.8%
Final simplification64.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 99.3%
exp-neg99.3%
remove-double-neg99.3%
associate-*l/99.3%
*-lft-identity99.3%
remove-double-neg99.3%
Simplified99.3%
add-sqr-sqrt45.1%
sqrt-unprod85.3%
sqr-neg85.3%
sqrt-unprod40.2%
add-sqr-sqrt84.1%
add-sqr-sqrt84.1%
sqrt-unprod84.1%
add-sqr-sqrt40.2%
sqrt-unprod69.7%
sqr-neg69.7%
sqrt-unprod29.4%
add-sqr-sqrt58.3%
pow158.3%
exp-neg58.3%
inv-pow58.3%
pow-prod-up97.8%
metadata-eval97.8%
metadata-eval97.8%
metadata-eval97.8%
Applied egg-rr97.8%
Taylor expanded in w around 0 64.4%
mul-1-neg64.4%
unsub-neg64.4%
Simplified64.4%
Taylor expanded in l around 0 64.4%
(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 99.3%
Taylor expanded in w around 0 60.0%
herbie shell --seed 2024157
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))