
(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 (- 0.0 w)) (pow l (exp w))))
double code(double w, double l) {
return exp((0.0 - w)) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp((0.0d0 - w)) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp((0.0 - w)) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp((0.0 - w)) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(0.0 - w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp((0.0 - w)) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[N[(0.0 - w), $MachinePrecision]], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{0 - w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (w l) :precision binary64 (/ (pow l (exp w)) (exp w)))
double code(double w, double l) {
return pow(l, exp(w)) / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = (l ** exp(w)) / exp(w)
end function
public static double code(double w, double l) {
return Math.pow(l, Math.exp(w)) / Math.exp(w);
}
def code(w, l): return math.pow(l, math.exp(w)) / math.exp(w)
function code(w, l) return Float64((l ^ exp(w)) / exp(w)) end
function tmp = code(w, l) tmp = (l ^ exp(w)) / exp(w); end
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}
\end{array}
Initial program 99.8%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.8%
Simplified99.8%
(FPCore (w l) :precision binary64 (/ l (exp w)))
double code(double w, double l) {
return l / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l / exp(w)
end function
public static double code(double w, double l) {
return l / Math.exp(w);
}
def code(w, l): return l / math.exp(w)
function code(w, l) return Float64(l / exp(w)) end
function tmp = code(w, l) tmp = l / exp(w); end
code[w_, l_] := N[(l / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\ell}{e^{w}}
\end{array}
Initial program 99.8%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.8%
Simplified99.8%
Taylor expanded in w around 0
Simplified98.9%
(FPCore (w l)
:precision binary64
(let* ((t_0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666)))))))
(if (<= w -1.02e+103)
(* l (* w (* -0.16666666666666666 (* w w))))
(if (<= w 0.215) (/ (* l (- 1.0 (* t_0 t_0))) (- 1.0 t_0)) 0.0))))
double code(double w, double l) {
double t_0 = w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))));
double tmp;
if (w <= -1.02e+103) {
tmp = l * (w * (-0.16666666666666666 * (w * w)));
} else if (w <= 0.215) {
tmp = (l * (1.0 - (t_0 * t_0))) / (1.0 - t_0);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0)))))
if (w <= (-1.02d+103)) then
tmp = l * (w * ((-0.16666666666666666d0) * (w * w)))
else if (w <= 0.215d0) then
tmp = (l * (1.0d0 - (t_0 * t_0))) / (1.0d0 - t_0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))));
double tmp;
if (w <= -1.02e+103) {
tmp = l * (w * (-0.16666666666666666 * (w * w)));
} else if (w <= 0.215) {
tmp = (l * (1.0 - (t_0 * t_0))) / (1.0 - t_0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): t_0 = w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))) tmp = 0 if w <= -1.02e+103: tmp = l * (w * (-0.16666666666666666 * (w * w))) elif w <= 0.215: tmp = (l * (1.0 - (t_0 * t_0))) / (1.0 - t_0) else: tmp = 0.0 return tmp
function code(w, l) t_0 = Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))))) tmp = 0.0 if (w <= -1.02e+103) tmp = Float64(l * Float64(w * Float64(-0.16666666666666666 * Float64(w * w)))); elseif (w <= 0.215) tmp = Float64(Float64(l * Float64(1.0 - Float64(t_0 * t_0))) / Float64(1.0 - t_0)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) t_0 = w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))); tmp = 0.0; if (w <= -1.02e+103) tmp = l * (w * (-0.16666666666666666 * (w * w))); elseif (w <= 0.215) tmp = (l * (1.0 - (t_0 * t_0))) / (1.0 - t_0); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[(w * N[(-1.0 + N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -1.02e+103], N[(l * N[(w * N[(-0.16666666666666666 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.215], N[(N[(l * N[(1.0 - N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision], 0.0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\\
\mathbf{if}\;w \leq -1.02 \cdot 10^{+103}:\\
\;\;\;\;\ell \cdot \left(w \cdot \left(-0.16666666666666666 \cdot \left(w \cdot w\right)\right)\right)\\
\mathbf{elif}\;w \leq 0.215:\\
\;\;\;\;\frac{\ell \cdot \left(1 - t\_0 \cdot t\_0\right)}{1 - t\_0}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -1.01999999999999991e103Initial program 100.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f64100.0%
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
Taylor expanded in w around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
if -1.01999999999999991e103 < w < 0.214999999999999997Initial program 99.6%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6482.7%
Simplified82.7%
Taylor expanded in w around 0
Simplified84.1%
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr92.5%
if 0.214999999999999997 < w Initial program 100.0%
Applied egg-rr100.0%
Final simplification95.1%
(FPCore (w l)
:precision binary64
(let* ((t_0 (+ 0.5 (* w -0.16666666666666666))) (t_1 (* w t_0)))
(if (<= w -2e+154)
(* l (* (* w w) 0.5))
(if (<= w 0.19)
(* l (+ 1.0 (/ (* w (- 1.0 (* w (* t_0 t_1)))) (- -1.0 t_1))))
0.0))))
double code(double w, double l) {
double t_0 = 0.5 + (w * -0.16666666666666666);
double t_1 = w * t_0;
double tmp;
if (w <= -2e+154) {
tmp = l * ((w * w) * 0.5);
} else if (w <= 0.19) {
tmp = l * (1.0 + ((w * (1.0 - (w * (t_0 * t_1)))) / (-1.0 - t_1)));
} else {
tmp = 0.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) :: t_1
real(8) :: tmp
t_0 = 0.5d0 + (w * (-0.16666666666666666d0))
t_1 = w * t_0
if (w <= (-2d+154)) then
tmp = l * ((w * w) * 0.5d0)
else if (w <= 0.19d0) then
tmp = l * (1.0d0 + ((w * (1.0d0 - (w * (t_0 * t_1)))) / ((-1.0d0) - t_1)))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = 0.5 + (w * -0.16666666666666666);
double t_1 = w * t_0;
double tmp;
if (w <= -2e+154) {
tmp = l * ((w * w) * 0.5);
} else if (w <= 0.19) {
tmp = l * (1.0 + ((w * (1.0 - (w * (t_0 * t_1)))) / (-1.0 - t_1)));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): t_0 = 0.5 + (w * -0.16666666666666666) t_1 = w * t_0 tmp = 0 if w <= -2e+154: tmp = l * ((w * w) * 0.5) elif w <= 0.19: tmp = l * (1.0 + ((w * (1.0 - (w * (t_0 * t_1)))) / (-1.0 - t_1))) else: tmp = 0.0 return tmp
function code(w, l) t_0 = Float64(0.5 + Float64(w * -0.16666666666666666)) t_1 = Float64(w * t_0) tmp = 0.0 if (w <= -2e+154) tmp = Float64(l * Float64(Float64(w * w) * 0.5)); elseif (w <= 0.19) tmp = Float64(l * Float64(1.0 + Float64(Float64(w * Float64(1.0 - Float64(w * Float64(t_0 * t_1)))) / Float64(-1.0 - t_1)))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) t_0 = 0.5 + (w * -0.16666666666666666); t_1 = w * t_0; tmp = 0.0; if (w <= -2e+154) tmp = l * ((w * w) * 0.5); elseif (w <= 0.19) tmp = l * (1.0 + ((w * (1.0 - (w * (t_0 * t_1)))) / (-1.0 - t_1))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(w * t$95$0), $MachinePrecision]}, If[LessEqual[w, -2e+154], N[(l * N[(N[(w * w), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.19], N[(l * N[(1.0 + N[(N[(w * N[(1.0 - N[(w * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 + w \cdot -0.16666666666666666\\
t_1 := w \cdot t\_0\\
\mathbf{if}\;w \leq -2 \cdot 10^{+154}:\\
\;\;\;\;\ell \cdot \left(\left(w \cdot w\right) \cdot 0.5\right)\\
\mathbf{elif}\;w \leq 0.19:\\
\;\;\;\;\ell \cdot \left(1 + \frac{w \cdot \left(1 - w \cdot \left(t\_0 \cdot t\_1\right)\right)}{-1 - t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -2.00000000000000007e154Initial program 100.0%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f64100.0%
Simplified100.0%
Taylor expanded in w around 0
Simplified100.0%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
--lowering--.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6473.4%
Simplified73.4%
Taylor expanded in w around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64100.0%
Simplified100.0%
Taylor expanded in w around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64100.0%
Simplified100.0%
if -2.00000000000000007e154 < w < 0.19Initial program 99.7%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6484.0%
Simplified84.0%
Taylor expanded in w around 0
Simplified85.3%
*-commutativeN/A
flip-+N/A
associate-*l/N/A
/-lowering-/.f64N/A
Applied egg-rr87.9%
if 0.19 < w Initial program 100.0%
Applied egg-rr100.0%
Final simplification91.4%
(FPCore (w l) :precision binary64 (if (<= w 0.23) (* l (+ 1.0 (* w (+ -1.0 (* w (+ 0.5 (* w -0.16666666666666666))))))) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.23) {
tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))));
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.23d0) then
tmp = l * (1.0d0 + (w * ((-1.0d0) + (w * (0.5d0 + (w * (-0.16666666666666666d0)))))))
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.23) {
tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666))))));
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.23: tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))))) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.23) tmp = Float64(l * Float64(1.0 + Float64(w * Float64(-1.0 + Float64(w * Float64(0.5 + Float64(w * -0.16666666666666666))))))); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.23) tmp = l * (1.0 + (w * (-1.0 + (w * (0.5 + (w * -0.16666666666666666)))))); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.23], N[(l * N[(1.0 + N[(w * N[(-1.0 + N[(w * N[(0.5 + N[(w * -0.16666666666666666), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.23:\\
\;\;\;\;\ell \cdot \left(1 + w \cdot \left(-1 + w \cdot \left(0.5 + w \cdot -0.16666666666666666\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.23000000000000001Initial program 99.7%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6486.6%
Simplified86.6%
Taylor expanded in w around 0
Simplified87.6%
if 0.23000000000000001 < w Initial program 100.0%
Applied egg-rr100.0%
Final simplification89.6%
(FPCore (w l) :precision binary64 (if (<= w -0.056) (* l (* w (* -0.16666666666666666 (* w w)))) (if (<= w 0.23) (/ l (+ w 1.0)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.056) {
tmp = l * (w * (-0.16666666666666666 * (w * w)));
} else if (w <= 0.23) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.056d0)) then
tmp = l * (w * ((-0.16666666666666666d0) * (w * w)))
else if (w <= 0.23d0) then
tmp = l / (w + 1.0d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.056) {
tmp = l * (w * (-0.16666666666666666 * (w * w)));
} else if (w <= 0.23) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.056: tmp = l * (w * (-0.16666666666666666 * (w * w))) elif w <= 0.23: tmp = l / (w + 1.0) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.056) tmp = Float64(l * Float64(w * Float64(-0.16666666666666666 * Float64(w * w)))); elseif (w <= 0.23) tmp = Float64(l / Float64(w + 1.0)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.056) tmp = l * (w * (-0.16666666666666666 * (w * w))); elseif (w <= 0.23) tmp = l / (w + 1.0); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.056], N[(l * N[(w * N[(-0.16666666666666666 * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.23], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.056:\\
\;\;\;\;\ell \cdot \left(w \cdot \left(-0.16666666666666666 \cdot \left(w \cdot w\right)\right)\right)\\
\mathbf{elif}\;w \leq 0.23:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.0560000000000000012Initial program 99.9%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6464.1%
Simplified64.1%
Taylor expanded in w around 0
Simplified68.3%
Taylor expanded in w around inf
*-commutativeN/A
cube-multN/A
unpow2N/A
associate-*l*N/A
*-commutativeN/A
unpow2N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6468.3%
Simplified68.3%
if -0.0560000000000000012 < w < 0.23000000000000001Initial program 99.6%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.6%
Simplified99.6%
Taylor expanded in w around 0
Simplified98.6%
Taylor expanded in w around 0
+-commutativeN/A
+-lowering-+.f6498.6%
Simplified98.6%
if 0.23000000000000001 < w Initial program 100.0%
Applied egg-rr100.0%
Final simplification89.6%
(FPCore (w l) :precision binary64 (if (<= w -0.052) (* w (* -0.16666666666666666 (* l (* w w)))) (if (<= w 0.21) (/ l (+ w 1.0)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.052) {
tmp = w * (-0.16666666666666666 * (l * (w * w)));
} else if (w <= 0.21) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.052d0)) then
tmp = w * ((-0.16666666666666666d0) * (l * (w * w)))
else if (w <= 0.21d0) then
tmp = l / (w + 1.0d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.052) {
tmp = w * (-0.16666666666666666 * (l * (w * w)));
} else if (w <= 0.21) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.052: tmp = w * (-0.16666666666666666 * (l * (w * w))) elif w <= 0.21: tmp = l / (w + 1.0) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.052) tmp = Float64(w * Float64(-0.16666666666666666 * Float64(l * Float64(w * w)))); elseif (w <= 0.21) tmp = Float64(l / Float64(w + 1.0)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.052) tmp = w * (-0.16666666666666666 * (l * (w * w))); elseif (w <= 0.21) tmp = l / (w + 1.0); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.052], N[(w * N[(-0.16666666666666666 * N[(l * N[(w * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.21], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.052:\\
\;\;\;\;w \cdot \left(-0.16666666666666666 \cdot \left(\ell \cdot \left(w \cdot w\right)\right)\right)\\
\mathbf{elif}\;w \leq 0.21:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.0519999999999999976Initial program 99.9%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
*-commutativeN/A
*-lowering-*.f6464.1%
Simplified64.1%
Taylor expanded in w around 0
Simplified68.3%
Taylor expanded in w around inf
associate-*r*N/A
unpow3N/A
unpow2N/A
associate-*r*N/A
unpow2N/A
associate-*l*N/A
associate-*r*N/A
*-lowering-*.f64N/A
associate-*l*N/A
associate-*r*N/A
unpow2N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6463.4%
Simplified63.4%
if -0.0519999999999999976 < w < 0.209999999999999992Initial program 99.6%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.6%
Simplified99.6%
Taylor expanded in w around 0
Simplified98.6%
Taylor expanded in w around 0
+-commutativeN/A
+-lowering-+.f6498.6%
Simplified98.6%
if 0.209999999999999992 < w Initial program 100.0%
Applied egg-rr100.0%
Final simplification88.1%
(FPCore (w l) :precision binary64 (if (<= w -0.068) (* l (* (* w w) 0.5)) (if (<= w 0.3) (/ l (+ w 1.0)) 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.068) {
tmp = l * ((w * w) * 0.5);
} else if (w <= 0.3) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.068d0)) then
tmp = l * ((w * w) * 0.5d0)
else if (w <= 0.3d0) then
tmp = l / (w + 1.0d0)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.068) {
tmp = l * ((w * w) * 0.5);
} else if (w <= 0.3) {
tmp = l / (w + 1.0);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.068: tmp = l * ((w * w) * 0.5) elif w <= 0.3: tmp = l / (w + 1.0) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.068) tmp = Float64(l * Float64(Float64(w * w) * 0.5)); elseif (w <= 0.3) tmp = Float64(l / Float64(w + 1.0)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.068) tmp = l * ((w * w) * 0.5); elseif (w <= 0.3) tmp = l / (w + 1.0); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.068], N[(l * N[(N[(w * w), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.3], N[(l / N[(w + 1.0), $MachinePrecision]), $MachinePrecision], 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.068:\\
\;\;\;\;\ell \cdot \left(\left(w \cdot w\right) \cdot 0.5\right)\\
\mathbf{elif}\;w \leq 0.3:\\
\;\;\;\;\frac{\ell}{w + 1}\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.068000000000000005Initial program 99.9%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.9%
Simplified99.9%
Taylor expanded in w around 0
Simplified98.8%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
--lowering--.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6445.2%
Simplified45.2%
Taylor expanded in w around inf
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f64N/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6457.2%
Simplified57.2%
Taylor expanded in w around inf
associate-*r*N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6457.2%
Simplified57.2%
if -0.068000000000000005 < w < 0.299999999999999989Initial program 99.6%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.6%
Simplified99.6%
Taylor expanded in w around 0
Simplified98.6%
Taylor expanded in w around 0
+-commutativeN/A
+-lowering-+.f6498.6%
Simplified98.6%
if 0.299999999999999989 < w Initial program 100.0%
Applied egg-rr100.0%
Final simplification86.2%
(FPCore (w l) :precision binary64 (if (<= w -0.0122) (* (- 0.0 w) l) (if (<= w 0.18) l 0.0)))
double code(double w, double l) {
double tmp;
if (w <= -0.0122) {
tmp = (0.0 - w) * l;
} else if (w <= 0.18) {
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.0122d0)) then
tmp = (0.0d0 - w) * l
else if (w <= 0.18d0) 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.0122) {
tmp = (0.0 - w) * l;
} else if (w <= 0.18) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.0122: tmp = (0.0 - w) * l elif w <= 0.18: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= -0.0122) tmp = Float64(Float64(0.0 - w) * l); elseif (w <= 0.18) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.0122) tmp = (0.0 - w) * l; elseif (w <= 0.18) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.0122], N[(N[(0.0 - w), $MachinePrecision] * l), $MachinePrecision], If[LessEqual[w, 0.18], l, 0.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.0122:\\
\;\;\;\;\left(0 - w\right) \cdot \ell\\
\mathbf{elif}\;w \leq 0.18:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < -0.0122000000000000008Initial program 99.9%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.9%
Simplified99.9%
Taylor expanded in w around 0
Simplified98.8%
Taylor expanded in w around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-outN/A
metadata-evalN/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
--lowering--.f64N/A
*-commutativeN/A
associate-*l*N/A
*-lowering-*.f64N/A
*-commutativeN/A
*-lowering-*.f6445.2%
Simplified45.2%
Taylor expanded in w around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-commutativeN/A
*-lowering-*.f6427.7%
Simplified27.7%
Taylor expanded in w around inf
mul-1-negN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
neg-sub0N/A
--lowering--.f6427.7%
Simplified27.7%
if -0.0122000000000000008 < w < 0.17999999999999999Initial program 99.6%
Taylor expanded in w around 0
Simplified98.6%
if 0.17999999999999999 < w Initial program 100.0%
Applied egg-rr100.0%
Final simplification77.2%
(FPCore (w l) :precision binary64 (if (<= w 0.18) (- l (* w l)) 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.18) {
tmp = l - (w * l);
} else {
tmp = 0.0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= 0.18d0) then
tmp = l - (w * l)
else
tmp = 0.0d0
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= 0.18) {
tmp = l - (w * l);
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.18: tmp = l - (w * l) else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.18) tmp = Float64(l - Float64(w * l)); else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.18) tmp = l - (w * l); else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.18], N[(l - N[(w * l), $MachinePrecision]), $MachinePrecision], 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.18:\\
\;\;\;\;\ell - w \cdot \ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.17999999999999999Initial program 99.7%
exp-negN/A
associate-*l/N/A
*-lft-identityN/A
/-lowering-/.f64N/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
exp-lowering-exp.f6499.7%
Simplified99.7%
Taylor expanded in w around 0
Simplified98.7%
Taylor expanded in w around 0
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
*-lowering-*.f6473.0%
Simplified73.0%
if 0.17999999999999999 < w Initial program 100.0%
Applied egg-rr100.0%
Final simplification77.2%
(FPCore (w l) :precision binary64 (if (<= w 0.235) l 0.0))
double code(double w, double l) {
double tmp;
if (w <= 0.235) {
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.235d0) 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.235) {
tmp = l;
} else {
tmp = 0.0;
}
return tmp;
}
def code(w, l): tmp = 0 if w <= 0.235: tmp = l else: tmp = 0.0 return tmp
function code(w, l) tmp = 0.0 if (w <= 0.235) tmp = l; else tmp = 0.0; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= 0.235) tmp = l; else tmp = 0.0; end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, 0.235], l, 0.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq 0.235:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;0\\
\end{array}
\end{array}
if w < 0.23499999999999999Initial program 99.7%
Taylor expanded in w around 0
Simplified64.4%
if 0.23499999999999999 < w Initial program 100.0%
Applied egg-rr100.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.8%
Applied egg-rr18.2%
herbie shell --seed 2024155
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))