
(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 12 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%
Final simplification99.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%
Final simplification99.3%
(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%
Taylor expanded in w around 0 96.8%
Final simplification96.8%
(FPCore (w l)
:precision binary64
(if (<= w 0.75)
(- l (* w (+ l (* w (+ (* w (* l 1.1666666666666667)) (- (* l 0.5) l))))))
(/
-1.0
(+
(/ -1.0 l)
(*
w
(+
(/ -1.0 l)
(* w (- (* 0.5 (/ -1.0 l)) (* 0.16666666666666666 (/ w l))))))))))
double code(double w, double l) {
double tmp;
if (w <= 0.75) {
tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667)) + ((l * 0.5) - l)))));
} else {
tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) + (w * ((0.5 * (-1.0 / l)) - (0.16666666666666666 * (w / 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 = l - (w * (l + (w * ((w * (l * 1.1666666666666667d0)) + ((l * 0.5d0) - l)))))
else
tmp = (-1.0d0) / (((-1.0d0) / l) + (w * (((-1.0d0) / l) + (w * ((0.5d0 * ((-1.0d0) / l)) - (0.16666666666666666d0 * (w / l)))))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.75) {
tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667)) + ((l * 0.5) - l)))));
} else {
tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) + (w * ((0.5 * (-1.0 / l)) - (0.16666666666666666 * (w / l)))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.75: tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667)) + ((l * 0.5) - l))))) else: tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) + (w * ((0.5 * (-1.0 / l)) - (0.16666666666666666 * (w / l))))))) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.75) tmp = Float64(l - Float64(w * Float64(l + Float64(w * Float64(Float64(w * Float64(l * 1.1666666666666667)) + Float64(Float64(l * 0.5) - l)))))); else tmp = Float64(-1.0 / Float64(Float64(-1.0 / l) + Float64(w * Float64(Float64(-1.0 / l) + Float64(w * Float64(Float64(0.5 * Float64(-1.0 / l)) - Float64(0.16666666666666666 * Float64(w / l)))))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.75) tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667)) + ((l * 0.5) - l))))); else tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) + (w * ((0.5 * (-1.0 / l)) - (0.16666666666666666 * (w / l))))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.75], N[(l - N[(w * N[(l + N[(w * N[(N[(w * N[(l * 1.1666666666666667), $MachinePrecision]), $MachinePrecision] + N[(N[(l * 0.5), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(-1.0 / l), $MachinePrecision] + N[(w * N[(N[(-1.0 / l), $MachinePrecision] + N[(w * N[(N[(0.5 * N[(-1.0 / l), $MachinePrecision]), $MachinePrecision] - N[(0.16666666666666666 * N[(w / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.75:\\
\;\;\;\;\ell - w \cdot \left(\ell + w \cdot \left(w \cdot \left(\ell \cdot 1.1666666666666667\right) + \left(\ell \cdot 0.5 - \ell\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{\ell} + w \cdot \left(\frac{-1}{\ell} + w \cdot \left(0.5 \cdot \frac{-1}{\ell} - 0.16666666666666666 \cdot \frac{w}{\ell}\right)\right)}\\
\end{array}
\end{array}
if w < 0.75Initial program 99.6%
exp-neg99.6%
remove-double-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in w around 0 98.1%
Taylor expanded in w around 0 88.1%
associate-+r+88.1%
distribute-lft-in88.1%
Applied egg-rr88.1%
distribute-lft-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
distribute-lft-out88.1%
metadata-eval88.1%
Simplified88.1%
if 0.75 < w Initial program 96.8%
*-un-lft-identity96.8%
metadata-eval96.8%
metadata-eval96.8%
metadata-eval96.8%
pow-prod-up9.7%
pow19.7%
add-sqr-sqrt9.7%
sqrt-unprod9.7%
sqr-neg9.7%
sqrt-unprod0.0%
add-sqr-sqrt96.8%
pow196.8%
inv-pow96.8%
exp-neg96.8%
pow196.8%
sqrt-unprod96.8%
add-sqr-sqrt96.8%
exp-neg96.8%
associate-/r/96.8%
Applied egg-rr87.7%
div-inv87.7%
exp-neg87.7%
associate-/l/87.7%
Applied egg-rr87.7%
Taylor expanded in w around 0 72.9%
Final simplification86.3%
(FPCore (w l) :precision binary64 (if (<= w 0.68) (- l (* w (+ l (* w (+ (* w (* l 1.1666666666666667)) (- (* l 0.5) l)))))) (/ -1.0 (+ (/ -1.0 l) (* w (- (/ -1.0 l) (* 0.5 (/ w l))))))))
double code(double w, double l) {
double tmp;
if (w <= 0.68) {
tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667)) + ((l * 0.5) - l)))));
} else {
tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / 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.68d0) then
tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667d0)) + ((l * 0.5d0) - l)))))
else
tmp = (-1.0d0) / (((-1.0d0) / l) + (w * (((-1.0d0) / l) - (0.5d0 * (w / l)))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.68) {
tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667)) + ((l * 0.5) - l)))));
} else {
tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l)))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.68: tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667)) + ((l * 0.5) - l))))) else: tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l))))) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.68) tmp = Float64(l - Float64(w * Float64(l + Float64(w * Float64(Float64(w * Float64(l * 1.1666666666666667)) + Float64(Float64(l * 0.5) - l)))))); else tmp = Float64(-1.0 / Float64(Float64(-1.0 / l) + Float64(w * Float64(Float64(-1.0 / l) - Float64(0.5 * Float64(w / l)))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.68) tmp = l - (w * (l + (w * ((w * (l * 1.1666666666666667)) + ((l * 0.5) - l))))); else tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.68], N[(l - N[(w * N[(l + N[(w * N[(N[(w * N[(l * 1.1666666666666667), $MachinePrecision]), $MachinePrecision] + N[(N[(l * 0.5), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(-1.0 / l), $MachinePrecision] + N[(w * N[(N[(-1.0 / l), $MachinePrecision] - N[(0.5 * N[(w / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.68:\\
\;\;\;\;\ell - w \cdot \left(\ell + w \cdot \left(w \cdot \left(\ell \cdot 1.1666666666666667\right) + \left(\ell \cdot 0.5 - \ell\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{\ell} + w \cdot \left(\frac{-1}{\ell} - 0.5 \cdot \frac{w}{\ell}\right)}\\
\end{array}
\end{array}
if w < 0.680000000000000049Initial program 99.6%
exp-neg99.6%
remove-double-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
remove-double-neg99.6%
Simplified99.6%
Taylor expanded in w around 0 98.1%
Taylor expanded in w around 0 88.1%
associate-+r+88.1%
distribute-lft-in88.1%
Applied egg-rr88.1%
distribute-lft-out88.1%
distribute-lft-out88.1%
metadata-eval88.1%
distribute-lft-out88.1%
metadata-eval88.1%
Simplified88.1%
if 0.680000000000000049 < w Initial program 96.8%
*-un-lft-identity96.8%
metadata-eval96.8%
metadata-eval96.8%
metadata-eval96.8%
pow-prod-up9.7%
pow19.7%
add-sqr-sqrt9.7%
sqrt-unprod9.7%
sqr-neg9.7%
sqrt-unprod0.0%
add-sqr-sqrt96.8%
pow196.8%
inv-pow96.8%
exp-neg96.8%
pow196.8%
sqrt-unprod96.8%
add-sqr-sqrt96.8%
exp-neg96.8%
associate-/r/96.8%
Applied egg-rr87.7%
div-inv87.7%
exp-neg87.7%
associate-/l/87.7%
Applied egg-rr87.7%
Taylor expanded in w around 0 66.7%
Final simplification85.5%
(FPCore (w l) :precision binary64 (if (<= w 250000.0) (* l (+ 1.0 (* w (+ -1.0 (* w 0.5))))) (/ -1.0 (+ (/ -1.0 l) (* w (- (/ -1.0 l) (* 0.5 (/ w l))))))))
double code(double w, double l) {
double tmp;
if (w <= 250000.0) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} else {
tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l)))));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 250000.0d0) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * 0.5d0))))
else
tmp = (-1.0d0) / (((-1.0d0) / l) + (w * (((-1.0d0) / l) - (0.5d0 * (w / l)))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 250000.0) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} else {
tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l)))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 250000.0: tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))) else: tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l))))) return tmp
function code(w, l) tmp = 0.0 if (w <= 250000.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * 0.5))))); else tmp = Float64(-1.0 / Float64(Float64(-1.0 / l) + Float64(w * Float64(Float64(-1.0 / l) - Float64(0.5 * Float64(w / l)))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 250000.0) tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))); else tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 250000.0], N[(l * N[(1.0 + N[(w * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(-1.0 / l), $MachinePrecision] + N[(w * N[(N[(-1.0 / l), $MachinePrecision] - N[(0.5 * N[(w / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 250000:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{\ell} + w \cdot \left(\frac{-1}{\ell} - 0.5 \cdot \frac{w}{\ell}\right)}\\
\end{array}
\end{array}
if w < 2.5e5Initial 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 96.5%
Taylor expanded in w around 0 81.2%
associate-*r*81.2%
neg-mul-181.2%
distribute-rgt-out81.2%
metadata-eval81.2%
Simplified81.2%
Taylor expanded in l around 0 85.7%
if 2.5e5 < w Initial program 100.0%
*-un-lft-identity100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
pow-prod-up0.0%
pow10.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
pow1100.0%
inv-pow100.0%
exp-neg100.0%
pow1100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
exp-neg100.0%
associate-/r/100.0%
Applied egg-rr100.0%
div-inv100.0%
exp-neg100.0%
associate-/l/100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 75.7%
Final simplification84.7%
(FPCore (w l) :precision binary64 (if (<= w 0.65) (+ l (* w (- (* w (+ (* l 0.5) (* -0.16666666666666666 (* w l)))) l))) (/ -1.0 (+ (/ -1.0 l) (* w (- (/ -1.0 l) (* 0.5 (/ w l))))))))
double code(double w, double l) {
double tmp;
if (w <= 0.65) {
tmp = l + (w * ((w * ((l * 0.5) + (-0.16666666666666666 * (w * l)))) - l));
} else {
tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / 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.65d0) then
tmp = l + (w * ((w * ((l * 0.5d0) + ((-0.16666666666666666d0) * (w * l)))) - l))
else
tmp = (-1.0d0) / (((-1.0d0) / l) + (w * (((-1.0d0) / l) - (0.5d0 * (w / l)))))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.65) {
tmp = l + (w * ((w * ((l * 0.5) + (-0.16666666666666666 * (w * l)))) - l));
} else {
tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l)))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.65: tmp = l + (w * ((w * ((l * 0.5) + (-0.16666666666666666 * (w * l)))) - l)) else: tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l))))) return tmp
function code(w, l) tmp = 0.0 if (w <= 0.65) tmp = Float64(l + Float64(w * Float64(Float64(w * Float64(Float64(l * 0.5) + Float64(-0.16666666666666666 * Float64(w * l)))) - l))); else tmp = Float64(-1.0 / Float64(Float64(-1.0 / l) + Float64(w * Float64(Float64(-1.0 / l) - Float64(0.5 * Float64(w / l)))))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.65) tmp = l + (w * ((w * ((l * 0.5) + (-0.16666666666666666 * (w * l)))) - l)); else tmp = -1.0 / ((-1.0 / l) + (w * ((-1.0 / l) - (0.5 * (w / l))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.65], N[(l + N[(w * N[(N[(w * N[(N[(l * 0.5), $MachinePrecision] + N[(-0.16666666666666666 * N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(-1.0 / l), $MachinePrecision] + N[(w * N[(N[(-1.0 / l), $MachinePrecision] - N[(0.5 * N[(w / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.65:\\
\;\;\;\;\ell + w \cdot \left(w \cdot \left(\ell \cdot 0.5 + -0.16666666666666666 \cdot \left(w \cdot \ell\right)\right) - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{\ell} + w \cdot \left(\frac{-1}{\ell} - 0.5 \cdot \frac{w}{\ell}\right)}\\
\end{array}
\end{array}
if w < 0.650000000000000022Initial program 99.6%
*-un-lft-identity99.6%
metadata-eval99.6%
metadata-eval99.6%
metadata-eval99.6%
pow-prod-up70.7%
pow170.7%
add-sqr-sqrt34.9%
sqrt-unprod99.4%
sqr-neg99.4%
sqrt-unprod64.5%
add-sqr-sqrt98.5%
pow198.5%
inv-pow98.5%
exp-neg98.5%
pow198.5%
sqrt-unprod98.5%
add-sqr-sqrt98.5%
exp-neg98.5%
associate-/r/98.3%
Applied egg-rr97.9%
Taylor expanded in w around 0 88.1%
if 0.650000000000000022 < w Initial program 96.8%
*-un-lft-identity96.8%
metadata-eval96.8%
metadata-eval96.8%
metadata-eval96.8%
pow-prod-up9.7%
pow19.7%
add-sqr-sqrt9.7%
sqrt-unprod9.7%
sqr-neg9.7%
sqrt-unprod0.0%
add-sqr-sqrt96.8%
pow196.8%
inv-pow96.8%
exp-neg96.8%
pow196.8%
sqrt-unprod96.8%
add-sqr-sqrt96.8%
exp-neg96.8%
associate-/r/96.8%
Applied egg-rr87.7%
div-inv87.7%
exp-neg87.7%
associate-/l/87.7%
Applied egg-rr87.7%
Taylor expanded in w around 0 66.7%
Final simplification85.5%
(FPCore (w l) :precision binary64 (if (<= w 360000.0) (* l (+ 1.0 (* w (+ -1.0 (* w 0.5))))) (/ -1.0 (- (/ -1.0 l) (/ w l)))))
double code(double w, double l) {
double tmp;
if (w <= 360000.0) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} else {
tmp = -1.0 / ((-1.0 / l) - (w / l));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 360000.0d0) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * 0.5d0))))
else
tmp = (-1.0d0) / (((-1.0d0) / l) - (w / l))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 360000.0) {
tmp = l * (1.0 + (w * (-1.0 + (w * 0.5))));
} else {
tmp = -1.0 / ((-1.0 / l) - (w / l));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 360000.0: tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))) else: tmp = -1.0 / ((-1.0 / l) - (w / l)) return tmp
function code(w, l) tmp = 0.0 if (w <= 360000.0) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * 0.5))))); else tmp = Float64(-1.0 / Float64(Float64(-1.0 / l) - Float64(w / l))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 360000.0) tmp = l * (1.0 + (w * (-1.0 + (w * 0.5)))); else tmp = -1.0 / ((-1.0 / l) - (w / l)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 360000.0], N[(l * N[(1.0 + N[(w * N[(-1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(-1.0 / l), $MachinePrecision] - N[(w / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 360000:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{\ell} - \frac{w}{\ell}}\\
\end{array}
\end{array}
if w < 3.6e5Initial 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 96.5%
Taylor expanded in w around 0 81.2%
associate-*r*81.2%
neg-mul-181.2%
distribute-rgt-out81.2%
metadata-eval81.2%
Simplified81.2%
Taylor expanded in l around 0 85.7%
if 3.6e5 < w Initial program 100.0%
*-un-lft-identity100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
pow-prod-up0.0%
pow10.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
pow1100.0%
inv-pow100.0%
exp-neg100.0%
pow1100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
exp-neg100.0%
associate-/r/100.0%
Applied egg-rr100.0%
div-inv100.0%
exp-neg100.0%
associate-/l/100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 51.8%
Final simplification82.2%
(FPCore (w l) :precision binary64 (if (<= w 20500000.0) (+ l (* w (* 0.5 (* w l)))) (/ -1.0 (- (/ -1.0 l) (/ w l)))))
double code(double w, double l) {
double tmp;
if (w <= 20500000.0) {
tmp = l + (w * (0.5 * (w * l)));
} else {
tmp = -1.0 / ((-1.0 / l) - (w / l));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 20500000.0d0) then
tmp = l + (w * (0.5d0 * (w * l)))
else
tmp = (-1.0d0) / (((-1.0d0) / l) - (w / l))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 20500000.0) {
tmp = l + (w * (0.5 * (w * l)));
} else {
tmp = -1.0 / ((-1.0 / l) - (w / l));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 20500000.0: tmp = l + (w * (0.5 * (w * l))) else: tmp = -1.0 / ((-1.0 / l) - (w / l)) return tmp
function code(w, l) tmp = 0.0 if (w <= 20500000.0) tmp = Float64(l + Float64(w * Float64(0.5 * Float64(w * l)))); else tmp = Float64(-1.0 / Float64(Float64(-1.0 / l) - Float64(w / l))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 20500000.0) tmp = l + (w * (0.5 * (w * l))); else tmp = -1.0 / ((-1.0 / l) - (w / l)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 20500000.0], N[(l + N[(w * N[(0.5 * N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 / N[(N[(-1.0 / l), $MachinePrecision] - N[(w / l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 20500000:\\
\;\;\;\;\ell + w \cdot \left(0.5 \cdot \left(w \cdot \ell\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{\frac{-1}{\ell} - \frac{w}{\ell}}\\
\end{array}
\end{array}
if w < 2.05e7Initial 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 96.5%
Taylor expanded in w around 0 81.2%
associate-*r*81.2%
neg-mul-181.2%
distribute-rgt-out81.2%
metadata-eval81.2%
Simplified81.2%
Taylor expanded in w around inf 81.2%
if 2.05e7 < w Initial program 100.0%
*-un-lft-identity100.0%
metadata-eval100.0%
metadata-eval100.0%
metadata-eval100.0%
pow-prod-up0.0%
pow10.0%
add-sqr-sqrt0.0%
sqrt-unprod0.0%
sqr-neg0.0%
sqrt-unprod0.0%
add-sqr-sqrt100.0%
pow1100.0%
inv-pow100.0%
exp-neg100.0%
pow1100.0%
sqrt-unprod100.0%
add-sqr-sqrt100.0%
exp-neg100.0%
associate-/r/100.0%
Applied egg-rr100.0%
div-inv100.0%
exp-neg100.0%
associate-/l/100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 51.8%
Final simplification78.1%
(FPCore (w l) :precision binary64 (+ l (* w (* 0.5 (* w l)))))
double code(double w, double l) {
return l + (w * (0.5 * (w * l)));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l + (w * (0.5d0 * (w * l)))
end function
public static double code(double w, double l) {
return l + (w * (0.5 * (w * l)));
}
def code(w, l): return l + (w * (0.5 * (w * l)))
function code(w, l) return Float64(l + Float64(w * Float64(0.5 * Float64(w * l)))) end
function tmp = code(w, l) tmp = l + (w * (0.5 * (w * l))); end
code[w_, l_] := N[(l + N[(w * N[(0.5 * N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\ell + w \cdot \left(0.5 \cdot \left(w \cdot \ell\right)\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%
Taylor expanded in w around 0 96.8%
Taylor expanded in w around 0 72.9%
associate-*r*72.9%
neg-mul-172.9%
distribute-rgt-out72.9%
metadata-eval72.9%
Simplified72.9%
Taylor expanded in w around inf 72.9%
Final simplification72.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%
Taylor expanded in w around 0 96.8%
Taylor expanded in w around 0 69.1%
mul-1-neg69.1%
unsub-neg69.1%
Simplified69.1%
Final simplification69.1%
(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%
exp-neg99.3%
remove-double-neg99.3%
associate-*l/99.3%
*-lft-identity99.3%
remove-double-neg99.3%
Simplified99.3%
Taylor expanded in w around 0 96.8%
Taylor expanded in w around 0 62.5%
Final simplification62.5%
herbie shell --seed 2024079
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))