
(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 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
(FPCore (w l)
:precision binary64
(if (<= w -1.6)
(/ 1.0 (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 = 1.0 / 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 = 1.0d0 / 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 = 1.0 / 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 = 1.0 / 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(1.0 / 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 = 1.0 / 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[(1.0 / 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{1}{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-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
if -1.6000000000000001 < w Initial program 99.1%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.1%
Simplified99.1%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.4%
Simplified99.4%
(FPCore (w l) :precision binary64 (* (exp (- 0.0 w)) (pow l (exp w))))
double code(double w, double l) {
return exp((0.0 - w)) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp((0.0d0 - w)) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp((0.0 - w)) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp((0.0 - w)) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(0.0 - w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp((0.0 - w)) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{0 - 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-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.3%
Simplified99.3%
(FPCore (w l) :precision binary64 (if (<= w -3.9) (/ 1.0 (exp w)) (* (pow l (exp w)) (/ 1.0 (+ 1.0 (* w (+ 1.0 (* w 0.5))))))))
double code(double w, double l) {
double tmp;
if (w <= -3.9) {
tmp = 1.0 / exp(w);
} else {
tmp = pow(l, exp(w)) * (1.0 / (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.9d0)) then
tmp = 1.0d0 / exp(w)
else
tmp = (l ** exp(w)) * (1.0d0 / (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.9) {
tmp = 1.0 / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) * (1.0 / (1.0 + (w * (1.0 + (w * 0.5)))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -3.9: tmp = 1.0 / math.exp(w) else: tmp = math.pow(l, math.exp(w)) * (1.0 / (1.0 + (w * (1.0 + (w * 0.5))))) return tmp
function code(w, l) tmp = 0.0 if (w <= -3.9) tmp = Float64(1.0 / exp(w)); else tmp = Float64((l ^ exp(w)) * Float64(1.0 / 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.9) tmp = 1.0 / exp(w); else tmp = (l ^ exp(w)) * (1.0 / (1.0 + (w * (1.0 + (w * 0.5))))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -3.9], N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * N[(1.0 / N[(1.0 + N[(w * N[(1.0 + N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -3.9:\\
\;\;\;\;\frac{1}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(e^{w}\right)} \cdot \frac{1}{1 + w \cdot \left(1 + w \cdot 0.5\right)}\\
\end{array}
\end{array}
if w < -3.89999999999999991Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
if -3.89999999999999991 < w Initial program 99.1%
Taylor expanded in w around inf
exp-negN/A
/-lowering-/.f64N/A
exp-lowering-exp.f6499.1%
Simplified99.1%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6499.2%
Simplified99.2%
Final simplification99.4%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (/ 1.0 (exp w)) (/ (pow l (exp w)) (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = 1.0 / exp(w);
} else {
tmp = pow(l, exp(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 = 1.0d0 / exp(w)
else
tmp = (l ** exp(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 = 1.0 / Math.exp(w);
} else {
tmp = Math.pow(l, Math.exp(w)) / (w + 1.0);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = 1.0 / math.exp(w) else: tmp = math.pow(l, math.exp(w)) / (w + 1.0) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = Float64(1.0 / exp(w)); else tmp = Float64((l ^ exp(w)) / Float64(w + 1.0)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = 1.0 / exp(w); else tmp = (l ^ exp(w)) / (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(w + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;\frac{1}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
if -1 < w Initial program 99.1%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.1%
Simplified99.1%
Taylor expanded in w around 0
+-commutativeN/A
+-lowering-+.f6499.1%
Simplified99.1%
(FPCore (w l) :precision binary64 (if (<= w -1.6) (/ 1.0 (exp w)) (pow l (+ 1.0 (* w (+ 1.0 (* w (+ 0.5 (* w 0.16666666666666666)))))))))
double code(double w, double l) {
double tmp;
if (w <= -1.6) {
tmp = 1.0 / exp(w);
} else {
tmp = pow(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 <= (-1.6d0)) then
tmp = 1.0d0 / exp(w)
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 <= -1.6) {
tmp = 1.0 / Math.exp(w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * (0.5 + (w * 0.16666666666666666)))))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.6: tmp = 1.0 / math.exp(w) else: tmp = math.pow(l, (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(1.0 / exp(w)); else tmp = 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 <= -1.6) tmp = 1.0 / exp(w); 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, -1.6], N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], 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]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.6:\\
\;\;\;\;\frac{1}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(1 + w \cdot \left(1 + w \cdot \left(0.5 + w \cdot 0.16666666666666666\right)\right)\right)}\\
\end{array}
\end{array}
if w < -1.6000000000000001Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
if -1.6000000000000001 < w Initial program 99.1%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6486.0%
Simplified86.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6485.9%
Simplified85.9%
Taylor expanded in w around 0
Simplified98.5%
*-lft-identityN/A
pow-lowering-pow.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6498.5%
Applied egg-rr98.5%
(FPCore (w l) :precision binary64 (if (<= w -1.3) (/ 1.0 (exp w)) (pow l (+ 1.0 (* w (+ 1.0 (* w 0.5)))))))
double code(double w, double l) {
double tmp;
if (w <= -1.3) {
tmp = 1.0 / exp(w);
} else {
tmp = pow(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.3d0)) then
tmp = 1.0d0 / exp(w)
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.3) {
tmp = 1.0 / Math.exp(w);
} else {
tmp = Math.pow(l, (1.0 + (w * (1.0 + (w * 0.5)))));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.3: tmp = 1.0 / math.exp(w) else: tmp = math.pow(l, (1.0 + (w * (1.0 + (w * 0.5))))) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.3) tmp = Float64(1.0 / exp(w)); else tmp = 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.3) tmp = 1.0 / exp(w); else tmp = l ^ (1.0 + (w * (1.0 + (w * 0.5)))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.3], N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[Power[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.3:\\
\;\;\;\;\frac{1}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(1 + w \cdot \left(1 + w \cdot 0.5\right)\right)}\\
\end{array}
\end{array}
if w < -1.30000000000000004Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
if -1.30000000000000004 < w Initial program 99.1%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6486.0%
Simplified86.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6485.9%
Simplified85.9%
Taylor expanded in w around 0
Simplified98.5%
Taylor expanded in w around 0
distribute-rgt-inN/A
*-lft-identityN/A
associate-*r*N/A
unpow2N/A
+-lowering-+.f64N/A
*-lft-identityN/A
unpow2N/A
associate-*r*N/A
distribute-rgt-inN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6498.5%
Simplified98.5%
Final simplification98.9%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (/ 1.0 (exp w)) (pow l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = 1.0 / exp(w);
} else {
tmp = pow(l, (w + 1.0));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.0d0)) then
tmp = 1.0d0 / exp(w)
else
tmp = l ** (w + 1.0d0)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = 1.0 / Math.exp(w);
} else {
tmp = Math.pow(l, (w + 1.0));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = 1.0 / math.exp(w) else: tmp = math.pow(l, (w + 1.0)) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = Float64(1.0 / exp(w)); else tmp = l ^ Float64(w + 1.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = 1.0 / exp(w); else tmp = l ^ (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;\frac{1}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(w + 1\right)}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
if -1 < w Initial program 99.1%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6486.0%
Simplified86.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6485.9%
Simplified85.9%
Taylor expanded in w around 0
Simplified98.5%
Taylor expanded in w around 0
+-commutativeN/A
+-lowering-+.f6498.4%
Simplified98.4%
Final simplification98.8%
(FPCore (w l) :precision binary64 (if (<= w -0.72) (/ 1.0 (exp w)) (if (<= w 0.185) (/ l (+ w 1.0)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.72) {
tmp = 1.0 / exp(w);
} else if (w <= 0.185) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.72d0)) then
tmp = 1.0d0 / exp(w)
else if (w <= 0.185d0) then
tmp = l / (w + 1.0d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.72) {
tmp = 1.0 / Math.exp(w);
} else if (w <= 0.185) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.72: tmp = 1.0 / math.exp(w) elif w <= 0.185: tmp = l / (w + 1.0) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.72) tmp = Float64(1.0 / exp(w)); elseif (w <= 0.185) tmp = Float64(l / Float64(w + 1.0)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.72) tmp = 1.0 / exp(w); elseif (w <= 0.185) tmp = l / (w + 1.0); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.72], N[(1.0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.185], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.72:\\
\;\;\;\;\frac{1}{e^{w}}\\
\mathbf{elif}\;w \leq 0.185:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.71999999999999997Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
if -0.71999999999999997 < w < 0.185Initial program 99.5%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.5%
Simplified99.5%
Taylor expanded in w around 0
Simplified97.6%
Taylor expanded in w around 0
+-commutativeN/A
+-lowering-+.f6497.6%
Simplified97.6%
if 0.185 < w Initial program 97.5%
Applied egg-rr95.1%
(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-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.3%
Simplified99.3%
Taylor expanded in w around 0
Simplified97.1%
(FPCore (w l) :precision binary64 (if (<= w -2.2e+110) (+ 1.0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666)))))) (if (<= w 0.115) (+ l (* w (* l (+ (* w 0.5) -1.0)))) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -2.2e+110) {
tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
} else if (w <= 0.115) {
tmp = l + (w * (l * ((w * 0.5) + -1.0)));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-2.2d+110)) then
tmp = 1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0))))))
else if (w <= 0.115d0) then
tmp = l + (w * (l * ((w * 0.5d0) + (-1.0d0))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -2.2e+110) {
tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))));
} else if (w <= 0.115) {
tmp = l + (w * (l * ((w * 0.5) + -1.0)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -2.2e+110: tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))) elif w <= 0.115: tmp = l + (w * (l * ((w * 0.5) + -1.0))) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -2.2e+110) tmp = Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666)))))); elseif (w <= 0.115) tmp = Float64(l + Float64(w * Float64(l * Float64(Float64(w * 0.5) + -1.0)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -2.2e+110) tmp = 1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))); elseif (w <= 0.115) tmp = l + (w * (l * ((w * 0.5) + -1.0))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -2.2e+110], 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, 0.115], N[(l + N[(w * N[(l * N[(N[(w * 0.5), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -2.2 \cdot 10^{+110}:\\
\;\;\;\;1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\
\mathbf{elif}\;w \leq 0.115:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \left(w \cdot 0.5 + -1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -2.19999999999999992e110Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-eval100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
if -2.19999999999999992e110 < w < 0.115000000000000005Initial program 99.6%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.6%
Simplified99.6%
Taylor expanded in w around 0
Simplified97.4%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
distribute-lft-neg-inN/A
metadata-evalN/A
associate-*r*N/A
*-commutativeN/A
mul-1-negN/A
distribute-rgt-outN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6486.3%
Simplified86.3%
if 0.115000000000000005 < w Initial program 97.5%
Applied egg-rr95.1%
Final simplification89.9%
(FPCore (w l) :precision binary64 (if (<= w 0.11) (* l (+ 1.0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666))))))) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.11) {
tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.11d0) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0)))))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.11) {
tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.11: tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))))) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.11) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.11) tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.11], 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], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.11:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.110000000000000001Initial program 99.7%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6488.8%
Simplified88.8%
Taylor expanded in w around 0
Simplified89.0%
if 0.110000000000000001 < w Initial program 97.5%
Applied egg-rr95.1%
Final simplification90.0%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (* l (* w (* w 0.5))) (if (<= w 0.085) (/ l (+ w 1.0)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = l * (w * (w * 0.5));
} else if (w <= 0.085) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.0d0)) then
tmp = l * (w * (w * 0.5d0))
else if (w <= 0.085d0) then
tmp = l / (w + 1.0d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = l * (w * (w * 0.5));
} else if (w <= 0.085) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = l * (w * (w * 0.5)) elif w <= 0.085: tmp = l / (w + 1.0) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = Float64(l * Float64(w * Float64(w * 0.5))); elseif (w <= 0.085) tmp = Float64(l / Float64(w + 1.0)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = l * (w * (w * 0.5)); elseif (w <= 0.085) tmp = l / (w + 1.0); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[(l * N[(w * N[(w * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.085], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;\ell \cdot \left(w \cdot \left(w \cdot 0.5\right)\right)\\
\mathbf{elif}\;w \leq 0.085:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Taylor expanded in w around 0
Simplified98.6%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f6498.6%
Applied egg-rr98.6%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6451.5%
Simplified51.5%
Taylor expanded in w around inf
associate-*l*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
unpow2N/A
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6460.9%
Simplified60.9%
if -1 < w < 0.0850000000000000061Initial program 99.5%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.5%
Simplified99.5%
Taylor expanded in w around 0
Simplified97.6%
Taylor expanded in w around 0
+-commutativeN/A
+-lowering-+.f6497.6%
Simplified97.6%
if 0.0850000000000000061 < w Initial program 97.5%
Applied egg-rr95.1%
(FPCore (w l) :precision binary64 (if (<= w 0.115) (- l (* w l)) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.115) {
tmp = l - (w * l);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.115d0) then
tmp = l - (w * l)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.115) {
tmp = l - (w * l);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.115: tmp = l - (w * l) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.115) tmp = Float64(l - Float64(w * l)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.115) tmp = l - (w * l); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.115], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.115:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.115000000000000005Initial program 99.7%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.7%
Simplified99.7%
Taylor expanded in w around 0
Simplified97.9%
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
exp-lowering-exp.f6497.8%
Applied egg-rr97.8%
Taylor expanded in w around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6474.8%
Simplified74.8%
if 0.115000000000000005 < w Initial program 97.5%
Applied egg-rr95.1%
Final simplification78.0%
(FPCore (w l) :precision binary64 (if (<= w 0.17) (* l (- 1.0 w)) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.17) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.17d0) then
tmp = l * (1.0d0 - w)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.17) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.17: tmp = l * (1.0 - w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.17) tmp = Float64(l * Float64(1.0 - w)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.17) tmp = l * (1.0 - w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.17], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.17:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.170000000000000012Initial program 99.7%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
--lowering--.f6468.9%
Simplified68.9%
Taylor expanded in w around 0
Simplified74.8%
if 0.170000000000000012 < w Initial program 97.5%
Applied egg-rr95.1%
Final simplification78.0%
(FPCore (w l) :precision binary64 (if (<= w 0.25) l 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.25) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.25d0) then
tmp = l
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.25) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.25: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.25) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.25) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.25], l, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.25:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.25Initial program 99.7%
Taylor expanded in w around 0
Simplified67.6%
if 0.25 < w Initial program 97.5%
Applied egg-rr95.1%
(FPCore (w l) :precision binary64 0.0)
double code(double w, double l) {
return 0.0;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = 0.0d0
end function
public static double code(double w, double l) {
return 0.0;
}
def code(w, l): return 0.0
function code(w, l) return 0.0 end
function tmp = code(w, l) tmp = 0.0; end
code[w_, l_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 99.3%
Applied egg-rr17.6%
herbie shell --seed 2024161
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))