
(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 13 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.3%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- w)) (pow l (exp w))) 5e-155) 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))) <= 5e-155) {
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))) <= 5e-155) 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], 5e-155], 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 5 \cdot 10^{-155}:\\
\;\;\;\;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))) < 4.9999999999999999e-155Initial program 99.7%
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 rewrites57.4%
if 4.9999999999999999e-155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.2%
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.6
Applied rewrites43.6%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6422.6
Applied rewrites22.6%
(FPCore (w l) :precision binary64 (if (<= (* (exp (- w)) (pow l (exp w))) 5e-155) 0.0 (- 1.0 w)))
double code(double w, double l) {
double tmp;
if ((exp(-w) * pow(l, exp(w))) <= 5e-155) {
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))) <= 5d-155) 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))) <= 5e-155) {
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))) <= 5e-155: 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))) <= 5e-155) 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))) <= 5e-155) 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], 5e-155], 0.0, N[(1.0 - w), $MachinePrecision]]
\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 - w\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 4.9999999999999999e-155Initial program 99.7%
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 rewrites57.4%
if 4.9999999999999999e-155 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.2%
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.6
Applied rewrites43.6%
Taylor expanded in w around 0
neg-mul-1N/A
sub-negN/A
lower--.f645.8
Applied rewrites5.8%
(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.7%
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 rewrites57.4%
if 1.12e-154 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 99.2%
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.6
Applied rewrites43.6%
Taylor expanded in w around 0
Applied rewrites4.8%
(FPCore (w l) :precision binary64 (if (<= w -1.0) (exp (- w)) (* l (* (pow l w) (- 1.0 w)))))
double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = exp(-w);
} else {
tmp = l * (pow(l, w) * (1.0 - w));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-1.0d0)) then
tmp = exp(-w)
else
tmp = l * ((l ** w) * (1.0d0 - w))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -1.0) {
tmp = Math.exp(-w);
} else {
tmp = l * (Math.pow(l, w) * (1.0 - w));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.0: tmp = math.exp(-w) else: tmp = l * (math.pow(l, w) * (1.0 - w)) return tmp
function code(w, l) tmp = 0.0 if (w <= -1.0) tmp = exp(Float64(-w)); else tmp = Float64(l * Float64((l ^ w) * Float64(1.0 - w))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -1.0) tmp = exp(-w); else tmp = l * ((l ^ w) * (1.0 - w)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.0], N[Exp[(-w)], $MachinePrecision], N[(l * N[(N[Power[l, w], $MachinePrecision] * N[(1.0 - w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot \left({\ell}^{w} \cdot \left(1 - w\right)\right)\\
\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-eval99.0
Applied rewrites99.0%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity99.0
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%
+-commutativeN/A
pow-plusN/A
lower-*.f64N/A
lower-pow.f6499.2
Applied rewrites99.2%
lift--.f64N/A
lift-pow.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6499.3
Applied rewrites99.3%
Final simplification99.2%
(FPCore (w l) :precision binary64 (if (<= w -0.98) (exp (- w)) (* l (pow l w))))
double code(double w, double l) {
double tmp;
if (w <= -0.98) {
tmp = exp(-w);
} else {
tmp = l * pow(l, w);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.98d0)) then
tmp = exp(-w)
else
tmp = l * (l ** w)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.98) {
tmp = Math.exp(-w);
} else {
tmp = l * Math.pow(l, w);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.98: tmp = math.exp(-w) else: tmp = l * math.pow(l, w) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.98) tmp = exp(Float64(-w)); else tmp = Float64(l * (l ^ w)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.98) tmp = exp(-w); else tmp = l * (l ^ w); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.98], N[Exp[(-w)], $MachinePrecision], N[(l * N[Power[l, w], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.98:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;\ell \cdot {\ell}^{w}\\
\end{array}
\end{array}
if w < -0.97999999999999998Initial 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-eval99.0
Applied rewrites99.0%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity99.0
Applied rewrites99.0%
if -0.97999999999999998 < w Initial program 99.1%
Taylor expanded in w around 0
Applied rewrites99.0%
Taylor expanded in w around 0
+-commutativeN/A
lower-+.f6499.0
Applied rewrites99.0%
pow-plusN/A
lift-pow.f64N/A
lift-*.f64N/A
*-lft-identity99.1
Applied rewrites99.1%
Final simplification99.0%
(FPCore (w l) :precision binary64 (if (<= w -0.98) (exp (- w)) (pow l (+ w 1.0))))
double code(double w, double l) {
double tmp;
if (w <= -0.98) {
tmp = 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 <= (-0.98d0)) then
tmp = 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 <= -0.98) {
tmp = Math.exp(-w);
} else {
tmp = Math.pow(l, (w + 1.0));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.98: tmp = math.exp(-w) else: tmp = math.pow(l, (w + 1.0)) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.98) tmp = exp(Float64(-w)); else tmp = l ^ Float64(w + 1.0); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.98) tmp = exp(-w); else tmp = l ^ (w + 1.0); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.98], N[Exp[(-w)], $MachinePrecision], N[Power[l, N[(w + 1.0), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.98:\\
\;\;\;\;e^{-w}\\
\mathbf{else}:\\
\;\;\;\;{\ell}^{\left(w + 1\right)}\\
\end{array}
\end{array}
if w < -0.97999999999999998Initial 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-eval99.0
Applied rewrites99.0%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity99.0
Applied rewrites99.0%
if -0.97999999999999998 < w Initial program 99.1%
Taylor expanded in w around 0
Applied rewrites99.0%
Taylor expanded in w around 0
+-commutativeN/A
lower-+.f6499.0
Applied rewrites99.0%
lift-+.f64N/A
sqr-powN/A
associate-*r*N/A
*-lft-identityN/A
sqr-powN/A
lift-pow.f6499.0
Applied rewrites99.0%
(FPCore (w l) :precision binary64 (if (<= w -0.7) (exp (- w)) (if (<= w 0.11) (* l (- 1.0 w)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.7) {
tmp = exp(-w);
} else if (w <= 0.11) {
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.7d0)) then
tmp = exp(-w)
else if (w <= 0.11d0) 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.7) {
tmp = Math.exp(-w);
} else if (w <= 0.11) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.7: tmp = math.exp(-w) elif w <= 0.11: tmp = l * (1.0 - w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.7) tmp = exp(Float64(-w)); elseif (w <= 0.11) 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.7) tmp = exp(-w); elseif (w <= 0.11) tmp = l * (1.0 - w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.7], N[Exp[(-w)], $MachinePrecision], If[LessEqual[w, 0.11], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.7:\\
\;\;\;\;e^{-w}\\
\mathbf{elif}\;w \leq 0.11:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.69999999999999996Initial 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-eval99.0
Applied rewrites99.0%
lift-neg.f64N/A
lift-exp.f64N/A
*-rgt-identity99.0
Applied rewrites99.0%
if -0.69999999999999996 < w < 0.110000000000000001Initial program 99.5%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6499.4
Applied rewrites99.4%
Taylor expanded in w around 0
lower-+.f6499.4
Applied rewrites99.4%
+-commutativeN/A
pow-plusN/A
lower-*.f64N/A
lower-pow.f6499.8
Applied rewrites99.8%
Taylor expanded in w around 0
Applied rewrites98.2%
if 0.110000000000000001 < w Initial program 97.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 rewrites97.3%
Final simplification98.3%
(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 -7.5e+61)
(fma
(* w (fma t_0 t_0 -1.0))
(/ 1.0 (fma w (fma w -0.16666666666666666 0.5) 1.0))
1.0)
(if (<= w 0.11) (* l (- 1.0 w)) 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 <= -7.5e+61) {
tmp = fma((w * fma(t_0, t_0, -1.0)), (1.0 / fma(w, fma(w, -0.16666666666666666, 0.5), 1.0)), 1.0);
} else if (w <= 0.11) {
tmp = l * (1.0 - w);
} 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 <= -7.5e+61) tmp = fma(Float64(w * fma(t_0, t_0, -1.0)), Float64(1.0 / fma(w, fma(w, -0.16666666666666666, 0.5), 1.0)), 1.0); elseif (w <= 0.11) tmp = Float64(l * Float64(1.0 - w)); 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, -7.5e+61], N[(N[(w * N[(t$95$0 * t$95$0 + -1.0), $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(w * N[(w * -0.16666666666666666 + 0.5), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 0.11], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 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 -7.5 \cdot 10^{+61}:\\
\;\;\;\;\mathsf{fma}\left(w \cdot \mathsf{fma}\left(t\_0, t\_0, -1\right), \frac{1}{\mathsf{fma}\left(w, \mathsf{fma}\left(w, -0.16666666666666666, 0.5\right), 1\right)}, 1\right)\\
\mathbf{elif}\;w \leq 0.11:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.00000000000000001e155Initial 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 rewrites100.0%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64100.0
Applied rewrites100.0%
if -1.00000000000000001e155 < w < -7.5e61Initial 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 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.f6451.6
Applied rewrites51.6%
lift-fma.f64N/A
lift-fma.f64N/A
*-rgt-identityN/A
*-rgt-identityN/A
*-commutativeN/A
lift-fma.f64N/A
flip-+N/A
associate-*l/N/A
div-invN/A
lower-fma.f64N/A
Applied rewrites100.0%
if -7.5e61 < w < 0.110000000000000001Initial program 99.6%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6487.6
Applied rewrites87.6%
Taylor expanded in w around 0
lower-+.f6494.0
Applied rewrites94.0%
+-commutativeN/A
pow-plusN/A
lower-*.f64N/A
lower-pow.f6494.3
Applied rewrites94.3%
Taylor expanded in w around 0
Applied rewrites87.1%
if 0.110000000000000001 < w Initial program 97.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 rewrites97.3%
Final simplification91.5%
(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 -7.8e+62)
(fma
w
(/ (fma t_0 t_0 -1.0) (fma w (fma w -0.16666666666666666 0.5) 1.0))
1.0)
(if (<= w 0.11) (* l (- 1.0 w)) 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 <= -7.8e+62) {
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 <= 0.11) {
tmp = l * (1.0 - w);
} 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 <= -7.8e+62) 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 <= 0.11) tmp = Float64(l * Float64(1.0 - w)); 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, -7.8e+62], 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, 0.11], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 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 -7.8 \cdot 10^{+62}:\\
\;\;\;\;\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 0.11:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.00000000000000001e155Initial 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 rewrites100.0%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64100.0
Applied rewrites100.0%
if -1.00000000000000001e155 < w < -7.8e62Initial 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 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.f6451.6
Applied rewrites51.6%
lift-fma.f64N/A
flip-+N/A
lower-/.f64N/A
metadata-evalN/A
sub-negN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
sub-negN/A
metadata-evalN/A
lower-fma.f6483.6
Applied rewrites83.6%
if -7.8e62 < w < 0.110000000000000001Initial program 99.6%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6487.6
Applied rewrites87.6%
Taylor expanded in w around 0
lower-+.f6494.0
Applied rewrites94.0%
+-commutativeN/A
pow-plusN/A
lower-*.f64N/A
lower-pow.f6494.3
Applied rewrites94.3%
Taylor expanded in w around 0
Applied rewrites87.1%
if 0.110000000000000001 < w Initial program 97.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 rewrites97.3%
Final simplification90.0%
(FPCore (w l) :precision binary64 (if (<= w -1.4e+102) (* w (* -0.16666666666666666 (* w w))) (if (<= w 0.11) (* l (- 1.0 w)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -1.4e+102) {
tmp = w * (-0.16666666666666666 * (w * w));
} else if (w <= 0.11) {
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 <= (-1.4d+102)) then
tmp = w * ((-0.16666666666666666d0) * (w * w))
else if (w <= 0.11d0) 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 <= -1.4e+102) {
tmp = w * (-0.16666666666666666 * (w * w));
} else if (w <= 0.11) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -1.4e+102: tmp = w * (-0.16666666666666666 * (w * w)) elif w <= 0.11: tmp = l * (1.0 - w) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -1.4e+102) tmp = Float64(w * Float64(-0.16666666666666666 * Float64(w * w))); elseif (w <= 0.11) 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 <= -1.4e+102) tmp = w * (-0.16666666666666666 * (w * w)); elseif (w <= 0.11) tmp = l * (1.0 - w); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -1.4e+102], N[(w * N[(-0.16666666666666666 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.11], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -1.4 \cdot 10^{+102}:\\
\;\;\;\;w \cdot \left(-0.16666666666666666 \cdot \left(w \cdot w\right)\right)\\
\mathbf{elif}\;w \leq 0.11:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.40000000000000009e102Initial 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 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
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
unpow2N/A
lower-*.f64100.0
Applied rewrites100.0%
if -1.40000000000000009e102 < w < 0.110000000000000001Initial program 99.6%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6481.9
Applied rewrites81.9%
Taylor expanded in w around 0
lower-+.f6491.0
Applied rewrites91.0%
+-commutativeN/A
pow-plusN/A
lower-*.f64N/A
lower-pow.f6491.3
Applied rewrites91.3%
Taylor expanded in w around 0
Applied rewrites81.9%
if 0.110000000000000001 < w Initial program 97.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 rewrites97.3%
Final simplification87.3%
(FPCore (w l) :precision binary64 (if (<= w -2.45e+118) (fma w (fma w 0.5 -1.0) 1.0) (if (<= w 0.11) (* l (- 1.0 w)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -2.45e+118) {
tmp = fma(w, fma(w, 0.5, -1.0), 1.0);
} else if (w <= 0.11) {
tmp = l * (1.0 - w);
} else {
tmp = 0.0;
}
return tmp;
}
function code(w, l) tmp = 0.0 if (w <= -2.45e+118) tmp = fma(w, fma(w, 0.5, -1.0), 1.0); elseif (w <= 0.11) tmp = Float64(l * Float64(1.0 - w)); else tmp = 0.0; end return tmp end
code[w_, l_] := If[LessEqual[w, -2.45e+118], N[(w * N[(w * 0.5 + -1.0), $MachinePrecision] + 1.0), $MachinePrecision], If[LessEqual[w, 0.11], N[(l * N[(1.0 - w), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -2.45 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(w, \mathsf{fma}\left(w, 0.5, -1\right), 1\right)\\
\mathbf{elif}\;w \leq 0.11:\\
\;\;\;\;\ell \cdot \left(1 - w\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -2.4500000000000002e118Initial 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 rewrites100.0%
Taylor expanded in w around 0
+-commutativeN/A
lower-fma.f64N/A
sub-negN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f6482.5
Applied rewrites82.5%
if -2.4500000000000002e118 < w < 0.110000000000000001Initial program 99.6%
Taylor expanded in w around 0
neg-mul-1N/A
unsub-negN/A
lower--.f6480.5
Applied rewrites80.5%
Taylor expanded in w around 0
lower-+.f6490.0
Applied rewrites90.0%
+-commutativeN/A
pow-plusN/A
lower-*.f64N/A
lower-pow.f6490.4
Applied rewrites90.4%
Taylor expanded in w around 0
Applied rewrites81.7%
if 0.110000000000000001 < w Initial program 97.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 rewrites97.3%
Final simplification84.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%
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 rewrites16.5%
herbie shell --seed 2024216
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))