
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * ((((y + z) + z) + y) + t)) + (y * 5.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
def code(x, y, z, t): return (x * ((((y + z) + z) + y) + t)) + (y * 5.0)
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function tmp = code(x, y, z, t) tmp = (x * ((((y + z) + z) + y) + t)) + (y * 5.0); end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\end{array}
(FPCore (x y z t) :precision binary64 (fma 5.0 y (* x (fma 2.0 (+ y z) t))))
double code(double x, double y, double z, double t) {
return fma(5.0, y, (x * fma(2.0, (y + z), t)));
}
function code(x, y, z, t) return fma(5.0, y, Float64(x * fma(2.0, Float64(y + z), t))) end
code[x_, y_, z_, t_] := N[(5.0 * y + N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(5, y, x \cdot \mathsf{fma}\left(2, y + z, t\right)\right)
\end{array}
Initial program 99.9%
associate-+l+N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around 0
distribute-lft-inN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f64100.0
Simplified100.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma x (fma 2.0 (+ y z) t) 0.0)))
(if (<= x -2.5)
t_1
(if (<= x 0.00045) (fma y 5.0 (* x (fma 2.0 z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(x, fma(2.0, (y + z), t), 0.0);
double tmp;
if (x <= -2.5) {
tmp = t_1;
} else if (x <= 0.00045) {
tmp = fma(y, 5.0, (x * fma(2.0, z, t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(x, fma(2.0, Float64(y + z), t), 0.0) tmp = 0.0 if (x <= -2.5) tmp = t_1; elseif (x <= 0.00045) tmp = fma(y, 5.0, Float64(x * fma(2.0, z, t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision] + 0.0), $MachinePrecision]}, If[LessEqual[x, -2.5], t$95$1, If[LessEqual[x, 0.00045], N[(y * 5.0 + N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), 0\right)\\
\mathbf{if}\;x \leq -2.5:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 0.00045:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot \mathsf{fma}\left(2, z, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.5 or 4.4999999999999999e-4 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified99.1%
if -2.5 < x < 4.4999999999999999e-4Initial program 99.9%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
associate-+l+N/A
+-commutativeN/A
flip-+N/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
+-inversesN/A
flip-+N/A
count-2N/A
accelerator-lowering-fma.f6499.3
Applied egg-rr99.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (fma x (fma 2.0 (+ y z) t) 0.0)))
(if (<= x -3.8e-23)
t_1
(if (<= x 8.2e-5) (fma 5.0 y (* x (fma 2.0 y t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(x, fma(2.0, (y + z), t), 0.0);
double tmp;
if (x <= -3.8e-23) {
tmp = t_1;
} else if (x <= 8.2e-5) {
tmp = fma(5.0, y, (x * fma(2.0, y, t)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(x, fma(2.0, Float64(y + z), t), 0.0) tmp = 0.0 if (x <= -3.8e-23) tmp = t_1; elseif (x <= 8.2e-5) tmp = fma(5.0, y, Float64(x * fma(2.0, y, t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision] + 0.0), $MachinePrecision]}, If[LessEqual[x, -3.8e-23], t$95$1, If[LessEqual[x, 8.2e-5], N[(5.0 * y + N[(x * N[(2.0 * y + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), 0\right)\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8.2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(5, y, x \cdot \mathsf{fma}\left(2, y, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.80000000000000011e-23 or 8.20000000000000009e-5 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified99.1%
if -3.80000000000000011e-23 < x < 8.20000000000000009e-5Initial program 99.9%
associate-+l+N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f6499.9
Applied egg-rr99.9%
Taylor expanded in x around 0
distribute-lft-inN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
distribute-lft-inN/A
*-lowering-*.f64N/A
+-commutativeN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f64100.0
Simplified100.0%
Taylor expanded in z around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6485.9
Simplified85.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma x (fma 2.0 (+ y z) t) 0.0))) (if (<= x -1e-22) t_1 (if (<= x 1.7e-5) (fma y 5.0 (* x t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(x, fma(2.0, (y + z), t), 0.0);
double tmp;
if (x <= -1e-22) {
tmp = t_1;
} else if (x <= 1.7e-5) {
tmp = fma(y, 5.0, (x * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(x, fma(2.0, Float64(y + z), t), 0.0) tmp = 0.0 if (x <= -1e-22) tmp = t_1; elseif (x <= 1.7e-5) tmp = fma(y, 5.0, Float64(x * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * N[(y + z), $MachinePrecision] + t), $MachinePrecision] + 0.0), $MachinePrecision]}, If[LessEqual[x, -1e-22], t$95$1, If[LessEqual[x, 1.7e-5], N[(y * 5.0 + N[(x * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \mathsf{fma}\left(2, y + z, t\right), 0\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(y, 5, x \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1e-22 or 1.7e-5 < x Initial program 100.0%
Taylor expanded in x around inf
Simplified99.1%
if -1e-22 < x < 1.7e-5Initial program 99.9%
Taylor expanded in t around inf
Simplified85.1%
+-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6485.1
Applied egg-rr85.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* z (+ x x))))
(if (<= x -2.8e-24)
t_1
(if (<= x 1.7e-5) (* 5.0 y) (if (<= x 3.6e+248) t_1 (* y (+ x x)))))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x + x);
double tmp;
if (x <= -2.8e-24) {
tmp = t_1;
} else if (x <= 1.7e-5) {
tmp = 5.0 * y;
} else if (x <= 3.6e+248) {
tmp = t_1;
} else {
tmp = y * (x + x);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x + x)
if (x <= (-2.8d-24)) then
tmp = t_1
else if (x <= 1.7d-5) then
tmp = 5.0d0 * y
else if (x <= 3.6d+248) then
tmp = t_1
else
tmp = y * (x + x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x + x);
double tmp;
if (x <= -2.8e-24) {
tmp = t_1;
} else if (x <= 1.7e-5) {
tmp = 5.0 * y;
} else if (x <= 3.6e+248) {
tmp = t_1;
} else {
tmp = y * (x + x);
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x + x) tmp = 0 if x <= -2.8e-24: tmp = t_1 elif x <= 1.7e-5: tmp = 5.0 * y elif x <= 3.6e+248: tmp = t_1 else: tmp = y * (x + x) return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x + x)) tmp = 0.0 if (x <= -2.8e-24) tmp = t_1; elseif (x <= 1.7e-5) tmp = Float64(5.0 * y); elseif (x <= 3.6e+248) tmp = t_1; else tmp = Float64(y * Float64(x + x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x + x); tmp = 0.0; if (x <= -2.8e-24) tmp = t_1; elseif (x <= 1.7e-5) tmp = 5.0 * y; elseif (x <= 3.6e+248) tmp = t_1; else tmp = y * (x + x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.8e-24], t$95$1, If[LessEqual[x, 1.7e-5], N[(5.0 * y), $MachinePrecision], If[LessEqual[x, 3.6e+248], t$95$1, N[(y * N[(x + x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + x\right)\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;5 \cdot y\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(x + x\right)\\
\end{array}
\end{array}
if x < -2.8000000000000002e-24 or 1.7e-5 < x < 3.60000000000000001e248Initial program 100.0%
associate-+l+N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f64100.0
Applied egg-rr100.0%
distribute-rgt-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6494.8
Applied egg-rr94.8%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
+-lowering-+.f6451.3
Simplified51.3%
if -2.8000000000000002e-24 < x < 1.7e-5Initial program 99.9%
Taylor expanded in x around 0
*-lowering-*.f6466.9
Simplified66.9%
if 3.60000000000000001e248 < x Initial program 100.0%
Taylor expanded in y around inf
+-lft-identityN/A
+-commutativeN/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
accelerator-lowering-fma.f6473.6
Simplified73.6%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f6473.6
Applied egg-rr73.6%
Taylor expanded in x around inf
count-2N/A
+-lowering-+.f6473.6
Simplified73.6%
Final simplification60.2%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (fma y 5.0 (* y (+ x x))))) (if (<= y -2.8e+38) t_1 (if (<= y 5e+84) (* x (fma 2.0 z t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = fma(y, 5.0, (y * (x + x)));
double tmp;
if (y <= -2.8e+38) {
tmp = t_1;
} else if (y <= 5e+84) {
tmp = x * fma(2.0, z, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = fma(y, 5.0, Float64(y * Float64(x + x))) tmp = 0.0 if (y <= -2.8e+38) tmp = t_1; elseif (y <= 5e+84) tmp = Float64(x * fma(2.0, z, t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * 5.0 + N[(y * N[(x + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.8e+38], t$95$1, If[LessEqual[y, 5e+84], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, 5, y \cdot \left(x + x\right)\right)\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+84}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.8e38 or 5.0000000000000001e84 < y Initial program 99.9%
Taylor expanded in y around inf
+-lft-identityN/A
+-commutativeN/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
accelerator-lowering-fma.f6490.6
Simplified90.6%
+-rgt-identityN/A
+-commutativeN/A
distribute-rgt-inN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
associate-*l*N/A
*-lowering-*.f64N/A
*-lowering-*.f6490.6
Applied egg-rr90.6%
Taylor expanded in x around 0
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
+-lowering-+.f6490.6
Simplified90.6%
if -2.8e38 < y < 5.0000000000000001e84Initial program 99.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6477.7
Simplified77.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* y (fma x 2.0 5.0)))) (if (<= y -3e+41) t_1 (if (<= y 1.3e+86) (* x (fma 2.0 z t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = y * fma(x, 2.0, 5.0);
double tmp;
if (y <= -3e+41) {
tmp = t_1;
} else if (y <= 1.3e+86) {
tmp = x * fma(2.0, z, t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y * fma(x, 2.0, 5.0)) tmp = 0.0 if (y <= -3e+41) tmp = t_1; elseif (y <= 1.3e+86) tmp = Float64(x * fma(2.0, z, t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y * N[(x * 2.0 + 5.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -3e+41], t$95$1, If[LessEqual[y, 1.3e+86], N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \mathsf{fma}\left(x, 2, 5\right)\\
\mathbf{if}\;y \leq -3 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{+86}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.9999999999999998e41 or 1.2999999999999999e86 < y Initial program 99.9%
Taylor expanded in y around inf
+-lft-identityN/A
+-commutativeN/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-neg-inN/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
accelerator-lowering-fma.f64N/A
neg-sub0N/A
associate--r-N/A
neg-sub0N/A
distribute-lft-neg-inN/A
metadata-evalN/A
*-commutativeN/A
accelerator-lowering-fma.f6490.6
Simplified90.6%
+-rgt-identityN/A
*-commutativeN/A
*-lowering-*.f64N/A
accelerator-lowering-fma.f6490.6
Applied egg-rr90.6%
if -2.9999999999999998e41 < y < 1.2999999999999999e86Initial program 99.9%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6477.7
Simplified77.7%
Final simplification82.8%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (fma 2.0 z t)))) (if (<= x -1.22e-116) t_1 (if (<= x 7e-71) (* 5.0 y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * fma(2.0, z, t);
double tmp;
if (x <= -1.22e-116) {
tmp = t_1;
} else if (x <= 7e-71) {
tmp = 5.0 * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(x * fma(2.0, z, t)) tmp = 0.0 if (x <= -1.22e-116) tmp = t_1; elseif (x <= 7e-71) tmp = Float64(5.0 * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(2.0 * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.22e-116], t$95$1, If[LessEqual[x, 7e-71], N[(5.0 * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(2, z, t\right)\\
\mathbf{if}\;x \leq -1.22 \cdot 10^{-116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{-71}:\\
\;\;\;\;5 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.22e-116 or 6.9999999999999998e-71 < x Initial program 100.0%
Taylor expanded in y around 0
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6471.9
Simplified71.9%
if -1.22e-116 < x < 6.9999999999999998e-71Initial program 99.9%
Taylor expanded in x around 0
*-lowering-*.f6474.5
Simplified74.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* z (+ x x)))) (if (<= x -1.75e-25) t_1 (if (<= x 1.7e-5) (* 5.0 y) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = z * (x + x);
double tmp;
if (x <= -1.75e-25) {
tmp = t_1;
} else if (x <= 1.7e-5) {
tmp = 5.0 * y;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x + x)
if (x <= (-1.75d-25)) then
tmp = t_1
else if (x <= 1.7d-5) then
tmp = 5.0d0 * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = z * (x + x);
double tmp;
if (x <= -1.75e-25) {
tmp = t_1;
} else if (x <= 1.7e-5) {
tmp = 5.0 * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = z * (x + x) tmp = 0 if x <= -1.75e-25: tmp = t_1 elif x <= 1.7e-5: tmp = 5.0 * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(z * Float64(x + x)) tmp = 0.0 if (x <= -1.75e-25) tmp = t_1; elseif (x <= 1.7e-5) tmp = Float64(5.0 * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = z * (x + x); tmp = 0.0; if (x <= -1.75e-25) tmp = t_1; elseif (x <= 1.7e-5) tmp = 5.0 * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(z * N[(x + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e-25], t$95$1, If[LessEqual[x, 1.7e-5], N[(5.0 * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(x + x\right)\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{-25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{-5}:\\
\;\;\;\;5 \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.7500000000000001e-25 or 1.7e-5 < x Initial program 100.0%
associate-+l+N/A
+-lowering-+.f64N/A
associate-+l+N/A
+-commutativeN/A
count-2N/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f64100.0
Applied egg-rr100.0%
distribute-rgt-inN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6495.2
Applied egg-rr95.2%
Taylor expanded in z around inf
associate-*r*N/A
*-commutativeN/A
*-lowering-*.f64N/A
count-2N/A
+-lowering-+.f6449.3
Simplified49.3%
if -1.7500000000000001e-25 < x < 1.7e-5Initial program 99.9%
Taylor expanded in x around 0
*-lowering-*.f6466.9
Simplified66.9%
(FPCore (x y z t) :precision binary64 (if (<= x -5.6e-25) (* x t) (if (<= x 9.5e-15) (* 5.0 y) (* x t))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.6e-25) {
tmp = x * t;
} else if (x <= 9.5e-15) {
tmp = 5.0 * y;
} else {
tmp = x * t;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-5.6d-25)) then
tmp = x * t
else if (x <= 9.5d-15) then
tmp = 5.0d0 * y
else
tmp = x * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5.6e-25) {
tmp = x * t;
} else if (x <= 9.5e-15) {
tmp = 5.0 * y;
} else {
tmp = x * t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5.6e-25: tmp = x * t elif x <= 9.5e-15: tmp = 5.0 * y else: tmp = x * t return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5.6e-25) tmp = Float64(x * t); elseif (x <= 9.5e-15) tmp = Float64(5.0 * y); else tmp = Float64(x * t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5.6e-25) tmp = x * t; elseif (x <= 9.5e-15) tmp = 5.0 * y; else tmp = x * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5.6e-25], N[(x * t), $MachinePrecision], If[LessEqual[x, 9.5e-15], N[(5.0 * y), $MachinePrecision], N[(x * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.6 \cdot 10^{-25}:\\
\;\;\;\;x \cdot t\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-15}:\\
\;\;\;\;5 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot t\\
\end{array}
\end{array}
if x < -5.59999999999999976e-25 or 9.5000000000000005e-15 < x Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
*-lowering-*.f6436.1
Simplified36.1%
if -5.59999999999999976e-25 < x < 9.5000000000000005e-15Initial program 99.9%
Taylor expanded in x around 0
*-lowering-*.f6468.3
Simplified68.3%
(FPCore (x y z t) :precision binary64 (* 5.0 y))
double code(double x, double y, double z, double t) {
return 5.0 * y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 5.0d0 * y
end function
public static double code(double x, double y, double z, double t) {
return 5.0 * y;
}
def code(x, y, z, t): return 5.0 * y
function code(x, y, z, t) return Float64(5.0 * y) end
function tmp = code(x, y, z, t) tmp = 5.0 * y; end
code[x_, y_, z_, t_] := N[(5.0 * y), $MachinePrecision]
\begin{array}{l}
\\
5 \cdot y
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
*-lowering-*.f6435.2
Simplified35.2%
herbie shell --seed 2024195
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))