
(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 14 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))))
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(Float64(-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}
\\
{\ell}^{\left(e^{w}\right)} \cdot e^{-w}
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (w l) :precision binary64 (let* ((t_0 (exp (- w))) (t_1 (* (pow l (exp w)) t_0))) (if (<= t_1 0.0) t_0 (if (<= t_1 INFINITY) (* (pow l 1.0) 1.0) t_0))))
double code(double w, double l) {
double t_0 = exp(-w);
double t_1 = pow(l, exp(w)) * t_0;
double tmp;
if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= ((double) INFINITY)) {
tmp = pow(l, 1.0) * 1.0;
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double w, double l) {
double t_0 = Math.exp(-w);
double t_1 = Math.pow(l, Math.exp(w)) * t_0;
double tmp;
if (t_1 <= 0.0) {
tmp = t_0;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = Math.pow(l, 1.0) * 1.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(w, l): t_0 = math.exp(-w) t_1 = math.pow(l, math.exp(w)) * t_0 tmp = 0 if t_1 <= 0.0: tmp = t_0 elif t_1 <= math.inf: tmp = math.pow(l, 1.0) * 1.0 else: tmp = t_0 return tmp
function code(w, l) t_0 = exp(Float64(-w)) t_1 = Float64((l ^ exp(w)) * t_0) tmp = 0.0 if (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= Inf) tmp = Float64((l ^ 1.0) * 1.0); else tmp = t_0; end return tmp end
function tmp_2 = code(w, l) t_0 = exp(-w); t_1 = (l ^ exp(w)) * t_0; tmp = 0.0; if (t_1 <= 0.0) tmp = t_0; elseif (t_1 <= Inf) tmp = (l ^ 1.0) * 1.0; else tmp = t_0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, 0.0], t$95$0, If[LessEqual[t$95$1, Infinity], N[(N[Power[l, 1.0], $MachinePrecision] * 1.0), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
t_1 := {\ell}^{\left(e^{w}\right)} \cdot t\_0\\
\mathbf{if}\;t\_1 \leq 0:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;{\ell}^{1} \cdot 1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 0.0 or +inf.0 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 100.0%
lift-pow.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 rewrites100.0%
lift-*.f64N/A
lift-exp.f64N/A
lift-neg.f64N/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-exp.f64100.0
Applied rewrites100.0%
if 0.0 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < +inf.0Initial program 99.5%
Taylor expanded in w around 0
Applied rewrites68.1%
Taylor expanded in w around 0
Applied rewrites67.6%
Final simplification72.4%
(FPCore (w l) :precision binary64 (let* ((t_0 (pow l (exp w))) (t_1 (exp (- w)))) (if (<= (* t_0 t_1) INFINITY) (* (- 1.0 w) t_0) t_1)))
double code(double w, double l) {
double t_0 = pow(l, exp(w));
double t_1 = exp(-w);
double tmp;
if ((t_0 * t_1) <= ((double) INFINITY)) {
tmp = (1.0 - w) * t_0;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double w, double l) {
double t_0 = Math.pow(l, Math.exp(w));
double t_1 = Math.exp(-w);
double tmp;
if ((t_0 * t_1) <= Double.POSITIVE_INFINITY) {
tmp = (1.0 - w) * t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(w, l): t_0 = math.pow(l, math.exp(w)) t_1 = math.exp(-w) tmp = 0 if (t_0 * t_1) <= math.inf: tmp = (1.0 - w) * t_0 else: tmp = t_1 return tmp
function code(w, l) t_0 = l ^ exp(w) t_1 = exp(Float64(-w)) tmp = 0.0 if (Float64(t_0 * t_1) <= Inf) tmp = Float64(Float64(1.0 - w) * t_0); else tmp = t_1; end return tmp end
function tmp_2 = code(w, l) t_0 = l ^ exp(w); t_1 = exp(-w); tmp = 0.0; if ((t_0 * t_1) <= Inf) tmp = (1.0 - w) * t_0; else tmp = t_1; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[N[(t$95$0 * t$95$1), $MachinePrecision], Infinity], N[(N[(1.0 - w), $MachinePrecision] * t$95$0), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\ell}^{\left(e^{w}\right)}\\
t_1 := e^{-w}\\
\mathbf{if}\;t\_0 \cdot t\_1 \leq \infty:\\
\;\;\;\;\left(1 - w\right) \cdot t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < +inf.0Initial program 99.6%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6474.2
Applied rewrites74.2%
if +inf.0 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
lift-*.f64N/A
lift-exp.f64N/A
lift-neg.f64N/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-exp.f6444.1
Applied rewrites44.1%
Final simplification74.2%
(FPCore (w l)
:precision binary64
(let* ((t_0 (exp (- w))))
(if (<= (* (pow l (exp w)) t_0) INFINITY)
(* (pow l (fma (fma 0.5 w 1.0) w 1.0)) (fma -1.0 w 1.0))
t_0)))
double code(double w, double l) {
double t_0 = exp(-w);
double tmp;
if ((pow(l, exp(w)) * t_0) <= ((double) INFINITY)) {
tmp = pow(l, fma(fma(0.5, w, 1.0), w, 1.0)) * fma(-1.0, w, 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(w, l) t_0 = exp(Float64(-w)) tmp = 0.0 if (Float64((l ^ exp(w)) * t_0) <= Inf) tmp = Float64((l ^ fma(fma(0.5, w, 1.0), w, 1.0)) * fma(-1.0, w, 1.0)); else tmp = t_0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], Infinity], N[(N[Power[l, N[(N[(0.5 * w + 1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]], $MachinePrecision] * N[(-1.0 * w + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
\mathbf{if}\;{\ell}^{\left(e^{w}\right)} \cdot t\_0 \leq \infty:\\
\;\;\;\;{\ell}^{\left(\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, 1\right), w, 1\right)\right)} \cdot \mathsf{fma}\left(-1, w, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < +inf.0Initial program 99.6%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f6476.0
Applied rewrites76.0%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6480.2
Applied rewrites80.2%
Taylor expanded in w around 0
Applied rewrites88.7%
if +inf.0 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
lift-*.f64N/A
lift-exp.f64N/A
lift-neg.f64N/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-exp.f6444.1
Applied rewrites44.1%
Final simplification88.7%
(FPCore (w l)
:precision binary64
(let* ((t_0 (exp (- w))))
(if (<= (* (pow l (exp w)) t_0) INFINITY)
(* (pow l (+ 1.0 w)) (fma -1.0 w 1.0))
t_0)))
double code(double w, double l) {
double t_0 = exp(-w);
double tmp;
if ((pow(l, exp(w)) * t_0) <= ((double) INFINITY)) {
tmp = pow(l, (1.0 + w)) * fma(-1.0, w, 1.0);
} else {
tmp = t_0;
}
return tmp;
}
function code(w, l) t_0 = exp(Float64(-w)) tmp = 0.0 if (Float64((l ^ exp(w)) * t_0) <= Inf) tmp = Float64((l ^ Float64(1.0 + w)) * fma(-1.0, w, 1.0)); else tmp = t_0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], Infinity], N[(N[Power[l, N[(1.0 + w), $MachinePrecision]], $MachinePrecision] * N[(-1.0 * w + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
\mathbf{if}\;{\ell}^{\left(e^{w}\right)} \cdot t\_0 \leq \infty:\\
\;\;\;\;{\ell}^{\left(1 + w\right)} \cdot \mathsf{fma}\left(-1, w, 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < +inf.0Initial program 99.6%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f6476.0
Applied rewrites76.0%
Taylor expanded in w around 0
lower-+.f6474.7
Applied rewrites74.7%
Taylor expanded in w around 0
Applied rewrites83.4%
if +inf.0 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
lift-*.f64N/A
lift-exp.f64N/A
lift-neg.f64N/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-exp.f6444.1
Applied rewrites44.1%
Final simplification83.4%
(FPCore (w l) :precision binary64 (let* ((t_0 (exp (- w)))) (if (<= (* (pow l (exp w)) t_0) INFINITY) (* 1.0 (pow l (+ 1.0 w))) t_0)))
double code(double w, double l) {
double t_0 = exp(-w);
double tmp;
if ((pow(l, exp(w)) * t_0) <= ((double) INFINITY)) {
tmp = 1.0 * pow(l, (1.0 + w));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double w, double l) {
double t_0 = Math.exp(-w);
double tmp;
if ((Math.pow(l, Math.exp(w)) * t_0) <= Double.POSITIVE_INFINITY) {
tmp = 1.0 * Math.pow(l, (1.0 + w));
} else {
tmp = t_0;
}
return tmp;
}
def code(w, l): t_0 = math.exp(-w) tmp = 0 if (math.pow(l, math.exp(w)) * t_0) <= math.inf: tmp = 1.0 * math.pow(l, (1.0 + w)) else: tmp = t_0 return tmp
function code(w, l) t_0 = exp(Float64(-w)) tmp = 0.0 if (Float64((l ^ exp(w)) * t_0) <= Inf) tmp = Float64(1.0 * (l ^ Float64(1.0 + w))); else tmp = t_0; end return tmp end
function tmp_2 = code(w, l) t_0 = exp(-w); tmp = 0.0; if (((l ^ exp(w)) * t_0) <= Inf) tmp = 1.0 * (l ^ (1.0 + w)); else tmp = t_0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[Exp[(-w)], $MachinePrecision]}, If[LessEqual[N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * t$95$0), $MachinePrecision], Infinity], N[(1.0 * N[Power[l, N[(1.0 + w), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$0]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{-w}\\
\mathbf{if}\;{\ell}^{\left(e^{w}\right)} \cdot t\_0 \leq \infty:\\
\;\;\;\;1 \cdot {\ell}^{\left(1 + w\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < +inf.0Initial program 99.6%
Taylor expanded in w around 0
Applied rewrites72.8%
Taylor expanded in w around 0
lower-+.f6482.8
Applied rewrites82.8%
if +inf.0 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
lift-*.f64N/A
lift-exp.f64N/A
lift-neg.f64N/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-exp.f6444.1
Applied rewrites44.1%
Final simplification82.8%
(FPCore (w l) :precision binary64 (if (<= (* (pow l (exp w)) (exp (- w))) 5e-93) (/ (fma (* w w) -2.0 1.0) (* (- 1.0 (* w w)) (+ 1.0 w))) (fma (fma (fma -0.16666666666666666 w 0.5) w -1.0) w 1.0)))
double code(double w, double l) {
double tmp;
if ((pow(l, exp(w)) * exp(-w)) <= 5e-93) {
tmp = fma((w * w), -2.0, 1.0) / ((1.0 - (w * w)) * (1.0 + w));
} else {
tmp = fma(fma(fma(-0.16666666666666666, w, 0.5), w, -1.0), w, 1.0);
}
return tmp;
}
function code(w, l) tmp = 0.0 if (Float64((l ^ exp(w)) * exp(Float64(-w))) <= 5e-93) tmp = Float64(fma(Float64(w * w), -2.0, 1.0) / Float64(Float64(1.0 - Float64(w * w)) * Float64(1.0 + w))); else tmp = fma(fma(fma(-0.16666666666666666, w, 0.5), w, -1.0), w, 1.0); end return tmp end
code[w_, l_] := If[LessEqual[N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] * N[Exp[(-w)], $MachinePrecision]), $MachinePrecision], 5e-93], N[(N[(N[(w * w), $MachinePrecision] * -2.0 + 1.0), $MachinePrecision] / N[(N[(1.0 - N[(w * w), $MachinePrecision]), $MachinePrecision] * N[(1.0 + w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.16666666666666666 * w + 0.5), $MachinePrecision] * w + -1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;{\ell}^{\left(e^{w}\right)} \cdot e^{-w} \leq 5 \cdot 10^{-93}:\\
\;\;\;\;\frac{\mathsf{fma}\left(w \cdot w, -2, 1\right)}{\left(1 - w \cdot w\right) \cdot \left(1 + w\right)}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right), w, -1\right), w, 1\right)\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 4.99999999999999994e-93Initial program 99.6%
lift-pow.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-eval48.6
Applied rewrites48.6%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f643.3
Applied rewrites3.3%
Applied rewrites2.6%
Taylor expanded in w around 0
Applied rewrites10.0%
if 4.99999999999999994e-93 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.6%
lift-pow.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-eval42.0
Applied rewrites42.0%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6428.9
Applied rewrites28.9%
Final simplification22.9%
(FPCore (w l) :precision binary64 (exp (- w)))
double code(double w, double l) {
return exp(-w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w)
end function
public static double code(double w, double l) {
return Math.exp(-w);
}
def code(w, l): return math.exp(-w)
function code(w, l) return exp(Float64(-w)) end
function tmp = code(w, l) tmp = exp(-w); end
code[w_, l_] := N[Exp[(-w)], $MachinePrecision]
\begin{array}{l}
\\
e^{-w}
\end{array}
Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
lift-*.f64N/A
lift-exp.f64N/A
lift-neg.f64N/A
*-rgt-identityN/A
lift-neg.f64N/A
lift-exp.f6444.1
Applied rewrites44.1%
(FPCore (w l)
:precision binary64
(let* ((t_0 (* (- 1.0 (* w w)) (+ 1.0 w))))
(if (<= w -5.6e+102)
(fma (fma (fma -0.16666666666666666 w 0.5) w -1.0) w 1.0)
(if (<= w -1e-42)
(/ (fma (fma w w -2.0) (* w w) 1.0) t_0)
(/ (fma (* w w) -2.0 1.0) t_0)))))
double code(double w, double l) {
double t_0 = (1.0 - (w * w)) * (1.0 + w);
double tmp;
if (w <= -5.6e+102) {
tmp = fma(fma(fma(-0.16666666666666666, w, 0.5), w, -1.0), w, 1.0);
} else if (w <= -1e-42) {
tmp = fma(fma(w, w, -2.0), (w * w), 1.0) / t_0;
} else {
tmp = fma((w * w), -2.0, 1.0) / t_0;
}
return tmp;
}
function code(w, l) t_0 = Float64(Float64(1.0 - Float64(w * w)) * Float64(1.0 + w)) tmp = 0.0 if (w <= -5.6e+102) tmp = fma(fma(fma(-0.16666666666666666, w, 0.5), w, -1.0), w, 1.0); elseif (w <= -1e-42) tmp = Float64(fma(fma(w, w, -2.0), Float64(w * w), 1.0) / t_0); else tmp = Float64(fma(Float64(w * w), -2.0, 1.0) / t_0); end return tmp end
code[w_, l_] := Block[{t$95$0 = N[(N[(1.0 - N[(w * w), $MachinePrecision]), $MachinePrecision] * N[(1.0 + w), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -5.6e+102], N[(N[(N[(-0.16666666666666666 * w + 0.5), $MachinePrecision] * w + -1.0), $MachinePrecision] * w + 1.0), $MachinePrecision], If[LessEqual[w, -1e-42], N[(N[(N[(w * w + -2.0), $MachinePrecision] * N[(w * w), $MachinePrecision] + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision], N[(N[(N[(w * w), $MachinePrecision] * -2.0 + 1.0), $MachinePrecision] / t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(1 - w \cdot w\right) \cdot \left(1 + w\right)\\
\mathbf{if}\;w \leq -5.6 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right), w, -1\right), w, 1\right)\\
\mathbf{elif}\;w \leq -1 \cdot 10^{-42}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(w, w, -2\right), w \cdot w, 1\right)}{t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(w \cdot w, -2, 1\right)}{t\_0}\\
\end{array}
\end{array}
if w < -5.60000000000000037e102Initial program 100.0%
lift-pow.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 rewrites100.0%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
if -5.60000000000000037e102 < w < -1.00000000000000004e-42Initial program 98.9%
lift-pow.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-eval60.8
Applied rewrites60.8%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f644.4
Applied rewrites4.4%
Applied rewrites18.5%
Taylor expanded in w around 0
Applied rewrites18.5%
if -1.00000000000000004e-42 < w Initial program 99.7%
lift-pow.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-eval26.1
Applied rewrites26.1%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f644.5
Applied rewrites4.5%
Applied rewrites4.2%
Taylor expanded in w around 0
Applied rewrites7.7%
(FPCore (w l) :precision binary64 (fma (fma (fma -0.16666666666666666 w 0.5) w -1.0) w 1.0))
double code(double w, double l) {
return fma(fma(fma(-0.16666666666666666, w, 0.5), w, -1.0), w, 1.0);
}
function code(w, l) return fma(fma(fma(-0.16666666666666666, w, 0.5), w, -1.0), w, 1.0) end
code[w_, l_] := N[(N[(N[(-0.16666666666666666 * w + 0.5), $MachinePrecision] * w + -1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(-0.16666666666666666, w, 0.5\right), w, -1\right), w, 1\right)
\end{array}
Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6420.6
Applied rewrites20.6%
(FPCore (w l) :precision binary64 (fma (fma 0.5 w -1.0) w 1.0))
double code(double w, double l) {
return fma(fma(0.5, w, -1.0), w, 1.0);
}
function code(w, l) return fma(fma(0.5, w, -1.0), w, 1.0) end
code[w_, l_] := N[(N[(0.5 * w + -1.0), $MachinePrecision] * w + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\mathsf{fma}\left(0.5, w, -1\right), w, 1\right)
\end{array}
Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
sub-negN/A
lft-mult-inverseN/A
distribute-lft-neg-outN/A
distribute-rgt-inN/A
sub-negN/A
lower-fma.f64N/A
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lft-mult-inverseN/A
metadata-evalN/A
lower-fma.f6414.8
Applied rewrites14.8%
(FPCore (w l) :precision binary64 (fma (* 0.5 w) w 1.0))
double code(double w, double l) {
return fma((0.5 * w), w, 1.0);
}
function code(w, l) return fma(Float64(0.5 * w), w, 1.0) end
code[w_, l_] := N[(N[(0.5 * w), $MachinePrecision] * w + 1.0), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(0.5 \cdot w, w, 1\right)
\end{array}
Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
sub-negN/A
lft-mult-inverseN/A
distribute-lft-neg-outN/A
distribute-rgt-inN/A
sub-negN/A
lower-fma.f64N/A
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lft-mult-inverseN/A
metadata-evalN/A
lower-fma.f6414.8
Applied rewrites14.8%
Taylor expanded in w around inf
Applied rewrites14.8%
(FPCore (w l) :precision binary64 (* (* w w) 0.5))
double code(double w, double l) {
return (w * w) * 0.5;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = (w * w) * 0.5d0
end function
public static double code(double w, double l) {
return (w * w) * 0.5;
}
def code(w, l): return (w * w) * 0.5
function code(w, l) return Float64(Float64(w * w) * 0.5) end
function tmp = code(w, l) tmp = (w * w) * 0.5; end
code[w_, l_] := N[(N[(w * w), $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
\\
\left(w \cdot w\right) \cdot 0.5
\end{array}
Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
Taylor expanded in w around 0
+-commutativeN/A
*-commutativeN/A
sub-negN/A
lft-mult-inverseN/A
distribute-lft-neg-outN/A
distribute-rgt-inN/A
sub-negN/A
lower-fma.f64N/A
sub-negN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lft-mult-inverseN/A
metadata-evalN/A
lower-fma.f6414.8
Applied rewrites14.8%
Taylor expanded in w around inf
Applied rewrites14.2%
(FPCore (w l) :precision binary64 (- 1.0 w))
double code(double w, double l) {
return 1.0 - w;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = 1.0d0 - w
end function
public static double code(double w, double l) {
return 1.0 - w;
}
def code(w, l): return 1.0 - w
function code(w, l) return Float64(1.0 - w) end
function tmp = code(w, l) tmp = 1.0 - w; end
code[w_, l_] := N[(1.0 - w), $MachinePrecision]
\begin{array}{l}
\\
1 - w
\end{array}
Initial program 99.6%
lift-pow.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-eval44.1
Applied rewrites44.1%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f644.7
Applied rewrites4.7%
herbie shell --seed 2024331
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))