
(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 (* (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 -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-unprod48.6%
sqr-neg48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.6%
metadata-eval98.6%
metadata-eval98.6%
metadata-eval98.6%
Applied egg-rr98.6%
Taylor expanded in l around 0 98.6%
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.5%
*-commutative99.5%
Simplified99.5%
(FPCore (w l) :precision binary64 (if (<= w -200.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 <= -200.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 <= (-200.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 <= -200.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 <= -200.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 <= -200.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 <= -200.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, -200.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 -200:\\
\;\;\;\;\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 < -200Initial 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-unprod49.3%
sqr-neg49.3%
sqrt-unprod49.3%
add-sqr-sqrt49.3%
add-sqr-sqrt49.3%
sqrt-unprod49.3%
add-sqr-sqrt49.3%
sqrt-unprod49.3%
sqr-neg49.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 -200 < 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.0%
*-commutative99.0%
Simplified99.0%
Final simplification99.2%
(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-unprod48.6%
sqr-neg48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.6%
metadata-eval98.6%
metadata-eval98.6%
metadata-eval98.6%
Applied egg-rr98.6%
Taylor expanded in l around 0 98.6%
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.5%
Simplified99.4%
Final simplification99.2%
(FPCore (w l) :precision binary64 (let* ((t_0 (- 1.0 (* w (- -1.0 (* w 0.5)))))) (if (<= w -2.05) (/ 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 <= -2.05) {
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 <= (-2.05d0)) 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 <= -2.05) {
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 <= -2.05: 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 <= -2.05) 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 <= -2.05) 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, -2.05], 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 -2.05:\\
\;\;\;\;\frac{\ell}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\
\end{array}
\end{array}
if w < -2.0499999999999998Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.6%
metadata-eval98.6%
metadata-eval98.6%
metadata-eval98.6%
Applied egg-rr98.6%
Taylor expanded in l around 0 98.6%
if -2.0499999999999998 < 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.3%
*-commutative99.4%
Simplified99.3%
Final simplification99.2%
(FPCore (w l) :precision binary64 (* l (/ 1.0 (exp w))))
double code(double w, double l) {
return l * (1.0 / exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l * (1.0d0 / exp(w))
end function
public static double code(double w, double l) {
return l * (1.0 / Math.exp(w));
}
def code(w, l): return l * (1.0 / math.exp(w))
function code(w, l) return Float64(l * Float64(1.0 / exp(w))) end
function tmp = code(w, l) tmp = l * (1.0 / exp(w)); end
code[w_, l_] := N[(l * N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell \cdot \frac{1}{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-sqrt42.9%
sqrt-unprod84.6%
sqr-neg84.6%
sqrt-unprod41.8%
add-sqr-sqrt83.5%
add-sqr-sqrt83.5%
sqrt-unprod83.5%
add-sqr-sqrt41.8%
sqrt-unprod69.5%
sqr-neg69.5%
sqrt-unprod27.7%
add-sqr-sqrt56.2%
pow156.2%
exp-neg56.2%
inv-pow56.2%
pow-prod-up97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Applied egg-rr97.2%
frac-2neg97.2%
div-inv97.2%
*-rgt-identity97.2%
Applied egg-rr97.2%
Final simplification97.2%
(FPCore (w l) :precision binary64 (/ l (exp w)))
double code(double w, double l) {
return l / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l / exp(w)
end function
public static double code(double w, double l) {
return l / Math.exp(w);
}
def code(w, l): return l / math.exp(w)
function code(w, l) return Float64(l / exp(w)) end
function tmp = code(w, l) tmp = l / exp(w); end
code[w_, l_] := N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{e^{w}}
\end{array}
Initial program 99.3%
exp-neg99.3%
remove-double-neg99.3%
associate-*l/99.3%
*-lft-identity99.3%
remove-double-neg99.3%
Simplified99.3%
add-sqr-sqrt42.9%
sqrt-unprod84.6%
sqr-neg84.6%
sqrt-unprod41.8%
add-sqr-sqrt83.5%
add-sqr-sqrt83.5%
sqrt-unprod83.5%
add-sqr-sqrt41.8%
sqrt-unprod69.5%
sqr-neg69.5%
sqrt-unprod27.7%
add-sqr-sqrt56.2%
pow156.2%
exp-neg56.2%
inv-pow56.2%
pow-prod-up97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Applied egg-rr97.2%
Taylor expanded in l around 0 97.2%
(FPCore (w l) :precision binary64 (if (<= w -5e-12) (* l (+ 1.0 (* w (+ -1.0 (* w (- 0.5 (* w 0.16666666666666666))))))) (/ l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -5e-12) {
tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 - (w * 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 <= (-5d-12)) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 - (w * 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 <= -5e-12) {
tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 - (w * 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 <= -5e-12: tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 - (w * 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 <= -5e-12) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 - Float64(w * 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 <= -5e-12) tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 - (w * 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, -5e-12], 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], 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 -5 \cdot 10^{-12}:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot \left(0.5 - w \cdot 0.16666666666666666\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 < -4.9999999999999997e-12Initial program 99.6%
exp-neg99.6%
remove-double-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
remove-double-neg99.6%
Simplified99.6%
add-sqr-sqrt0.0%
sqrt-unprod48.5%
sqr-neg48.5%
sqrt-unprod48.5%
add-sqr-sqrt48.5%
add-sqr-sqrt48.5%
sqrt-unprod48.5%
add-sqr-sqrt48.5%
sqrt-unprod48.5%
sqr-neg48.5%
sqrt-unprod0.0%
add-sqr-sqrt2.0%
pow12.0%
exp-neg2.0%
inv-pow2.0%
pow-prod-up96.5%
metadata-eval96.5%
metadata-eval96.5%
metadata-eval96.5%
Applied egg-rr96.5%
frac-2neg96.5%
div-inv96.5%
*-rgt-identity96.5%
Applied egg-rr96.5%
Taylor expanded in w around 0 73.1%
if -4.9999999999999997e-12 < 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.0%
sqrt-unprod99.0%
sqr-neg99.0%
sqrt-unprod39.1%
add-sqr-sqrt97.5%
add-sqr-sqrt97.5%
sqrt-unprod97.5%
add-sqr-sqrt39.1%
sqrt-unprod77.8%
sqr-neg77.8%
sqrt-unprod38.8%
add-sqr-sqrt77.9%
pow177.9%
exp-neg77.9%
inv-pow77.9%
pow-prod-up97.5%
metadata-eval97.5%
metadata-eval97.5%
metadata-eval97.5%
Applied egg-rr97.5%
Taylor expanded in w around 0 95.1%
*-commutative99.6%
Simplified95.1%
Taylor expanded in l around 0 95.1%
Final simplification88.8%
(FPCore (w l) :precision binary64 (if (<= w 29000000.0) (* l (+ 1.0 (* w (- -1.0 (* 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 <= 29000000.0) {
tmp = l * (1.0 + (w * (-1.0 - (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 <= 29000000.0d0) then
tmp = l * (1.0d0 + (w * ((-1.0d0) - (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 <= 29000000.0) {
tmp = l * (1.0 + (w * (-1.0 - (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 <= 29000000.0: tmp = l * (1.0 + (w * (-1.0 - (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 <= 29000000.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 - 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 <= 29000000.0) tmp = l * (1.0 + (w * (-1.0 - (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, 29000000.0], N[(l * N[(1.0 + N[(w * N[(-1.0 - 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 29000000:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 - w \cdot -0.5\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.9e7Initial 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-sqrt33.5%
sqrt-unprod82.1%
sqr-neg82.1%
sqrt-unprod48.6%
add-sqr-sqrt80.8%
add-sqr-sqrt80.8%
sqrt-unprod80.8%
add-sqr-sqrt48.6%
sqrt-unprod80.8%
sqr-neg80.8%
sqrt-unprod32.2%
add-sqr-sqrt65.4%
pow165.4%
exp-neg65.4%
inv-pow65.4%
pow-prod-up96.8%
metadata-eval96.8%
metadata-eval96.8%
metadata-eval96.8%
Applied egg-rr96.8%
frac-2neg96.8%
div-inv96.8%
*-rgt-identity96.8%
Applied egg-rr96.8%
Taylor expanded in w around 0 86.8%
if 2.9e7 < 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 87.6%
*-commutative100.0%
Simplified87.6%
Taylor expanded in l around 0 87.6%
Final simplification86.9%
(FPCore (w l) :precision binary64 (if (<= w 42000000.0) (* l (+ 1.0 (* w (- -1.0 (* w -0.5))))) (/ l (- 1.0 (* w (- -1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= 42000000.0) {
tmp = l * (1.0 + (w * (-1.0 - (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 <= 42000000.0d0) then
tmp = l * (1.0d0 + (w * ((-1.0d0) - (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 <= 42000000.0) {
tmp = l * (1.0 + (w * (-1.0 - (w * -0.5))));
} else {
tmp = l / (1.0 - (w * (-1.0 - (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 42000000.0: tmp = l * (1.0 + (w * (-1.0 - (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 <= 42000000.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 - 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 <= 42000000.0) tmp = l * (1.0 + (w * (-1.0 - (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, 42000000.0], N[(l * N[(1.0 + N[(w * N[(-1.0 - 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 42000000:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 - 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 < 4.2e7Initial 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-sqrt33.5%
sqrt-unprod82.1%
sqr-neg82.1%
sqrt-unprod48.6%
add-sqr-sqrt80.8%
add-sqr-sqrt80.8%
sqrt-unprod80.8%
add-sqr-sqrt48.6%
sqrt-unprod80.8%
sqr-neg80.8%
sqrt-unprod32.2%
add-sqr-sqrt65.4%
pow165.4%
exp-neg65.4%
inv-pow65.4%
pow-prod-up96.8%
metadata-eval96.8%
metadata-eval96.8%
metadata-eval96.8%
Applied egg-rr96.8%
frac-2neg96.8%
div-inv96.8%
*-rgt-identity96.8%
Applied egg-rr96.8%
Taylor expanded in w around 0 86.8%
if 4.2e7 < 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 69.9%
*-commutative100.0%
Simplified69.9%
Final simplification84.4%
(FPCore (w l) :precision binary64 (if (<= w -490.0) (- l (* w l)) (/ l (- 1.0 (* w (- -1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -490.0) {
tmp = l - (w * 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 <= (-490.0d0)) then
tmp = l - (w * 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 <= -490.0) {
tmp = l - (w * l);
} else {
tmp = l / (1.0 - (w * (-1.0 - (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -490.0: tmp = l - (w * l) else: tmp = l / (1.0 - (w * (-1.0 - (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -490.0) tmp = Float64(l - Float64(w * 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 <= -490.0) tmp = l - (w * l); else tmp = l / (1.0 - (w * (-1.0 - (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -490.0], N[(l - N[(w * l), $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 -490:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 - w \cdot \left(-1 - w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -490Initial 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-unprod49.3%
sqr-neg49.3%
sqrt-unprod49.3%
add-sqr-sqrt49.3%
add-sqr-sqrt49.3%
sqrt-unprod49.3%
add-sqr-sqrt49.3%
sqrt-unprod49.3%
sqr-neg49.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%
frac-2neg100.0%
div-inv100.0%
*-rgt-identity100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 28.1%
mul-1-neg28.1%
unsub-neg28.1%
Simplified28.1%
if -490 < 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%
add-sqr-sqrt58.7%
sqrt-unprod97.7%
sqr-neg97.7%
sqrt-unprod39.0%
add-sqr-sqrt96.1%
add-sqr-sqrt96.1%
sqrt-unprod96.1%
add-sqr-sqrt39.0%
sqrt-unprod76.9%
sqr-neg76.9%
sqrt-unprod37.9%
add-sqr-sqrt77.0%
pow177.0%
exp-neg77.0%
inv-pow77.0%
pow-prod-up96.2%
metadata-eval96.2%
metadata-eval96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Taylor expanded in l around 0 96.2%
Taylor expanded in w around 0 90.5%
*-commutative99.0%
Simplified90.5%
Final simplification73.6%
(FPCore (w l) :precision binary64 (if (<= w -6.0) (- l (* w l)) (/ l (+ 1.0 (* w (* w 0.5))))))
double code(double w, double l) {
double tmp;
if (w <= -6.0) {
tmp = l - (w * l);
} else {
tmp = l / (1.0 + (w * (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 <= (-6.0d0)) then
tmp = l - (w * l)
else
tmp = l / (1.0d0 + (w * (w * 0.5d0)))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -6.0) {
tmp = l - (w * l);
} else {
tmp = l / (1.0 + (w * (w * 0.5)));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -6.0: tmp = l - (w * l) else: tmp = l / (1.0 + (w * (w * 0.5))) return tmp
function code(w, l) tmp = 0.0 if (w <= -6.0) tmp = Float64(l - Float64(w * l)); else tmp = Float64(l / Float64(1.0 + Float64(w * Float64(w * 0.5)))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -6.0) tmp = l - (w * l); else tmp = l / (1.0 + (w * (w * 0.5))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -6.0], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], N[(l / N[(1.0 + N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -6:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -6Initial 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-unprod49.3%
sqr-neg49.3%
sqrt-unprod49.3%
add-sqr-sqrt49.3%
add-sqr-sqrt49.3%
sqrt-unprod49.3%
add-sqr-sqrt49.3%
sqrt-unprod49.3%
sqr-neg49.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%
frac-2neg100.0%
div-inv100.0%
*-rgt-identity100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 28.1%
mul-1-neg28.1%
unsub-neg28.1%
Simplified28.1%
if -6 < 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%
add-sqr-sqrt58.7%
sqrt-unprod97.7%
sqr-neg97.7%
sqrt-unprod39.0%
add-sqr-sqrt96.1%
add-sqr-sqrt96.1%
sqrt-unprod96.1%
add-sqr-sqrt39.0%
sqrt-unprod76.9%
sqr-neg76.9%
sqrt-unprod37.9%
add-sqr-sqrt77.0%
pow177.0%
exp-neg77.0%
inv-pow77.0%
pow-prod-up96.2%
metadata-eval96.2%
metadata-eval96.2%
metadata-eval96.2%
Applied egg-rr96.2%
Taylor expanded in w around 0 90.5%
*-commutative99.0%
Simplified90.5%
Taylor expanded in w around inf 90.5%
*-commutative90.5%
Simplified90.5%
Final simplification73.6%
(FPCore (w l) :precision binary64 (if (<= w -0.038) (* w (- l)) (* l (/ -1.0 (- -1.0 w)))))
double code(double w, double l) {
double tmp;
if (w <= -0.038) {
tmp = w * -l;
} else {
tmp = l * (-1.0 / (-1.0 - w));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.038d0)) then
tmp = w * -l
else
tmp = l * ((-1.0d0) / ((-1.0d0) - w))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.038) {
tmp = w * -l;
} else {
tmp = l * (-1.0 / (-1.0 - w));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.038: tmp = w * -l else: tmp = l * (-1.0 / (-1.0 - w)) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.038) tmp = Float64(w * Float64(-l)); else tmp = Float64(l * Float64(-1.0 / Float64(-1.0 - w))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.038) tmp = w * -l; else tmp = l * (-1.0 / (-1.0 - w)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.038], N[(w * (-l)), $MachinePrecision], N[(l * N[(-1.0 / N[(-1.0 - w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.038:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \frac{-1}{-1 - w}\\
\end{array}
\end{array}
if w < -0.0379999999999999991Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.6%
metadata-eval98.6%
metadata-eval98.6%
metadata-eval98.6%
Applied egg-rr98.6%
frac-2neg98.6%
div-inv98.6%
*-rgt-identity98.6%
Applied egg-rr98.6%
Taylor expanded in w around 0 27.7%
mul-1-neg27.7%
unsub-neg27.7%
Simplified27.7%
Taylor expanded in w around inf 27.7%
mul-1-neg27.7%
*-commutative27.7%
distribute-rgt-neg-in27.7%
Simplified27.7%
if -0.0379999999999999991 < 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%
add-sqr-sqrt59.0%
sqrt-unprod98.2%
sqr-neg98.2%
sqrt-unprod39.2%
add-sqr-sqrt96.6%
add-sqr-sqrt96.6%
sqrt-unprod96.6%
add-sqr-sqrt39.2%
sqrt-unprod77.3%
sqr-neg77.3%
sqrt-unprod38.1%
add-sqr-sqrt77.4%
pow177.4%
exp-neg77.4%
inv-pow77.4%
pow-prod-up96.7%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
Applied egg-rr96.7%
frac-2neg96.7%
div-inv96.7%
*-rgt-identity96.7%
Applied egg-rr96.7%
Taylor expanded in w around 0 86.7%
+-commutative86.7%
Simplified86.7%
Final simplification70.5%
(FPCore (w l) :precision binary64 (if (<= w -0.0072) (* w (- l)) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.0072) {
tmp = 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.0072d0)) then
tmp = 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.0072) {
tmp = w * -l;
} else {
tmp = l / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.0072: tmp = w * -l else: tmp = l / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.0072) tmp = Float64(w * Float64(-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.0072) tmp = w * -l; else tmp = l / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.0072], N[(w * (-l)), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.0072:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -0.0071999999999999998Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
add-sqr-sqrt0.0%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
add-sqr-sqrt48.6%
sqrt-unprod48.6%
sqr-neg48.6%
sqrt-unprod0.0%
add-sqr-sqrt0.1%
pow10.1%
exp-neg0.1%
inv-pow0.1%
pow-prod-up98.6%
metadata-eval98.6%
metadata-eval98.6%
metadata-eval98.6%
Applied egg-rr98.6%
frac-2neg98.6%
div-inv98.6%
*-rgt-identity98.6%
Applied egg-rr98.6%
Taylor expanded in w around 0 27.7%
mul-1-neg27.7%
unsub-neg27.7%
Simplified27.7%
Taylor expanded in w around inf 27.7%
mul-1-neg27.7%
*-commutative27.7%
distribute-rgt-neg-in27.7%
Simplified27.7%
if -0.0071999999999999998 < 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%
add-sqr-sqrt59.0%
sqrt-unprod98.2%
sqr-neg98.2%
sqrt-unprod39.2%
add-sqr-sqrt96.6%
add-sqr-sqrt96.6%
sqrt-unprod96.6%
add-sqr-sqrt39.2%
sqrt-unprod77.3%
sqr-neg77.3%
sqrt-unprod38.1%
add-sqr-sqrt77.4%
pow177.4%
exp-neg77.4%
inv-pow77.4%
pow-prod-up96.7%
metadata-eval96.7%
metadata-eval96.7%
metadata-eval96.7%
Applied egg-rr96.7%
Taylor expanded in l around 0 96.7%
Taylor expanded in w around 0 86.7%
+-commutative86.7%
Simplified86.7%
(FPCore (w l) :precision binary64 (if (<= w -430.0) (* w (- l)) l))
double code(double w, double l) {
double tmp;
if (w <= -430.0) {
tmp = w * -l;
} else {
tmp = l;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-430.0d0)) then
tmp = w * -l
else
tmp = l
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -430.0) {
tmp = w * -l;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -430.0: tmp = w * -l else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (w <= -430.0) tmp = Float64(w * Float64(-l)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -430.0) tmp = w * -l; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -430.0], N[(w * (-l)), $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -430:\\
\;\;\;\;w \cdot \left(-\ell\right)\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -430Initial 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-unprod49.3%
sqr-neg49.3%
sqrt-unprod49.3%
add-sqr-sqrt49.3%
add-sqr-sqrt49.3%
sqrt-unprod49.3%
add-sqr-sqrt49.3%
sqrt-unprod49.3%
sqr-neg49.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%
frac-2neg100.0%
div-inv100.0%
*-rgt-identity100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 28.1%
mul-1-neg28.1%
unsub-neg28.1%
Simplified28.1%
Taylor expanded in w around inf 28.1%
mul-1-neg28.1%
*-commutative28.1%
distribute-rgt-neg-in28.1%
Simplified28.1%
if -430 < w Initial program 99.1%
Taylor expanded in w around 0 77.9%
(FPCore (w l) :precision binary64 (- l (* w l)))
double code(double w, double l) {
return l - (w * l);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l - (w * l)
end function
public static double code(double w, double l) {
return l - (w * l);
}
def code(w, l): return l - (w * l)
function code(w, l) return Float64(l - Float64(w * l)) end
function tmp = code(w, l) tmp = l - (w * l); end
code[w_, l_] := N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell - w \cdot \ell
\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-sqrt42.9%
sqrt-unprod84.6%
sqr-neg84.6%
sqrt-unprod41.8%
add-sqr-sqrt83.5%
add-sqr-sqrt83.5%
sqrt-unprod83.5%
add-sqr-sqrt41.8%
sqrt-unprod69.5%
sqr-neg69.5%
sqrt-unprod27.7%
add-sqr-sqrt56.2%
pow156.2%
exp-neg56.2%
inv-pow56.2%
pow-prod-up97.2%
metadata-eval97.2%
metadata-eval97.2%
metadata-eval97.2%
Applied egg-rr97.2%
frac-2neg97.2%
div-inv97.2%
*-rgt-identity97.2%
Applied egg-rr97.2%
Taylor expanded in w around 0 64.2%
mul-1-neg64.2%
unsub-neg64.2%
Simplified64.2%
Final simplification64.2%
(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 57.9%
herbie shell --seed 2024151
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))