
(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 (if (<= w -2.55e-16) (exp (fma (log l) (exp w) (- w))) (* 1.0 (pow l (+ w 1.0)))))
double code(double w, double l) {
double tmp;
if (w <= -2.55e-16) {
tmp = exp(fma(log(l), exp(w), -w));
} else {
tmp = 1.0 * pow(l, (w + 1.0));
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -2.55e-16) tmp = exp(fma(log(l), exp(w), Float64(-w))); else tmp = Float64(1.0 * (l ^ Float64(w + 1.0))); end return tmp end
code[w_, l_] := If[LessEqual[w, -2.55e-16], N[Exp[N[(N[Log[l], $MachinePrecision] * N[Exp[w], $MachinePrecision] + (-w)), $MachinePrecision]], $MachinePrecision], N[(1.0 * N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -2.55 \cdot 10^{-16}:\\
\;\;\;\;e^{\mathsf{fma}\left(\log \ell, e^{w}, -w\right)}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\ell}^{\left(w + 1\right)}\\
\end{array}
\end{array}
if w < -2.55e-16Initial program 99.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6499.8
Applied rewrites99.8%
if -2.55e-16 < w Initial program 99.1%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6499.1
Applied rewrites99.1%
Taylor expanded in w around 0
lower-+.f6499.1
Applied rewrites99.1%
Taylor expanded in w around 0
Applied rewrites99.5%
Final simplification99.6%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- w)) (pow l (exp w))) 0.0) 0.0 l))
double code(double w, double l) {
double tmp;
if ((exp(-w) * pow(l, exp(w))) <= 0.0) {
tmp = 0.0;
} else {
tmp = l;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if ((exp(-w) * (l ** exp(w))) <= 0.0d0) then
tmp = 0.0d0
else
tmp = l
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))) <= 0.0) {
tmp = 0.0;
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if (math.exp(-w) * math.pow(l, math.exp(w))) <= 0.0: tmp = 0.0 else: tmp = l return tmp
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(-w)) * (l ^ exp(w))) <= 0.0) tmp = 0.0; else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((exp(-w) * (l ^ exp(w))) <= 0.0) tmp = 0.0; else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 0.0], 0.0, l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 0:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 0.0Initial program 100.0%
Applied rewrites100.0%
if 0.0 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.2%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.0%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6494.3
Applied rewrites94.3%
Applied rewrites94.2%
Taylor expanded in w around 0
Applied rewrites64.6%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- w)) (pow l (exp w))) 5e-155) 0.0 1.0))
double code(double w, double l) {
double tmp;
if ((exp(-w) * pow(l, exp(w))) <= 5e-155) {
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))) <= 5d-155) 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))) <= 5e-155) {
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))) <= 5e-155: tmp = 0.0 else: tmp = 1.0 return tmp
function code(w, l) tmp = 0.0 if (Float64(exp(Float64(-w)) * (l ^ exp(w))) <= 5e-155) 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))) <= 5e-155) 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], 5e-155], 0.0, 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{-w} \cdot {\ell}^{\left(e^{w}\right)} \leq 5 \cdot 10^{-155}:\\
\;\;\;\;0\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 4.9999999999999999e-155Initial program 99.7%
Applied rewrites57.4%
if 4.9999999999999999e-155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.2%
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-eval43.6
Applied rewrites43.6%
Taylor expanded in w around 0
Applied rewrites4.8%
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
Initial program 99.3%
(FPCore (w l) :precision binary64 (if (<= l 7.2e-5) (* (pow l (+ w 1.0)) (- 1.0 w)) (* (fma w (fma w 0.5 -1.0) 1.0) (pow l (fma w (fma w 0.5 1.0) 1.0)))))
double code(double w, double l) {
double tmp;
if (l <= 7.2e-5) {
tmp = pow(l, (w + 1.0)) * (1.0 - w);
} else {
tmp = fma(w, fma(w, 0.5, -1.0), 1.0) * pow(l, fma(w, fma(w, 0.5, 1.0), 1.0));
}
return tmp;
}
function code(w, l) tmp = 0.0 if (l <= 7.2e-5) tmp = Float64((l ^ Float64(w + 1.0)) * Float64(1.0 - w)); else tmp = Float64(fma(w, fma(w, 0.5, -1.0), 1.0) * (l ^ fma(w, fma(w, 0.5, 1.0), 1.0))); end return tmp end
code[w_, l_] := If[LessEqual[l, 7.2e-5], N[(N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision] * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], N[(N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision] * N[Power[l, N[(w * N[(w * 0.5 + 1.0), $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 7.2 \cdot 10^{-5}:\\
\;\;\;\;{\ell}^{\left(w + 1\right)} \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right) \cdot {\ell}^{\left(\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, 1\right), 1\right)\right)}\\
\end{array}
\end{array}
if l < 7.20000000000000018e-5Initial program 99.8%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6472.0
Applied rewrites72.0%
Taylor expanded in w around 0
lower-+.f6499.8
Applied rewrites99.8%
if 7.20000000000000018e-5 < l Initial program 98.7%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6483.3
Applied rewrites83.3%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.7
Applied rewrites98.7%
Final simplification99.4%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (exp (- w)) (* 1.0 (pow l (+ w 1.0)))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = exp(-w);
} else {
tmp = 1.0 * 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 = exp(-w)
else
tmp = 1.0d0 * (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 = Math.exp(-w);
} else {
tmp = 1.0 * Math.pow(l, (w + 1.0));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = math.exp(-w) else: tmp = 1.0 * math.pow(l, (w + 1.0)) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = exp(Float64(-w)); else tmp = Float64(1.0 * (l ^ 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 = 1.0 * (l ^ (w + 1.0)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[Exp[(-w)], $MachinePrecision], N[(1.0 * N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;1 \cdot {\ell}^{\left(w + 1\right)}\\
\end{array}
\end{array}
if w < -1Initial program 100.0%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in w around inf
Applied rewrites99.0%
if -1 < w Initial program 99.1%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6499.0
Applied rewrites99.0%
Taylor expanded in w around 0
lower-+.f6498.9
Applied rewrites98.9%
Taylor expanded in w around 0
Applied rewrites99.0%
Final simplification99.0%
(FPCore (w l) :precision binary64 (if (<= w -0.7) (exp (- w)) (if (<= w 135000.0) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.7) {
tmp = exp(-w);
} else if (w <= 135000.0) {
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.7d0)) then
tmp = exp(-w)
else if (w <= 135000.0d0) 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.7) {
tmp = Math.exp(-w);
} else if (w <= 135000.0) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.7: tmp = math.exp(-w) elif w <= 135000.0: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.7) tmp = exp(Float64(-w)); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.7) tmp = exp(-w); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.7], N[Exp[(-w)], $MachinePrecision], If[LessEqual[w, 135000.0], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7:\\
\;\;\;\;e^{-w}\\
\mathbf{elif}\;w \leq 135000:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.69999999999999996Initial program 100.0%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites98.8%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in w around inf
Applied rewrites99.0%
if -0.69999999999999996 < w < 135000Initial program 98.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
Applied rewrites91.1%
Taylor expanded in w around 0
Applied rewrites97.5%
if 135000 < w Initial program 100.0%
Applied rewrites100.0%
(FPCore (w l)
:precision binary64
(let* ((t_0 (fma w (fma w -0.16666666666666666 0.5) -1.0)) (t_1 (* w t_0)))
(if (<= w -1e+103)
(* w (* -0.16666666666666666 (* w w)))
(if (<= w -0.7)
(/ (fma t_1 t_1 -1.0) (fma w t_0 -1.0))
(if (<= w 135000.0) l 0.0)))))
double code(double w, double l) {
double t_0 = fma(w, fma(w, -0.16666666666666666, 0.5), -1.0);
double t_1 = w * t_0;
double tmp;
if (w <= -1e+103) {
tmp = w * (-0.16666666666666666 * (w * w));
} else if (w <= -0.7) {
tmp = fma(t_1, t_1, -1.0) / fma(w, t_0, -1.0);
} else if (w <= 135000.0) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) t_0 = fma(w, fma(w, -0.16666666666666666, 0.5), -1.0) t_1 = Float64(w * t_0) tmp = 0.0 if (w <= -1e+103) tmp = Float64(w * Float64(-0.16666666666666666 * Float64(w * w))); elseif (w <= -0.7) tmp = Float64(fma(t_1, t_1, -1.0) / fma(w, t_0, -1.0)); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision]}, Block[{t$95$1 = N[(w * t$95$0), $MachinePrecision]}, If[LessEqual[w, -1e+103], N[(w * N[(-0.16666666666666666 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, -0.7], N[(N[(t$95$1 * t$95$1 + -1.0), $MachinePrecision] / N[(w * t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 135000.0], l, 0.0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), -1\right)\\
t_1 := w \cdot t\_0\\
\mathbf{if}\;w \leq -1 \cdot 10^{+103}:\\
\;\;\;\;w \cdot \left(-0.16666666666666666 \cdot \left(w \cdot w\right)\right)\\
\mathbf{elif}\;w \leq -0.7:\\
\;\;\;\;\frac{\mathsf{fma}\left(t\_1, t\_1, -1\right)}{\mathsf{fma}\left(w, t\_0, -1\right)}\\
\mathbf{elif}\;w \leq 135000:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1e103Initial 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
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64100.0
Applied rewrites100.0%
Taylor expanded in w around inf
Applied rewrites100.0%
if -1e103 < w < -0.69999999999999996Initial 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-eval97.5
Applied rewrites97.5%
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.f645.5
Applied rewrites5.5%
Applied rewrites43.2%
if -0.69999999999999996 < w < 135000Initial program 98.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
Applied rewrites91.1%
Taylor expanded in w around 0
Applied rewrites97.5%
if 135000 < w Initial program 100.0%
Applied rewrites100.0%
(FPCore (w l)
:precision binary64
(let* ((t_0 (* w (fma w -0.16666666666666666 0.5))))
(if (<= w -1e+155)
(fma w (fma w 0.5 -1.0) 1.0)
(if (<= w -0.7)
(fma
w
(/ (fma t_0 t_0 -1.0) (fma w (fma w -0.16666666666666666 0.5) 1.0))
1.0)
(if (<= w 135000.0) l 0.0)))))
double code(double w, double l) {
double t_0 = w * fma(w, -0.16666666666666666, 0.5);
double tmp;
if (w <= -1e+155) {
tmp = fma(w, fma(w, 0.5, -1.0), 1.0);
} else if (w <= -0.7) {
tmp = fma(w, (fma(t_0, t_0, -1.0) / fma(w, fma(w, -0.16666666666666666, 0.5), 1.0)), 1.0);
} else if (w <= 135000.0) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) t_0 = Float64(w * fma(w, -0.16666666666666666, 0.5)) tmp = 0.0 if (w <= -1e+155) tmp = fma(w, fma(w, 0.5, -1.0), 1.0); elseif (w <= -0.7) tmp = fma(w, Float64(fma(t_0, t_0, -1.0) / fma(w, fma(w, -0.16666666666666666, 0.5), 1.0)), 1.0); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -1e+155], N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, -0.7], N[(w * N[(N[(t$95$0 * t$95$0 + -1.0), $MachinePrecision] / N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 135000.0], l, 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right)\\
\mathbf{if}\;w \leq -1 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right)\\
\mathbf{elif}\;w \leq -0.7:\\
\;\;\;\;\mathsf{fma}\left(w, \frac{\mathsf{fma}\left(t\_0, t\_0, -1\right)}{\mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), 1\right)}, 1\right)\\
\mathbf{elif}\;w \leq 135000:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.00000000000000001e155Initial 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
sub-negN/A
metadata-evalN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
distribute-lft-neg-outN/A
distribute-rgt-inN/A
+-commutativeN/A
sub-negN/A
lower-fma.f64N/A
sub-negN/A
distribute-lft-inN/A
distribute-rgt-neg-outN/A
rgt-mult-inverseN/A
metadata-evalN/A
lower-fma.f64100.0
Applied rewrites100.0%
if -1.00000000000000001e155 < w < -0.69999999999999996Initial 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-eval98.2
Applied rewrites98.2%
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.f6429.7
Applied rewrites29.7%
Applied rewrites46.8%
if -0.69999999999999996 < w < 135000Initial program 98.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
Applied rewrites91.1%
Taylor expanded in w around 0
Applied rewrites97.5%
if 135000 < w Initial program 100.0%
Applied rewrites100.0%
(FPCore (w l) :precision binary64 (if (<= w -0.7) (fma w (fma w (fma w -0.16666666666666666 0.5) -1.0) 1.0) (if (<= w 135000.0) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.7) {
tmp = fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0);
} else if (w <= 135000.0) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -0.7) tmp = fma(w, fma(w, fma(w, -0.16666666666666666, 0.5), -1.0), 1.0); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, -0.7], N[(w * N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 135000.0], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), -1\right), 1\right)\\
\mathbf{elif}\;w \leq 135000:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.69999999999999996Initial 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-eval99.0
Applied rewrites99.0%
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.f6460.7
Applied rewrites60.7%
if -0.69999999999999996 < w < 135000Initial program 98.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
Applied rewrites91.1%
Taylor expanded in w around 0
Applied rewrites97.5%
if 135000 < w Initial program 100.0%
Applied rewrites100.0%
(FPCore (w l) :precision binary64 (if (<= w -0.7) (fma w (fma w (* w -0.16666666666666666) -1.0) 1.0) (if (<= w 135000.0) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.7) {
tmp = fma(w, fma(w, (w * -0.16666666666666666), -1.0), 1.0);
} else if (w <= 135000.0) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -0.7) tmp = fma(w, fma(w, Float64(w * -0.16666666666666666), -1.0), 1.0); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, -0.7], N[(w * N[(w * N[(w * -0.16666666666666666), $MachinePrecision] + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 135000.0], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, w \cdot -0.16666666666666666, -1\right), 1\right)\\
\mathbf{elif}\;w \leq 135000:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.69999999999999996Initial 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-eval99.0
Applied rewrites99.0%
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.f6460.7
Applied rewrites60.7%
Taylor expanded in w around inf
Applied rewrites60.7%
if -0.69999999999999996 < w < 135000Initial program 98.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
Applied rewrites91.1%
Taylor expanded in w around 0
Applied rewrites97.5%
if 135000 < w Initial program 100.0%
Applied rewrites100.0%
(FPCore (w l) :precision binary64 (if (<= w -0.7) (fma w (* -0.16666666666666666 (* w w)) 1.0) (if (<= w 135000.0) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.7) {
tmp = fma(w, (-0.16666666666666666 * (w * w)), 1.0);
} else if (w <= 135000.0) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -0.7) tmp = fma(w, Float64(-0.16666666666666666 * Float64(w * w)), 1.0); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, -0.7], N[(w * N[(-0.16666666666666666 * N[(w * w), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 135000.0], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7:\\
\;\;\;\;\mathsf{fma}\left(w, -0.16666666666666666 \cdot \left(w \cdot w\right), 1\right)\\
\mathbf{elif}\;w \leq 135000:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.69999999999999996Initial 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-eval99.0
Applied rewrites99.0%
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.f6460.7
Applied rewrites60.7%
Taylor expanded in w around inf
Applied rewrites60.7%
if -0.69999999999999996 < w < 135000Initial program 98.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
Applied rewrites91.1%
Taylor expanded in w around 0
Applied rewrites97.5%
if 135000 < w Initial program 100.0%
Applied rewrites100.0%
(FPCore (w l) :precision binary64 (if (<= w -0.72) (* w (* -0.16666666666666666 (* w w))) (if (<= w 135000.0) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.72) {
tmp = w * (-0.16666666666666666 * (w * w));
} else if (w <= 135000.0) {
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.72d0)) then
tmp = w * ((-0.16666666666666666d0) * (w * w))
else if (w <= 135000.0d0) 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.72) {
tmp = w * (-0.16666666666666666 * (w * w));
} else if (w <= 135000.0) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.72: tmp = w * (-0.16666666666666666 * (w * w)) elif w <= 135000.0: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.72) tmp = Float64(w * Float64(-0.16666666666666666 * Float64(w * w))); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.72) tmp = w * (-0.16666666666666666 * (w * w)); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.72], N[(w * N[(-0.16666666666666666 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 135000.0], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.72:\\
\;\;\;\;w \cdot \left(-0.16666666666666666 \cdot \left(w \cdot w\right)\right)\\
\mathbf{elif}\;w \leq 135000:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.71999999999999997Initial 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-eval99.0
Applied rewrites99.0%
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.f6460.7
Applied rewrites60.7%
Taylor expanded in w around inf
Applied rewrites60.7%
if -0.71999999999999997 < w < 135000Initial program 98.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
Applied rewrites91.1%
Taylor expanded in w around 0
Applied rewrites97.5%
if 135000 < w Initial program 100.0%
Applied rewrites100.0%
(FPCore (w l) :precision binary64 (if (<= w -0.7) (fma w (fma w 0.5 -1.0) 1.0) (if (<= w 135000.0) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.7) {
tmp = fma(w, fma(w, 0.5, -1.0), 1.0);
} else if (w <= 135000.0) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -0.7) tmp = fma(w, fma(w, 0.5, -1.0), 1.0); elseif (w <= 135000.0) tmp = l; else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, -0.7], N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 135000.0], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right)\\
\mathbf{elif}\;w \leq 135000:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.69999999999999996Initial 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-eval99.0
Applied rewrites99.0%
Taylor expanded in w around 0
+-commutativeN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
metadata-evalN/A
lft-mult-inverseN/A
distribute-lft-neg-outN/A
distribute-rgt-inN/A
+-commutativeN/A
sub-negN/A
lower-fma.f64N/A
sub-negN/A
distribute-lft-inN/A
distribute-rgt-neg-outN/A
rgt-mult-inverseN/A
metadata-evalN/A
lower-fma.f6447.1
Applied rewrites47.1%
if -0.69999999999999996 < w < 135000Initial program 98.8%
Taylor expanded in w around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites99.2%
Taylor expanded in w around inf
exp-to-powN/A
remove-double-negN/A
log-recN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
prod-expN/A
lower-exp.f64N/A
+-commutativeN/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
lower-fma.f64N/A
lower-log.f64N/A
lower-exp.f64N/A
lower-neg.f6491.2
Applied rewrites91.2%
Applied rewrites91.1%
Taylor expanded in w around 0
Applied rewrites97.5%
if 135000 < w Initial program 100.0%
Applied rewrites100.0%
(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 rewrites16.5%
herbie shell --seed 2024216
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))