
(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 15 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.5%
(FPCore (w l)
:precision binary64
(let* ((t_0 (exp (- w))) (t_1 (* t_0 (pow l (exp w)))))
(if (<= t_1 0.0)
0.0
(if (<= t_1 1e+304)
(* l (fma w (fma w (fma w -0.16666666666666666 0.5) -1.0) 1.0))
t_0))))
double code(double w, double l) {
double t_0 = exp(-w);
double t_1 = t_0 * pow(l, exp(w));
double tmp;
if (t_1 <= 0.0) {
tmp = 0.0;
} else if (t_1 <= 1e+304) {
tmp = l * fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(w, l) t_0 = exp(Float64(-w)) t_1 = Float64(t_0 * (l ^ exp(w))) tmp = 0.0 if (t_1 <= 0.0) tmp = 0.0; elseif (t_1 <= 1e+304) tmp = Float64(l * fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0)); else tmp = t_0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], 0.0, If[LessEqual[t$95$1, 1e+304], N[(l * N[(w * N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
t_1 := t\_0 \cdot {\ell}^{\left(e^{w}\right)}\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;0\\
\mathbf{elif}\;t\_1 \leq 10^{+304}:\\
\;\;\;\;\ell \cdot \mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 0.0Initial program 100.0%
exp-negN/A
lift-exp.f64N/A
lift-exp.f64N/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
Applied egg-rr100.0%
if 0.0 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999994e303Initial program 99.1%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.4
Simplified97.4%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6496.9
Simplified96.9%
Applied egg-rr97.4%
Taylor expanded in w around 0
Simplified93.9%
if 9.9999999999999994e303 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 100.0%
lift-exp.f64N/A
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-eval98.6
Applied egg-rr98.6%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity98.6
Applied egg-rr98.6%
Final simplification96.0%
(FPCore (w l)
:precision binary64
(let* ((t_0 (exp (- w))))
(if (<= (* t_0 (pow l (exp w))) 1e+304)
(* (pow l (fma (fma w 0.16666666666666666 0.5) (* w w) w)) (- l (* w l)))
t_0)))
double code(double w, double l) {
double t_0 = exp(-w);
double tmp;
if ((t_0 * pow(l, exp(w))) <= 1e+304) {
tmp = pow(l, fma(fma(w, 0.16666666666666666, 0.5), (w * w), w)) * (l - (w * l));
} else {
tmp = t_0;
}
return tmp;
}
function code(w, l) t_0 = exp(Float64(-w)) tmp = 0.0 if (Float64(t_0 * (l ^ exp(w))) <= 1e+304) tmp = Float64((l ^ fma(fma(w, 0.16666666666666666, 0.5), Float64(w * w), w)) * Float64(l - Float64(w * l))); else tmp = t_0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+304], N[(N[Power[l, N[(N[(w * 0.16666666666666666 + 0.5), $MachinePrecision] * N[(w * w), $MachinePrecision] + w), $MachinePrecision]], $MachinePrecision] * N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
\mathbf{if}\;t\_0 \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+304}:\\
\;\;\;\;{\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(w, 0.16666666666666666, 0.5\right), w \cdot w, w\right)\right)} \cdot \left(\ell - w \cdot \ell\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999994e303Initial program 99.3%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.8
Simplified87.8%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.3
Simplified87.3%
Applied egg-rr87.8%
Taylor expanded in w around 0
mul-1-negN/A
unsub-negN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6497.5
Simplified97.5%
if 9.9999999999999994e303 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 100.0%
lift-exp.f64N/A
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-eval98.6
Applied egg-rr98.6%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity98.6
Applied egg-rr98.6%
(FPCore (w l)
:precision binary64
(let* ((t_0 (exp (- w))))
(if (<= (* t_0 (pow l (exp w))) 1e+304)
(* (pow l (fma 0.5 (* w w) w)) (* l (- 1.0 w)))
t_0)))
double code(double w, double l) {
double t_0 = exp(-w);
double tmp;
if ((t_0 * pow(l, exp(w))) <= 1e+304) {
tmp = pow(l, fma(0.5, (w * w), w)) * (l * (1.0 - w));
} else {
tmp = t_0;
}
return tmp;
}
function code(w, l) t_0 = exp(Float64(-w)) tmp = 0.0 if (Float64(t_0 * (l ^ exp(w))) <= 1e+304) tmp = Float64((l ^ fma(0.5, Float64(w * w), w)) * Float64(l * Float64(1.0 - w))); else tmp = t_0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+304], N[(N[Power[l, N[(0.5 * N[(w * w), $MachinePrecision] + w), $MachinePrecision]], $MachinePrecision] * N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
\mathbf{if}\;t\_0 \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+304}:\\
\;\;\;\;{\ell}^{\left(\mathsf{fma}\left(0.5, w \cdot w, w\right)\right)} \cdot \left(\ell \cdot \left(1 - w\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999994e303Initial program 99.3%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6497.2
Simplified97.2%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.1
Simplified97.1%
lift--.f64N/A
lift-fma.f64N/A
lift-fma.f64N/A
lift-pow.f64N/A
*-commutativeN/A
lift-pow.f64N/A
lift-fma.f64N/A
pow-plusN/A
associate-*l*N/A
lower-*.f64N/A
lower-pow.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
*-lft-identityN/A
lower-fma.f64N/A
lower-*.f6497.4
Applied egg-rr97.4%
if 9.9999999999999994e303 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 100.0%
lift-exp.f64N/A
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-eval98.6
Applied egg-rr98.6%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity98.6
Applied egg-rr98.6%
(FPCore (w l)
:precision binary64
(let* ((t_0 (exp (- w))))
(if (<= (* t_0 (pow l (exp w))) 1e+304)
(* (- 1.0 w) (pow l (fma w (fma w 0.5 1.0) 1.0)))
t_0)))
double code(double w, double l) {
double t_0 = exp(-w);
double tmp;
if ((t_0 * pow(l, exp(w))) <= 1e+304) {
tmp = (1.0 - w) * pow(l, fma(w, fma(w, 0.5, 1.0), 1.0));
} else {
tmp = t_0;
}
return tmp;
}
function code(w, l) t_0 = exp(Float64(-w)) tmp = 0.0 if (Float64(t_0 * (l ^ exp(w))) <= 1e+304) tmp = Float64(Float64(1.0 - w) * (l ^ fma(w, fma(w, 0.5, 1.0), 1.0))); else tmp = t_0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+304], N[(N[(1.0 - w), $MachinePrecision] * N[Power[l, N[(w * N[(w * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
\mathbf{if}\;t\_0 \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+304}:\\
\;\;\;\;\left(1 - w\right) \cdot {\ell}^{\left(\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, 1\right), 1\right)\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999994e303Initial program 99.3%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6497.2
Simplified97.2%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.1
Simplified97.1%
if 9.9999999999999994e303 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 100.0%
lift-exp.f64N/A
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-eval98.6
Applied egg-rr98.6%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity98.6
Applied egg-rr98.6%
(FPCore (w l)
:precision binary64
(let* ((t_0 (exp (- w))))
(if (<= (* t_0 (pow l (exp w))) 1e+304)
(* (- 1.0 w) (pow l (+ w 1.0)))
t_0)))
double code(double w, double l) {
double t_0 = exp(-w);
double tmp;
if ((t_0 * pow(l, exp(w))) <= 1e+304) {
tmp = (1.0 - w) * pow(l, (w + 1.0));
} else {
tmp = 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 = exp(-w)
if ((t_0 * (l ** exp(w))) <= 1d+304) then
tmp = (1.0d0 - w) * (l ** (w + 1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = Math.exp(-w);
double tmp;
if ((t_0 * Math.pow(l, Math.exp(w))) <= 1e+304) {
tmp = (1.0 - w) * Math.pow(l, (w + 1.0));
} else {
tmp = t_0;
}
return tmp;
}
def code(w, l): t_0 = math.exp(-w) tmp = 0 if (t_0 * math.pow(l, math.exp(w))) <= 1e+304: tmp = (1.0 - w) * math.pow(l, (w + 1.0)) else: tmp = t_0 return tmp
function code(w, l) t_0 = exp(Float64(-w)) tmp = 0.0 if (Float64(t_0 * (l ^ exp(w))) <= 1e+304) tmp = Float64(Float64(1.0 - w) * (l ^ Float64(w + 1.0))); else tmp = t_0; end return tmp end
function tmp_2 = code(w, l) t_0 = exp(-w); tmp = 0.0; if ((t_0 * (l ^ exp(w))) <= 1e+304) tmp = (1.0 - w) * (l ^ (w + 1.0)); else tmp = t_0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1e+304], N[(N[(1.0 - w), $MachinePrecision] * N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
\mathbf{if}\;t\_0 \cdot {\ell}^{\left(e^{w}\right)} \leq 10^{+304}:\\
\;\;\;\;\left(1 - w\right) \cdot {\ell}^{\left(w + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999994e303Initial program 99.3%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6497.2
Simplified97.2%
Taylor expanded in w around 0
+-commutativeN/A
lower-+.f6496.6
Simplified96.6%
if 9.9999999999999994e303 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 100.0%
lift-exp.f64N/A
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-eval98.6
Applied egg-rr98.6%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity98.6
Applied egg-rr98.6%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- w)) (pow l (exp w))) 2e-156) 0.0 (fma w (fma w (fma w -0.16666666666666666 0.5) -1.0) 1.0)))
double code(double w, double l) {
double tmp;
if ((exp(-w) * pow(l, exp(w))) <= 2e-156) {
tmp = 0.0;
} else {
tmp = fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0);
}
return tmp;
}
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(-w)) * (l ^ exp(w))) <= 2e-156) tmp = 0.0; else tmp = fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0); end return tmp end
code[w_, l_] := If[LessEqual[N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e-156], 0.0, N[(w * N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 2 \cdot 10^{-156}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 2.00000000000000008e-156Initial program 99.3%
exp-negN/A
lift-exp.f64N/A
lift-exp.f64N/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
Applied egg-rr45.8%
if 2.00000000000000008e-156 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-exp.f64N/A
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-eval43.7
Applied egg-rr43.7%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6431.5
Simplified31.5%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- w)) (pow l (exp w))) 2e-156) 0.0 (fma w (fma w 0.5 -1.0) 1.0)))
double code(double w, double l) {
double tmp;
if ((exp(-w) * pow(l, exp(w))) <= 2e-156) {
tmp = 0.0;
} else {
tmp = fma(w, fma(w, 0.5, -1.0), 1.0);
}
return tmp;
}
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(-w)) * (l ^ exp(w))) <= 2e-156) tmp = 0.0; else tmp = fma(w, fma(w, 0.5, -1.0), 1.0); end return tmp end
code[w_, l_] := If[LessEqual[N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e-156], 0.0, N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 2 \cdot 10^{-156}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 2.00000000000000008e-156Initial program 99.3%
exp-negN/A
lift-exp.f64N/A
lift-exp.f64N/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
Applied egg-rr45.8%
if 2.00000000000000008e-156 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-exp.f64N/A
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-eval43.7
Applied egg-rr43.7%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6425.9
Simplified25.9%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- w)) (pow l (exp w))) 2e-156) 0.0 (- 1.0 w)))
double code(double w, double l) {
double tmp;
if ((exp(-w) * pow(l, exp(w))) <= 2e-156) {
tmp = 0.0;
} else {
tmp = 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 ((exp(-w) * (l ** exp(w))) <= 2d-156) then
tmp = 0.0d0
else
tmp = 1.0d0 - w
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if ((Math.exp(-w) * Math.pow(l, Math.exp(w))) <= 2e-156) {
tmp = 0.0;
} else {
tmp = 1.0 - w;
}
return tmp;
}
def code(w, l): tmp = 0 if (math.exp(-w) * math.pow(l, math.exp(w))) <= 2e-156: tmp = 0.0 else: tmp = 1.0 - w return tmp
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(-w)) * (l ^ exp(w))) <= 2e-156) tmp = 0.0; else tmp = Float64(1.0 - w); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((exp(-w) * (l ^ exp(w))) <= 2e-156) tmp = 0.0; else tmp = 1.0 - w; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 2e-156], 0.0, N[(1.0 - w), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 2 \cdot 10^{-156}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;1 - w\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 2.00000000000000008e-156Initial program 99.3%
exp-negN/A
lift-exp.f64N/A
lift-exp.f64N/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
Applied egg-rr45.8%
if 2.00000000000000008e-156 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-exp.f64N/A
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-eval43.7
Applied egg-rr43.7%
Taylor expanded in w around 0
neg-mul-1N/A
sub-negN/A
lower--.f646.1
Simplified6.1%
(FPCore (w l)
:precision binary64
(if (<= w -0.00055)
(exp (- (* (exp w) (log l)) w))
(/
(pow l (exp w))
(fma w (fma w (fma w 0.16666666666666666 0.5) 1.0) 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.00055) {
tmp = exp(((exp(w) * log(l)) - w));
} else {
tmp = pow(l, exp(w)) / fma(w, fma(w, fma(w, 0.16666666666666666, 0.5), 1.0), 1.0);
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -0.00055) tmp = exp(Float64(Float64(exp(w) * log(l)) - w)); else tmp = Float64((l ^ exp(w)) / fma(w, fma(w, fma(w, 0.16666666666666666, 0.5), 1.0), 1.0)); end return tmp end
code[w_, l_] := If[LessEqual[w, -0.00055], N[Exp[N[(N[(N[Exp[w], $MachinePrecision] * N[Log[l], $MachinePrecision]), $MachinePrecision] - w), $MachinePrecision]], $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(w * N[(w * N[(w * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.00055:\\
\;\;\;\;e^{e^{w} \cdot \log \ell - w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{\mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.16666666666666666, 0.5\right), 1\right), 1\right)}\\
\end{array}
\end{array}
if w < -5.50000000000000033e-4Initial program 99.9%
Taylor expanded in l around -inf
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6499.9
Simplified99.9%
exp-negN/A
lift-exp.f64N/A
associate-/r/N/A
metadata-evalN/A
*-lft-identityN/A
lift-exp.f64N/A
lift-pow.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f6499.9
Applied egg-rr99.9%
lift-exp.f64N/A
pow-to-expN/A
div-expN/A
lower-exp.f64N/A
lower--.f64N/A
lift-log.f64N/A
*-commutativeN/A
lower-*.f6499.9
Applied egg-rr99.9%
if -5.50000000000000033e-4 < w Initial program 99.3%
Taylor expanded in l around -inf
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6499.1
Simplified99.1%
exp-negN/A
lift-exp.f64N/A
associate-/r/N/A
metadata-evalN/A
*-lft-identityN/A
lift-exp.f64N/A
lift-pow.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f6499.3
Applied egg-rr99.3%
Taylor expanded in w around 0
+-commutativeN/A
metadata-evalN/A
cancel-sign-sub-invN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.3
Simplified98.3%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- w)) (pow l (exp w))) 1.12e-154) 0.0 1.0))
double code(double w, double l) {
double tmp;
if ((exp(-w) * pow(l, exp(w))) <= 1.12e-154) {
tmp = 0.0;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if ((exp(-w) * (l ** exp(w))) <= 1.12d-154) then
tmp = 0.0d0
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if ((Math.exp(-w) * Math.pow(l, Math.exp(w))) <= 1.12e-154) {
tmp = 0.0;
} else {
tmp = 1.0;
}
return tmp;
}
def code(w, l): tmp = 0 if (math.exp(-w) * math.pow(l, math.exp(w))) <= 1.12e-154: tmp = 0.0 else: tmp = 1.0 return tmp
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(-w)) * (l ^ exp(w))) <= 1.12e-154) tmp = 0.0; else tmp = 1.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((exp(-w) * (l ^ exp(w))) <= 1.12e-154) tmp = 0.0; else tmp = 1.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 1.12e-154], 0.0, 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 1.12 \cdot 10^{-154}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 1.12e-154Initial program 99.3%
exp-negN/A
lift-exp.f64N/A
lift-exp.f64N/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
Applied egg-rr45.8%
if 1.12e-154 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-exp.f64N/A
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-eval43.7
Applied egg-rr43.7%
Taylor expanded in w around 0
Simplified5.0%
(FPCore (w l)
:precision binary64
(if (<= w -1.58)
(exp (- w))
(/
(pow l (exp w))
(fma w (fma w (fma w 0.16666666666666666 0.5) 1.0) 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.58) {
tmp = exp(-w);
} else {
tmp = pow(l, exp(w)) / fma(w, fma(w, fma(w, 0.16666666666666666, 0.5), 1.0), 1.0);
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -1.58) tmp = exp(Float64(-w)); else tmp = Float64((l ^ exp(w)) / fma(w, fma(w, fma(w, 0.16666666666666666, 0.5), 1.0), 1.0)); end return tmp end
code[w_, l_] := If[LessEqual[w, -1.58], N[Exp[(-w)], $MachinePrecision], N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(w * N[(w * N[(w * 0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.58:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\ell}^{\left(e^{w}\right)}}{\mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.16666666666666666, 0.5\right), 1\right), 1\right)}\\
\end{array}
\end{array}
if w < -1.5800000000000001Initial program 100.0%
lift-exp.f64N/A
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%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity100.0
Applied egg-rr100.0%
if -1.5800000000000001 < w Initial program 99.3%
Taylor expanded in l around -inf
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6499.1
Simplified99.1%
exp-negN/A
lift-exp.f64N/A
associate-/r/N/A
metadata-evalN/A
*-lft-identityN/A
lift-exp.f64N/A
lift-pow.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f6499.3
Applied egg-rr99.3%
Taylor expanded in w around 0
+-commutativeN/A
metadata-evalN/A
cancel-sign-sub-invN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.0
Simplified98.0%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (exp (- w)) (/ (pow l (exp w)) (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = 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 = 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 = 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 = 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 = exp(Float64(-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 = exp(-w); else tmp = (l ^ exp(w)) / (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[Exp[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}^{\left(e^{w}\right)}}{w + 1}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
lift-exp.f64N/A
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%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity100.0
Applied egg-rr100.0%
if -1 < w Initial program 99.3%
Taylor expanded in l around -inf
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
mul-1-negN/A
unsub-negN/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6499.1
Simplified99.1%
exp-negN/A
lift-exp.f64N/A
associate-/r/N/A
metadata-evalN/A
*-lft-identityN/A
lift-exp.f64N/A
lift-pow.f64N/A
associate-*l/N/A
*-lft-identityN/A
lower-/.f6499.3
Applied egg-rr99.3%
Taylor expanded in w around 0
+-commutativeN/A
lower-+.f6497.2
Simplified97.2%
(FPCore (w l) :precision binary64 (if (<= w 0.98) (* l (fma w (fma w (fma w -0.16666666666666666 0.5) -1.0) 1.0)) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.98) {
tmp = l * fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= 0.98) tmp = Float64(l * fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0)); else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, 0.98], N[(l * N[(w * N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.98:\\
\;\;\;\;\ell \cdot \mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.97999999999999998Initial program 99.4%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6488.7
Simplified88.7%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6479.2
Simplified79.2%
Applied egg-rr79.5%
Taylor expanded in w around 0
Simplified88.5%
if 0.97999999999999998 < w Initial program 100.0%
exp-negN/A
lift-exp.f64N/A
lift-exp.f64N/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
Applied egg-rr97.3%
Final simplification89.8%
(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.5%
exp-negN/A
lift-exp.f64N/A
lift-exp.f64N/A
sqr-powN/A
pow-prod-upN/A
flip-+N/A
+-inversesN/A
metadata-evalN/A
metadata-evalN/A
mul0-lftN/A
*-commutativeN/A
*-commutativeN/A
mul0-lftN/A
metadata-evalN/A
+-inversesN/A
metadata-evalN/A
flip--N/A
metadata-evalN/A
metadata-evalN/A
associate-/r/N/A
div-invN/A
metadata-evalN/A
Applied egg-rr16.9%
herbie shell --seed 2024208
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))