
(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 21 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 (+ 1.0 (/ 1.0 w)))) E)))
double code(double w, double l) {
return pow(l, exp(w)) / (exp((w * (1.0 + (1.0 / w)))) / ((double) M_E));
}
public static double code(double w, double l) {
return Math.pow(l, Math.exp(w)) / (Math.exp((w * (1.0 + (1.0 / w)))) / Math.E);
}
def code(w, l): return math.pow(l, math.exp(w)) / (math.exp((w * (1.0 + (1.0 / w)))) / math.e)
function code(w, l) return Float64((l ^ exp(w)) / Float64(exp(Float64(w * Float64(1.0 + Float64(1.0 / w)))) / exp(1))) end
function tmp = code(w, l) tmp = (l ^ exp(w)) / (exp((w * (1.0 + (1.0 / w)))) / 2.71828182845904523536); end
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(N[Exp[N[(w * N[(1.0 + N[(1.0 / w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\ell}^{\left(e^{w}\right)}}{\frac{e^{w \cdot \left(1 + \frac{1}{w}\right)}}{e}}
\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%
expm1-log1p-u75.7%
expm1-undefine75.7%
exp-diff75.7%
log1p-undefine75.7%
rem-exp-log99.6%
exp-1-e99.6%
Applied egg-rr99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in w around inf 99.6%
(FPCore (w l) :precision binary64 (/ (pow l (exp w)) (/ (exp (+ w 1.0)) E)))
double code(double w, double l) {
return pow(l, exp(w)) / (exp((w + 1.0)) / ((double) M_E));
}
public static double code(double w, double l) {
return Math.pow(l, Math.exp(w)) / (Math.exp((w + 1.0)) / Math.E);
}
def code(w, l): return math.pow(l, math.exp(w)) / (math.exp((w + 1.0)) / math.e)
function code(w, l) return Float64((l ^ exp(w)) / Float64(exp(Float64(w + 1.0)) / exp(1))) end
function tmp = code(w, l) tmp = (l ^ exp(w)) / (exp((w + 1.0)) / 2.71828182845904523536); end
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(N[Exp[N[(w + 1.0), $MachinePrecision]], $MachinePrecision] / E), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\ell}^{\left(e^{w}\right)}}{\frac{e^{w + 1}}{e}}
\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%
expm1-log1p-u75.7%
expm1-undefine75.7%
exp-diff75.7%
log1p-undefine75.7%
rem-exp-log99.6%
exp-1-e99.6%
Applied egg-rr99.6%
+-commutative99.6%
Simplified99.6%
(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)
(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 = 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 = 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 = 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 = 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 = exp(Float64(-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 = 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[Exp[(-w)], $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:\\
\;\;\;\;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%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
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 98.7%
*-commutative98.7%
Simplified98.7%
(FPCore (w l) :precision binary64 (if (<= w -4.1) (exp (- w)) (/ (pow l (+ 1.0 (expm1 w))) (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -4.1) {
tmp = exp(-w);
} else {
tmp = pow(l, (1.0 + expm1(w))) / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
public static double code(double w, double l) {
double tmp;
if (w <= -4.1) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, (1.0 + Math.expm1(w))) / (1.0 + (w * (1.0 + (w * 0.5))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -4.1: tmp = math.exp(-w) else: tmp = math.pow(l, (1.0 + math.expm1(w))) / (1.0 + (w * (1.0 + (w * 0.5)))) return tmp
function code(w, l) tmp = 0.0 if (w <= -4.1) tmp = exp(Float64(-w)); else tmp = Float64((l ^ Float64(1.0 + expm1(w))) / Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))); end return tmp end
code[w_, l_] := If[LessEqual[w, -4.1], N[Exp[(-w)], $MachinePrecision], N[(N[Power[l, N[(1.0 + N[(Exp[w] - 1), $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 -4.1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + \mathsf{expm1}\left(w\right)\right)}}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -4.0999999999999996Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -4.0999999999999996 < 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.4%
*-commutative98.4%
Simplified98.4%
pow198.4%
pow-to-exp98.4%
add-log-exp98.4%
log1p-expm1-u98.4%
log1p-undefine98.4%
exp-to-pow98.4%
pow198.4%
Applied egg-rr98.4%
(FPCore (w l) :precision binary64 (if (<= w -3.8) (exp (- w)) (/ (pow l (exp w)) (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -3.8) {
tmp = 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 <= (-3.8d0)) then
tmp = 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 <= -3.8) {
tmp = 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 <= -3.8: tmp = 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 <= -3.8) tmp = exp(Float64(-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 <= -3.8) tmp = 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, -3.8], N[Exp[(-w)], $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 -3.8:\\
\;\;\;\;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 < -3.7999999999999998Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -3.7999999999999998 < 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.4%
*-commutative98.4%
Simplified98.4%
(FPCore (w l) :precision binary64 (let* ((t_0 (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))) (if (<= w -1.6) (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 = 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 = 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 = 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 = 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 = exp(Float64(-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 = 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[Exp[(-w)], $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:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\
\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%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
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 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in w around 0 98.4%
*-commutative98.7%
Simplified98.4%
(FPCore (w l)
:precision binary64
(if (<= w -1.6)
(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 <= -1.6) {
tmp = 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 <= (-1.6d0)) then
tmp = 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 <= -1.6) {
tmp = 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 <= -1.6: tmp = 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 <= -1.6) tmp = exp(Float64(-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 <= -1.6) tmp = 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, -1.6], N[Exp[(-w)], $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 -1.6:\\
\;\;\;\;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 < -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%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
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 98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in w around 0 98.3%
*-commutative98.7%
Simplified98.3%
(FPCore (w l) :precision binary64 (let* ((t_0 (+ 1.0 (* w (+ 1.0 (* w 0.5)))))) (if (<= w -1.3) (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 <= -1.3) {
tmp = 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 <= (-1.3d0)) then
tmp = 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 <= -1.3) {
tmp = 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 <= -1.3: tmp = 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 <= -1.3) tmp = exp(Float64(-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 <= -1.3) tmp = 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, -1.3], N[Exp[(-w)], $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 -1.3:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{t\_0}}{t\_0}\\
\end{array}
\end{array}
if w < -1.30000000000000004Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1.30000000000000004 < 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.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in w around 0 98.0%
*-commutative98.4%
Simplified98.0%
(FPCore (w l)
:precision binary64
(if (<= w -1.0)
(exp (- w))
(/
(pow l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))
(+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = exp(-w);
} else {
tmp = pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (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 = exp(-w)
else
tmp = (l ** (1.0d0 + (w * (1.0d0 + (w * (0.5d0 + (w * 0.16666666666666666d0))))))) / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = math.exp(-w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = exp(Float64(-w)); else tmp = Float64((l ^ Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * Float64(0.5 + Float64(w * 0.16666666666666666))))))) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = exp(-w); else tmp = (l ^ (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666))))))) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[Exp[(-w)], $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[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1 < 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.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in w around 0 98.0%
*-commutative98.7%
Simplified98.0%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (exp (- w)) (/ (pow l (+ 1.0 (* w (+ 1.0 (* w 0.5))))) (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = exp(-w);
} else {
tmp = pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (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 = exp(-w)
else
tmp = (l ** (1.0d0 + (w * (1.0d0 + (w * 0.5d0))))) / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = math.exp(-w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = exp(Float64(-w)); else tmp = Float64((l ^ Float64(1.0 + Float64(w * Float64(1.0 + Float64(w * 0.5))))) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = exp(-w); else tmp = (l ^ (1.0 + (w * (1.0 + (w * 0.5))))) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[Exp[(-w)], $MachinePrecision], N[(N[Power[l, N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1 < 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.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in w around 0 98.0%
*-commutative98.4%
Simplified98.0%
(FPCore (w l) :precision binary64 (if (<= w -0.68) (exp (- w)) (if (<= w 0.0115) l (/ (pow l (+ w 1.0)) w))))
double code(double w, double l) {
double tmp;
if (w <= -0.68) {
tmp = exp(-w);
} else if (w <= 0.0115) {
tmp = l;
} else {
tmp = pow(l, (w + 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.68d0)) then
tmp = exp(-w)
else if (w <= 0.0115d0) then
tmp = l
else
tmp = (l ** (w + 1.0d0)) / w
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.68) {
tmp = Math.exp(-w);
} else if (w <= 0.0115) {
tmp = l;
} else {
tmp = Math.pow(l, (w + 1.0)) / w;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.68: tmp = math.exp(-w) elif w <= 0.0115: tmp = l else: tmp = math.pow(l, (w + 1.0)) / w return tmp
function code(w, l) tmp = 0.0 if (w <= -0.68) tmp = exp(Float64(-w)); elseif (w <= 0.0115) tmp = l; else tmp = Float64((l ^ Float64(w + 1.0)) / w); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.68) tmp = exp(-w); elseif (w <= 0.0115) tmp = l; else tmp = (l ^ (w + 1.0)) / w; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.68], N[Exp[(-w)], $MachinePrecision], If[LessEqual[w, 0.0115], l, N[(N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision] / w), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.68:\\
\;\;\;\;e^{-w}\\
\mathbf{elif}\;w \leq 0.0115:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(w + 1\right)}}{w}\\
\end{array}
\end{array}
if w < -0.680000000000000049Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -0.680000000000000049 < w < 0.0115Initial 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 95.5%
if 0.0115 < 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%
Taylor expanded in w around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in w around 0 100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
exp-to-pow100.0%
+-commutative100.0%
Simplified100.0%
(FPCore (w l) :precision binary64 (if (<= w -0.98) (exp (- w)) (* (pow l w) (/ l (+ w 1.0)))))
double code(double w, double l) {
double tmp;
if (w <= -0.98) {
tmp = exp(-w);
} else {
tmp = pow(l, w) * (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.98d0)) then
tmp = exp(-w)
else
tmp = (l ** w) * (l / (w + 1.0d0))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.98) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, w) * (l / (w + 1.0));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.98: tmp = math.exp(-w) else: tmp = math.pow(l, w) * (l / (w + 1.0)) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.98) tmp = exp(Float64(-w)); else tmp = Float64((l ^ w) * Float64(l / Float64(w + 1.0))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.98) tmp = exp(-w); else tmp = (l ^ w) * (l / (w + 1.0)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.98], N[Exp[(-w)], $MachinePrecision], N[(N[Power[l, w], $MachinePrecision] * N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.98:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{w} \cdot \frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -0.97999999999999998Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -0.97999999999999998 < 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.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in w around 0 97.6%
+-commutative98.1%
Simplified97.6%
pow-plus97.8%
*-un-lft-identity97.8%
times-frac97.8%
Applied egg-rr97.8%
Final simplification98.3%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (exp (- w)) (/ (* l (pow l w)) (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = exp(-w);
} else {
tmp = (l * pow(l, w)) / (w + 1.0);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.0d0)) then
tmp = exp(-w)
else
tmp = (l * (l ** w)) / (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = Math.exp(-w);
} else {
tmp = (l * Math.pow(l, w)) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = math.exp(-w) else: tmp = (l * math.pow(l, w)) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = exp(Float64(-w)); else tmp = Float64(Float64(l * (l ^ w)) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = exp(-w); else tmp = (l * (l ^ w)) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[Exp[(-w)], $MachinePrecision], N[(N[(l * N[Power[l, w], $MachinePrecision]), $MachinePrecision] / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell \cdot {\ell}^{w}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -1 < 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.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in w around 0 97.6%
+-commutative98.1%
Simplified97.6%
pow-plus97.8%
Applied egg-rr97.8%
Final simplification98.3%
(FPCore (w l) :precision binary64 (if (or (<= w -0.68) (not (<= w 560.0))) (exp (- w)) l))
double code(double w, double l) {
double tmp;
if ((w <= -0.68) || !(w <= 560.0)) {
tmp = exp(-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 <= (-0.68d0)) .or. (.not. (w <= 560.0d0))) then
tmp = exp(-w)
else
tmp = l
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if ((w <= -0.68) || !(w <= 560.0)) {
tmp = Math.exp(-w);
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if (w <= -0.68) or not (w <= 560.0): tmp = math.exp(-w) else: tmp = l return tmp
function code(w, l) tmp = 0.0 if ((w <= -0.68) || !(w <= 560.0)) tmp = exp(Float64(-w)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((w <= -0.68) || ~((w <= 560.0))) tmp = exp(-w); else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[Or[LessEqual[w, -0.68], N[Not[LessEqual[w, 560.0]], $MachinePrecision]], N[Exp[(-w)], $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.68 \lor \neg \left(w \leq 560\right):\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -0.680000000000000049 or 560 < 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%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
if -0.680000000000000049 < w < 560Initial 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 95.0%
Final simplification96.9%
(FPCore (w l) :precision binary64 (if (<= w -2.9e+20) (+ 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 <= -2.9e+20) {
tmp = 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 <= (-2.9d+20)) then
tmp = 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 <= -2.9e+20) {
tmp = 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 <= -2.9e+20: tmp = 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 <= -2.9e+20) tmp = 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 <= -2.9e+20) tmp = 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, -2.9e+20], N[(1.0 + N[(w * N[(N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -2.9 \cdot 10^{+20}:\\
\;\;\;\;1 + w \cdot \left(w \cdot \left(0.5 + w \cdot -0.16666666666666666\right) + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -2.9e20Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in w around 0 76.7%
if -2.9e20 < w Initial 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 96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in w around 0 95.9%
*-commutative96.2%
Simplified95.9%
Taylor expanded in w around 0 87.1%
Final simplification84.8%
(FPCore (w l) :precision binary64 (if (<= w -1.8e+20) (+ 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 <= -1.8e+20) {
tmp = 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 <= (-1.8d+20)) then
tmp = 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 <= -1.8e+20) {
tmp = 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 <= -1.8e+20: tmp = 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 <= -1.8e+20) tmp = 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 <= -1.8e+20) tmp = 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, -1.8e+20], N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $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 -1.8 \cdot 10^{+20}:\\
\;\;\;\;1 + w \cdot \left(w \cdot 0.5 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -1.8e20Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in w around 0 51.2%
if -1.8e20 < w Initial 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 96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in w around 0 95.9%
*-commutative96.2%
Simplified95.9%
Taylor expanded in w around 0 87.1%
Final simplification79.3%
(FPCore (w l) :precision binary64 (if (<= w -0.68) (+ 1.0 (* w (+ (* w 0.5) -1.0))) (/ l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.68) {
tmp = 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.68d0)) then
tmp = 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.68) {
tmp = 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.68: tmp = 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.68) tmp = 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.68) tmp = 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.68], N[(1.0 + N[(w * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.68:\\
\;\;\;\;1 + w \cdot \left(w \cdot 0.5 + -1\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\end{array}
\end{array}
if w < -0.680000000000000049Initial program 100.0%
exp-neg100.0%
remove-double-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
remove-double-neg100.0%
Simplified100.0%
Taylor expanded in l around inf 100.0%
mul-1-neg100.0%
distribute-rgt-neg-in100.0%
log-rec100.0%
remove-double-neg100.0%
+-rgt-identity100.0%
exp-diff100.0%
+-rgt-identity100.0%
remove-double-neg100.0%
distribute-lft-neg-in100.0%
distribute-rgt-neg-out100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
neg-mul-1100.0%
Simplified100.0%
Taylor expanded in w around 0 47.3%
if -0.680000000000000049 < 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.1%
+-commutative98.1%
Simplified98.1%
Taylor expanded in w around 0 98.0%
*-commutative98.7%
Simplified98.0%
Taylor expanded in w around 0 86.3%
Final simplification77.0%
(FPCore (w l) :precision binary64 (/ l (+ w 1.0)))
double code(double w, double l) {
return l / (w + 1.0);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l / (w + 1.0d0)
end function
public static double code(double w, double l) {
return l / (w + 1.0);
}
def code(w, l): return l / (w + 1.0)
function code(w, l) return Float64(l / Float64(w + 1.0)) end
function tmp = code(w, l) tmp = l / (w + 1.0); end
code[w_, l_] := N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{w + 1}
\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%
Taylor expanded in w around 0 75.0%
+-commutative75.0%
Simplified75.0%
Taylor expanded in w around 0 74.9%
*-commutative75.5%
Simplified74.9%
Taylor expanded in w around 0 66.0%
(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%
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 59.3%
(FPCore (w l) :precision binary64 1.0)
double code(double w, double l) {
return 1.0;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = 1.0d0
end function
public static double code(double w, double l) {
return 1.0;
}
def code(w, l): return 1.0
function code(w, l) return 1.0 end
function tmp = code(w, l) tmp = 1.0; end
code[w_, l_] := 1.0
\begin{array}{l}
\\
1
\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%
Taylor expanded in l around inf 94.5%
mul-1-neg94.5%
distribute-rgt-neg-in94.5%
log-rec94.5%
remove-double-neg94.5%
+-rgt-identity94.5%
exp-diff94.5%
+-rgt-identity94.5%
remove-double-neg94.5%
distribute-lft-neg-in94.5%
distribute-rgt-neg-out94.5%
Simplified94.5%
Taylor expanded in w around inf 42.7%
neg-mul-142.7%
Simplified42.7%
Taylor expanded in w around 0 4.9%
neg-mul-14.9%
sub-neg4.9%
Simplified4.9%
Taylor expanded in w around 0 4.5%
herbie shell --seed 2024159
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))