
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
(FPCore (w l) :precision binary64 (/ (pow l (exp w)) (exp w)))
double code(double w, double l) {
return pow(l, exp(w)) / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = (l ** exp(w)) / exp(w)
end function
public static double code(double w, double l) {
return Math.pow(l, Math.exp(w)) / Math.exp(w);
}
def code(w, l): return math.pow(l, math.exp(w)) / math.exp(w)
function code(w, l) return Float64((l ^ exp(w)) / exp(w)) end
function tmp = code(w, l) tmp = (l ^ exp(w)) / exp(w); end
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}
\end{array}
Initial program 99.6%
exp-neg99.6%
remove-double-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
remove-double-neg99.6%
Simplified99.6%
(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%
add-sqr-sqrt0.0%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod47.4%
add-sqr-sqrt47.4%
add-sqr-sqrt47.4%
sqrt-unprod47.4%
add-sqr-sqrt47.4%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
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%
if -1.6000000000000001 < w Initial program 99.4%
exp-neg99.4%
remove-double-neg99.4%
associate-*l/99.4%
*-lft-identity99.4%
remove-double-neg99.4%
Simplified99.4%
Taylor expanded in w around 0 99.2%
*-commutative99.2%
Simplified99.2%
(FPCore (w l) :precision binary64 (let* ((t_0 (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))) (if (<= w -1.6) (/ 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 + (w * 0.16666666666666666)))));
double tmp;
if (w <= -1.6) {
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 + (w * 0.16666666666666666d0)))))
if (w <= (-1.6d0)) 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 + (w * 0.16666666666666666)))));
double tmp;
if (w <= -1.6) {
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 + (w * 0.16666666666666666))))) tmp = 0 if w <= -1.6: 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 * Float64(0.5 + Float64(w * 0.16666666666666666)))))) tmp = 0.0 if (w <= -1.6) 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 + (w * 0.16666666666666666))))); tmp = 0.0; if (w <= -1.6) 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 * N[(0.5 + N[(w * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -1.6], 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 \left(0.5 + w \cdot 0.16666666666666666\right)\right)\\
\mathbf{if}\;w \leq -1.6:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\
\end{array}
\end{array}
if w < -1.6000000000000001Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod47.4%
add-sqr-sqrt47.4%
add-sqr-sqrt47.4%
sqrt-unprod47.4%
add-sqr-sqrt47.4%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
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%
if -1.6000000000000001 < w Initial program 99.4%
exp-neg99.4%
remove-double-neg99.4%
associate-*l/99.4%
*-lft-identity99.4%
remove-double-neg99.4%
Simplified99.4%
Taylor expanded in w around 0 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in w around 0 98.9%
*-commutative99.2%
Simplified98.9%
(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%
add-sqr-sqrt0.0%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod47.4%
add-sqr-sqrt47.4%
add-sqr-sqrt47.4%
sqrt-unprod47.4%
add-sqr-sqrt47.4%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
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%
if -2.39999999999999991 < w Initial program 99.4%
exp-neg99.4%
remove-double-neg99.4%
associate-*l/99.4%
*-lft-identity99.4%
remove-double-neg99.4%
Simplified99.4%
Taylor expanded in w around 0 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in w around 0 98.8%
*-commutative99.2%
Simplified98.8%
(FPCore (w l) :precision binary64 (* l (exp (- w))))
double code(double w, double l) {
return l * exp(-w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l * exp(-w)
end function
public static double code(double w, double l) {
return l * Math.exp(-w);
}
def code(w, l): return l * math.exp(-w)
function code(w, l) return Float64(l * exp(Float64(-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}
\\
\ell \cdot e^{-w}
\end{array}
Initial program 99.6%
add-sqr-sqrt42.8%
sqrt-unprod83.7%
sqr-neg83.7%
sqrt-unprod40.9%
add-sqr-sqrt82.3%
add-sqr-sqrt82.3%
sqrt-unprod82.3%
add-sqr-sqrt40.9%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-unprod29.4%
add-sqr-sqrt56.6%
pow156.6%
exp-neg56.6%
inv-pow56.6%
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%
(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.6%
add-sqr-sqrt42.8%
sqrt-unprod83.7%
sqr-neg83.7%
sqrt-unprod40.9%
add-sqr-sqrt82.3%
add-sqr-sqrt82.3%
sqrt-unprod82.3%
add-sqr-sqrt40.9%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-unprod29.4%
add-sqr-sqrt56.6%
pow156.6%
exp-neg56.6%
inv-pow56.6%
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
(if (<= w 0.04)
(* l (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0))))
(/
(+ (+ l 1.0) -1.0)
(+ 1.0 (* w (+ 1.0 (* w (* w 0.16666666666666666))))))))
double code(double w, double l) {
double tmp;
if (w <= 0.04) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = ((l + 1.0) + -1.0) / (1.0 + (w * (1.0 + (w * (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.04d0) then
tmp = l * (1.0d0 + (w * ((w * (0.5d0 + (w * (-0.16666666666666666d0)))) + (-1.0d0))))
else
tmp = ((l + 1.0d0) + (-1.0d0)) / (1.0d0 + (w * (1.0d0 + (w * (w * 0.16666666666666666d0)))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.04) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0)));
} else {
tmp = ((l + 1.0) + -1.0) / (1.0 + (w * (1.0 + (w * (w * 0.16666666666666666)))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.04: tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))) else: tmp = ((l + 1.0) + -1.0) / (1.0 + (w * (1.0 + (w * (w * 0.16666666666666666))))) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.04) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))) + -1.0)))); else tmp = Float64(Float64(Float64(l + 1.0) + -1.0) / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(w * 0.16666666666666666)))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.04) tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -1.0))); else tmp = ((l + 1.0) + -1.0) / (1.0 + (w * (1.0 + (w * (w * 0.16666666666666666))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.04], 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[(N[(N[(l + 1.0), $MachinePrecision] + -1.0), $MachinePrecision] / N[(1.0 + N[(w * N[(1.0 + N[(w * N[(w * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.04:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\ell + 1\right) + -1}{1 + w \cdot \left(1 + w \cdot \left(w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < 0.0400000000000000008Initial program 99.5%
add-sqr-sqrt34.3%
sqrt-unprod81.2%
sqr-neg81.2%
sqrt-unprod46.9%
add-sqr-sqrt80.5%
add-sqr-sqrt80.5%
sqrt-unprod80.5%
add-sqr-sqrt46.9%
sqrt-unprod80.6%
sqr-neg80.6%
sqrt-unprod33.6%
add-sqr-sqrt64.9%
pow164.9%
exp-neg64.9%
inv-pow64.9%
pow-prod-up97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Applied egg-rr97.2%
Taylor expanded in w around inf 97.2%
Taylor expanded in w around 0 91.6%
if 0.0400000000000000008 < w Initial program 99.9%
exp-neg99.9%
remove-double-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
remove-double-neg99.9%
Simplified99.9%
Taylor expanded in w around 0 98.6%
*-commutative98.6%
Simplified98.6%
add-sqr-sqrt99.9%
sqrt-unprod99.9%
sqr-neg99.9%
sqrt-unprod0.0%
add-sqr-sqrt94.3%
add-sqr-sqrt94.3%
sqrt-unprod94.3%
add-sqr-sqrt0.0%
sqrt-unprod0.7%
sqr-neg0.7%
sqrt-unprod0.7%
add-sqr-sqrt0.7%
pow10.7%
exp-neg0.7%
inv-pow0.7%
pow-prod-up94.6%
metadata-eval94.6%
metadata-eval94.6%
metadata-eval94.6%
Applied egg-rr72.8%
Taylor expanded in w around inf 72.8%
*-commutative72.8%
Simplified72.8%
*-rgt-identity72.8%
expm1-log1p-u72.8%
expm1-undefine91.6%
log1p-undefine91.6%
rem-exp-log91.6%
+-commutative91.6%
Applied egg-rr91.6%
Final simplification91.6%
(FPCore (w l) :precision binary64 (if (<= w -85.0) (* l (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0)))) (/ l (+ 1.0 (* w (+ 1.0 (* w (- 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -85.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 - (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 <= (-85.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 - (w * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -85.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 - (w * 0.16666666666666666))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -85.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 - (w * 0.16666666666666666)))))) return tmp
function code(w, l) tmp = 0.0 if (w <= -85.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 * Float64(0.5 - Float64(w * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -85.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 - (w * 0.16666666666666666)))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -85.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 * N[(0.5 - N[(w * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -85:\\
\;\;\;\;\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 \left(0.5 - w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < -85Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod48.0%
add-sqr-sqrt48.0%
add-sqr-sqrt48.0%
sqrt-unprod48.0%
add-sqr-sqrt48.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around inf 98.7%
Taylor expanded in w around 0 81.5%
if -85 < w Initial program 99.4%
exp-neg99.4%
remove-double-neg99.4%
associate-*l/99.4%
*-lft-identity99.4%
remove-double-neg99.4%
Simplified99.4%
Taylor expanded in w around 0 98.7%
*-commutative98.7%
Simplified98.7%
add-sqr-sqrt59.8%
sqrt-unprod97.9%
sqr-neg97.9%
sqrt-unprod38.1%
add-sqr-sqrt96.0%
add-sqr-sqrt96.0%
sqrt-unprod96.0%
add-sqr-sqrt38.1%
sqrt-unprod79.1%
sqr-neg79.1%
sqrt-unprod41.1%
add-sqr-sqrt79.2%
pow179.2%
exp-neg79.2%
inv-pow79.2%
pow-prod-up96.1%
metadata-eval96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr92.2%
add-sqr-sqrt54.1%
sqrt-unprod92.2%
sqr-neg92.2%
sqrt-unprod38.1%
add-sqr-sqrt92.2%
cancel-sign-sub-inv92.2%
Applied egg-rr92.2%
Final simplification89.1%
(FPCore (w l) :precision binary64 (if (<= w 8e-9) (* l (+ 1.0 (* w (+ (* w (+ 0.5 (* w -0.16666666666666666))) -1.0)))) (/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= 8e-9) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -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 <= 8d-9) 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 + (w * 0.16666666666666666d0))))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 8e-9) {
tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -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 <= 8e-9: tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -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 <= 8e-9) 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 * Float64(0.5 + Float64(w * 0.16666666666666666))))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 8e-9) tmp = l * (1.0 + (w * ((w * (0.5 + (w * -0.16666666666666666))) + -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, 8e-9], 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 * N[(0.5 + N[(w * 0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 8 \cdot 10^{-9}:\\
\;\;\;\;\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 \left(0.5 + w \cdot 0.16666666666666666\right)\right)}\\
\end{array}
\end{array}
if w < 8.0000000000000005e-9Initial program 99.6%
add-sqr-sqrt33.8%
sqrt-unprod81.2%
sqr-neg81.2%
sqrt-unprod47.4%
add-sqr-sqrt81.1%
add-sqr-sqrt81.1%
sqrt-unprod81.1%
add-sqr-sqrt47.4%
sqrt-unprod81.1%
sqr-neg81.1%
sqrt-unprod33.7%
add-sqr-sqrt65.3%
pow165.3%
exp-neg65.3%
inv-pow65.3%
pow-prod-up97.9%
metadata-eval97.9%
metadata-eval97.9%
metadata-eval97.9%
Applied egg-rr97.9%
Taylor expanded in w around inf 97.9%
Taylor expanded in w around 0 92.2%
if 8.0000000000000005e-9 < 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%
Taylor expanded in w around 0 98.1%
*-commutative98.1%
Simplified98.1%
add-sqr-sqrt99.2%
sqrt-unprod99.2%
sqr-neg99.2%
sqrt-unprod0.0%
add-sqr-sqrt90.1%
add-sqr-sqrt90.1%
sqrt-unprod90.1%
add-sqr-sqrt0.0%
sqrt-unprod1.8%
sqr-neg1.8%
sqrt-unprod1.8%
add-sqr-sqrt1.8%
pow11.8%
exp-neg1.8%
inv-pow1.8%
pow-prod-up90.4%
metadata-eval90.4%
metadata-eval90.4%
metadata-eval90.4%
Applied egg-rr69.8%
Taylor expanded in l around 0 69.8%
Final simplification89.1%
(FPCore (w l) :precision binary64 (if (<= w -15.2) (* 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 <= -15.2) {
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 <= (-15.2d0)) 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 <= -15.2) {
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 <= -15.2: 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 <= -15.2) 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 <= -15.2) 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, -15.2], 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 -15.2:\\
\;\;\;\;\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 < -15.199999999999999Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod48.0%
add-sqr-sqrt48.0%
add-sqr-sqrt48.0%
sqrt-unprod48.0%
add-sqr-sqrt48.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around inf 98.7%
Taylor expanded in w around 0 81.5%
if -15.199999999999999 < w Initial program 99.4%
add-sqr-sqrt59.8%
sqrt-unprod97.9%
sqr-neg97.9%
sqrt-unprod38.1%
add-sqr-sqrt96.0%
add-sqr-sqrt96.0%
sqrt-unprod96.0%
add-sqr-sqrt38.1%
sqrt-unprod79.1%
sqr-neg79.1%
sqrt-unprod41.1%
add-sqr-sqrt79.2%
pow179.2%
exp-neg79.2%
inv-pow79.2%
pow-prod-up96.1%
metadata-eval96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Taylor expanded in w around inf 96.1%
exp-neg96.1%
associate-*r/96.1%
*-rgt-identity96.1%
Simplified96.1%
Taylor expanded in w around 0 91.5%
*-commutative98.4%
Simplified91.5%
Final simplification88.7%
(FPCore (w l) :precision binary64 (if (<= w -100.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 <= -100.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 <= (-100.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 <= -100.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 <= -100.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 <= -100.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 <= -100.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, -100.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 -100:\\
\;\;\;\;\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 < -100Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod48.0%
add-sqr-sqrt48.0%
add-sqr-sqrt48.0%
sqrt-unprod48.0%
add-sqr-sqrt48.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around inf 98.7%
Taylor expanded in w around 0 63.2%
if -100 < w Initial program 99.4%
add-sqr-sqrt59.8%
sqrt-unprod97.9%
sqr-neg97.9%
sqrt-unprod38.1%
add-sqr-sqrt96.0%
add-sqr-sqrt96.0%
sqrt-unprod96.0%
add-sqr-sqrt38.1%
sqrt-unprod79.1%
sqr-neg79.1%
sqrt-unprod41.1%
add-sqr-sqrt79.2%
pow179.2%
exp-neg79.2%
inv-pow79.2%
pow-prod-up96.1%
metadata-eval96.1%
metadata-eval96.1%
metadata-eval96.1%
Applied egg-rr96.1%
Taylor expanded in w around inf 96.1%
exp-neg96.1%
associate-*r/96.1%
*-rgt-identity96.1%
Simplified96.1%
Taylor expanded in w around 0 91.5%
*-commutative98.4%
Simplified91.5%
Final simplification83.4%
(FPCore (w l) :precision binary64 (if (<= w 0.035) (* l (+ 1.0 (* w (+ (* w 0.5) -1.0)))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.035) {
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 <= 0.035d0) 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 <= 0.035) {
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 <= 0.035: 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 <= 0.035) 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 <= 0.035) 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, 0.035], 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 0.035:\\
\;\;\;\;\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 < 0.035000000000000003Initial program 99.5%
add-sqr-sqrt34.3%
sqrt-unprod81.2%
sqr-neg81.2%
sqrt-unprod46.9%
add-sqr-sqrt80.5%
add-sqr-sqrt80.5%
sqrt-unprod80.5%
add-sqr-sqrt46.9%
sqrt-unprod80.6%
sqr-neg80.6%
sqrt-unprod33.6%
add-sqr-sqrt64.9%
pow164.9%
exp-neg64.9%
inv-pow64.9%
pow-prod-up97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Applied egg-rr97.2%
Taylor expanded in w around inf 97.2%
Taylor expanded in w around 0 85.6%
if 0.035000000000000003 < w Initial program 99.9%
add-sqr-sqrt99.9%
sqrt-unprod99.9%
sqr-neg99.9%
sqrt-unprod0.0%
add-sqr-sqrt94.3%
add-sqr-sqrt94.3%
sqrt-unprod94.3%
add-sqr-sqrt0.0%
sqrt-unprod0.7%
sqr-neg0.7%
sqrt-unprod0.7%
add-sqr-sqrt0.7%
pow10.7%
exp-neg0.7%
inv-pow0.7%
pow-prod-up94.6%
metadata-eval94.6%
metadata-eval94.6%
metadata-eval94.6%
Applied egg-rr94.6%
Taylor expanded in w around inf 94.6%
exp-neg94.6%
associate-*r/94.6%
*-rgt-identity94.6%
Simplified94.6%
Taylor expanded in w around 0 38.2%
+-commutative38.2%
Simplified38.2%
Final simplification79.5%
(FPCore (w l) :precision binary64 (if (<= w 0.122) (+ l (* w (- (* l w) l))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= 0.122) {
tmp = l + (w * ((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 <= 0.122d0) then
tmp = l + (w * ((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 <= 0.122) {
tmp = l + (w * ((l * w) - l));
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.122: tmp = l + (w * ((l * w) - l)) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.122) tmp = Float64(l + Float64(w * Float64(Float64(l * 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 <= 0.122) tmp = l + (w * ((l * w) - l)); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.122], N[(l + N[(w * N[(N[(l * w), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.122:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot w - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < 0.122Initial program 99.5%
exp-neg99.5%
remove-double-neg99.5%
associate-*l/99.5%
*-lft-identity99.5%
remove-double-neg99.5%
Simplified99.5%
Taylor expanded in w around 0 66.8%
*-commutative66.8%
Simplified66.8%
add-sqr-sqrt34.6%
sqrt-unprod81.3%
sqr-neg81.3%
sqrt-unprod46.7%
add-sqr-sqrt80.2%
add-sqr-sqrt80.2%
sqrt-unprod80.2%
add-sqr-sqrt46.7%
sqrt-unprod80.2%
sqr-neg80.2%
sqrt-unprod33.5%
add-sqr-sqrt64.7%
pow164.7%
exp-neg64.7%
inv-pow64.7%
pow-prod-up96.8%
metadata-eval96.8%
metadata-eval96.8%
metadata-eval96.8%
Applied egg-rr65.1%
Taylor expanded in w around inf 65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in w around 0 82.3%
if 0.122 < w Initial program 100.0%
add-sqr-sqrt100.0%
sqrt-unprod100.0%
sqr-neg100.0%
sqrt-unprod0.0%
add-sqr-sqrt97.0%
add-sqr-sqrt97.0%
sqrt-unprod97.0%
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-up97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Applied egg-rr97.2%
Taylor expanded in w around inf 97.2%
exp-neg97.2%
associate-*r/97.2%
*-rgt-identity97.2%
Simplified97.2%
Taylor expanded in w around 0 39.0%
+-commutative39.0%
Simplified39.0%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (- (* l w)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = -(l * 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 <= (-1.0d0)) then
tmp = -(l * 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 <= -1.0) {
tmp = -(l * w);
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = -(l * w) else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = Float64(-Float64(l * w)); else tmp = Float64(l / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = -(l * w); else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], (-N[(l * w), $MachinePrecision]), N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;-\ell \cdot w\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod47.4%
add-sqr-sqrt47.4%
add-sqr-sqrt47.4%
sqrt-unprod47.4%
add-sqr-sqrt47.4%
sqrt-unprod47.4%
sqr-neg47.4%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
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%
Taylor expanded in w around 0 28.8%
neg-mul-128.8%
unsub-neg28.8%
Simplified28.8%
Taylor expanded in w around inf 28.8%
mul-1-neg28.8%
distribute-rgt-neg-out28.8%
Simplified28.8%
if -1 < w Initial program 99.4%
add-sqr-sqrt60.2%
sqrt-unprod98.4%
sqr-neg98.4%
sqrt-unprod38.2%
add-sqr-sqrt96.5%
add-sqr-sqrt96.5%
sqrt-unprod96.5%
add-sqr-sqrt38.2%
sqrt-unprod79.6%
sqr-neg79.6%
sqrt-unprod41.3%
add-sqr-sqrt79.6%
pow179.6%
exp-neg79.6%
inv-pow79.6%
pow-prod-up96.6%
metadata-eval96.6%
metadata-eval96.6%
metadata-eval96.6%
Applied egg-rr96.6%
Taylor expanded in w around inf 96.6%
exp-neg96.6%
associate-*r/96.6%
*-rgt-identity96.6%
Simplified96.6%
Taylor expanded in w around 0 86.4%
+-commutative86.4%
Simplified86.4%
Final simplification69.8%
(FPCore (w l) :precision binary64 (if (<= w -15.5) (- (* l w)) l))
double code(double w, double l) {
double tmp;
if (w <= -15.5) {
tmp = -(l * w);
} 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 <= (-15.5d0)) then
tmp = -(l * w)
else
tmp = l
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -15.5) {
tmp = -(l * w);
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -15.5: tmp = -(l * w) else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -15.5) tmp = Float64(-Float64(l * w)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -15.5) tmp = -(l * w); else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -15.5], (-N[(l * w), $MachinePrecision]), l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -15.5:\\
\;\;\;\;-\ell \cdot w\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -15.5Initial program 100.0%
add-sqr-sqrt0.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod48.0%
add-sqr-sqrt48.0%
add-sqr-sqrt48.0%
sqrt-unprod48.0%
add-sqr-sqrt48.0%
sqrt-unprod48.0%
sqr-neg48.0%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.7%
metadata-eval98.7%
metadata-eval98.7%
metadata-eval98.7%
Applied egg-rr98.7%
Taylor expanded in w around inf 98.7%
Taylor expanded in w around 0 29.2%
neg-mul-129.2%
unsub-neg29.2%
Simplified29.2%
Taylor expanded in w around inf 29.2%
mul-1-neg29.2%
distribute-rgt-neg-out29.2%
Simplified29.2%
if -15.5 < w Initial program 99.4%
Taylor expanded in w around 0 80.1%
Final simplification65.6%
(FPCore (w l) :precision binary64 (- l (* l w)))
double code(double w, double l) {
return l - (l * w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l - (l * w)
end function
public static double code(double w, double l) {
return l - (l * w);
}
def code(w, l): return l - (l * w)
function code(w, l) return Float64(l - Float64(l * w)) end
function tmp = code(w, l) tmp = l - (l * w); end
code[w_, l_] := N[(l - N[(l * w), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell - \ell \cdot w
\end{array}
Initial program 99.6%
add-sqr-sqrt42.8%
sqrt-unprod83.7%
sqr-neg83.7%
sqrt-unprod40.9%
add-sqr-sqrt82.3%
add-sqr-sqrt82.3%
sqrt-unprod82.3%
add-sqr-sqrt40.9%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-unprod29.4%
add-sqr-sqrt56.6%
pow156.6%
exp-neg56.6%
inv-pow56.6%
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%
Taylor expanded in w around 0 65.3%
mul-1-neg65.3%
unsub-neg65.3%
Simplified65.3%
(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.6%
add-sqr-sqrt42.8%
sqrt-unprod83.7%
sqr-neg83.7%
sqrt-unprod40.9%
add-sqr-sqrt82.3%
add-sqr-sqrt82.3%
sqrt-unprod82.3%
add-sqr-sqrt40.9%
sqrt-unprod70.3%
sqr-neg70.3%
sqrt-unprod29.4%
add-sqr-sqrt56.6%
pow156.6%
exp-neg56.6%
inv-pow56.6%
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%
Taylor expanded in w around 0 65.3%
neg-mul-165.3%
unsub-neg65.3%
Simplified65.3%
(FPCore (w l) :precision binary64 l)
double code(double w, double l) {
return l;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l
end function
public static double code(double w, double l) {
return l;
}
def code(w, l): return l
function code(w, l) return l end
function tmp = code(w, l) tmp = l; end
code[w_, l_] := l
\begin{array}{l}
\\
\ell
\end{array}
Initial program 99.6%
Taylor expanded in w around 0 58.3%
herbie shell --seed 2024145
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))