
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
\end{array}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i))))
(if (<= t_1 INFINITY)
t_1
(* c (fma a (/ b c) (fma x (/ y c) (fma t (/ z c) i)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = c * fma(a, (b / c), fma(x, (y / c), fma(t, (z / c), i)));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(c * fma(a, Float64(b / c), fma(x, Float64(y / c), fma(t, Float64(z / c), i)))); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(c * N[(a * N[(b / c), $MachinePrecision] + N[(x * N[(y / c), $MachinePrecision] + N[(t * N[(z / c), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot \mathsf{fma}\left(a, \frac{b}{c}, \mathsf{fma}\left(x, \frac{y}{c}, \mathsf{fma}\left(t, \frac{z}{c}, i\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 0.0%
Taylor expanded in c around inf
*-lowering-*.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
associate-+l+N/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f64N/A
associate-/l*N/A
accelerator-lowering-fma.f64N/A
/-lowering-/.f6488.9
Simplified88.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* c i) -5e+140)
(fma i c (* a b))
(if (<= (* c i) -1e+81)
(fma c i (* z t))
(if (<= (* c i) -2e-18)
(fma y x (* c i))
(if (<= (* c i) -1.2e-295)
(fma z t (* a b))
(if (<= (* c i) 2e+98) (fma z t (* x y)) (fma z t (* c i))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -5e+140) {
tmp = fma(i, c, (a * b));
} else if ((c * i) <= -1e+81) {
tmp = fma(c, i, (z * t));
} else if ((c * i) <= -2e-18) {
tmp = fma(y, x, (c * i));
} else if ((c * i) <= -1.2e-295) {
tmp = fma(z, t, (a * b));
} else if ((c * i) <= 2e+98) {
tmp = fma(z, t, (x * y));
} else {
tmp = fma(z, t, (c * i));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -5e+140) tmp = fma(i, c, Float64(a * b)); elseif (Float64(c * i) <= -1e+81) tmp = fma(c, i, Float64(z * t)); elseif (Float64(c * i) <= -2e-18) tmp = fma(y, x, Float64(c * i)); elseif (Float64(c * i) <= -1.2e-295) tmp = fma(z, t, Float64(a * b)); elseif (Float64(c * i) <= 2e+98) tmp = fma(z, t, Float64(x * y)); else tmp = fma(z, t, Float64(c * i)); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -5e+140], N[(i * c + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1e+81], N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2e-18], N[(y * x + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.2e-295], N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+98], N[(z * t + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\
\mathbf{elif}\;c \cdot i \leq -1 \cdot 10^{+81}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\
\mathbf{elif}\;c \cdot i \leq -2 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(y, x, c \cdot i\right)\\
\mathbf{elif}\;c \cdot i \leq -1.2 \cdot 10^{-295}:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right)\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(z, t, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, c \cdot i\right)\\
\end{array}
\end{array}
if (*.f64 c i) < -5.00000000000000008e140Initial program 86.4%
Taylor expanded in a around inf
*-lowering-*.f6488.9
Simplified88.9%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6491.2
Applied egg-rr91.2%
if -5.00000000000000008e140 < (*.f64 c i) < -9.99999999999999921e80Initial program 86.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6493.2
Simplified93.2%
Taylor expanded in a around 0
*-lowering-*.f6480.1
Simplified80.1%
if -9.99999999999999921e80 < (*.f64 c i) < -2.0000000000000001e-18Initial program 93.3%
Taylor expanded in x around inf
*-lowering-*.f6486.8
Simplified86.8%
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6486.8
Applied egg-rr86.8%
if -2.0000000000000001e-18 < (*.f64 c i) < -1.1999999999999999e-295Initial program 97.7%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64100.0
Applied egg-rr100.0%
Taylor expanded in a around inf
*-lowering-*.f6485.3
Simplified85.3%
if -1.1999999999999999e-295 < (*.f64 c i) < 2e98Initial program 100.0%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64100.0
Applied egg-rr100.0%
Taylor expanded in x around inf
*-lowering-*.f6473.9
Simplified73.9%
if 2e98 < (*.f64 c i) Initial program 86.2%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6493.1
Applied egg-rr93.1%
Taylor expanded in c around inf
*-lowering-*.f6478.0
Simplified78.0%
Final simplification80.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma c i (fma a b (* z t)))))
(if (<= (* c i) -2e+63)
t_1
(if (<= (* c i) 2e+98) (fma z t (fma a b (* x y))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(c, i, fma(a, b, (z * t)));
double tmp;
if ((c * i) <= -2e+63) {
tmp = t_1;
} else if ((c * i) <= 2e+98) {
tmp = fma(z, t, fma(a, b, (x * y)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = fma(c, i, fma(a, b, Float64(z * t))) tmp = 0.0 if (Float64(c * i) <= -2e+63) tmp = t_1; elseif (Float64(c * i) <= 2e+98) tmp = fma(z, t, fma(a, b, Float64(x * y))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * i + N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2e+63], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], 2e+98], N[(z * t + N[(a * b + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, z \cdot t\right)\right)\\
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(a, b, x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 c i) < -2.00000000000000012e63 or 2e98 < (*.f64 c i) Initial program 86.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6490.7
Simplified90.7%
if -2.00000000000000012e63 < (*.f64 c i) < 2e98Initial program 98.5%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6499.2
Applied egg-rr99.2%
Taylor expanded in c around 0
accelerator-lowering-fma.f64N/A
*-lowering-*.f6493.7
Simplified93.7%
Final simplification92.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (fma a b (* z t))) (t_2 (fma c i t_1))) (if (<= (* c i) -2e+63) t_2 (if (<= (* c i) 2e+98) (fma x y t_1) t_2))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(a, b, (z * t));
double t_2 = fma(c, i, t_1);
double tmp;
if ((c * i) <= -2e+63) {
tmp = t_2;
} else if ((c * i) <= 2e+98) {
tmp = fma(x, y, t_1);
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = fma(a, b, Float64(z * t)) t_2 = fma(c, i, t_1) tmp = 0.0 if (Float64(c * i) <= -2e+63) tmp = t_2; elseif (Float64(c * i) <= 2e+98) tmp = fma(x, y, t_1); else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * i + t$95$1), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -2e+63], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], 2e+98], N[(x * y + t$95$1), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, b, z \cdot t\right)\\
t_2 := \mathsf{fma}\left(c, i, t\_1\right)\\
\mathbf{if}\;c \cdot i \leq -2 \cdot 10^{+63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(x, y, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 c i) < -2.00000000000000012e63 or 2e98 < (*.f64 c i) Initial program 86.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6490.7
Simplified90.7%
if -2.00000000000000012e63 < (*.f64 c i) < 2e98Initial program 98.5%
Taylor expanded in c around 0
associate-+r+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6493.7
Simplified93.7%
Final simplification92.3%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma c i (fma a b (* z t)))))
(if (<= (* z t) -2e-60)
t_1
(if (<= (* z t) 5e+104) (fma a b (fma c i (* x y))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(c, i, fma(a, b, (z * t)));
double tmp;
if ((z * t) <= -2e-60) {
tmp = t_1;
} else if ((z * t) <= 5e+104) {
tmp = fma(a, b, fma(c, i, (x * y)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = fma(c, i, fma(a, b, Float64(z * t))) tmp = 0.0 if (Float64(z * t) <= -2e-60) tmp = t_1; elseif (Float64(z * t) <= 5e+104) tmp = fma(a, b, fma(c, i, Float64(x * y))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * i + N[(a * b + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(z * t), $MachinePrecision], -2e-60], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 5e+104], N[(a * b + N[(c * i + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, z \cdot t\right)\right)\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 5 \cdot 10^{+104}:\\
\;\;\;\;\mathsf{fma}\left(a, b, \mathsf{fma}\left(c, i, x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 z t) < -1.9999999999999999e-60 or 4.9999999999999997e104 < (*.f64 z t) Initial program 91.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6490.1
Simplified90.1%
if -1.9999999999999999e-60 < (*.f64 z t) < 4.9999999999999997e104Initial program 94.8%
Taylor expanded in z around 0
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6491.3
Simplified91.3%
Final simplification90.6%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= (* z t) -1e+132) (fma z t (* a b)) (if (<= (* z t) 1e+152) (fma a b (fma c i (* x y))) (fma c i (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -1e+132) {
tmp = fma(z, t, (a * b));
} else if ((z * t) <= 1e+152) {
tmp = fma(a, b, fma(c, i, (x * y)));
} else {
tmp = fma(c, i, (z * t));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -1e+132) tmp = fma(z, t, Float64(a * b)); elseif (Float64(z * t) <= 1e+152) tmp = fma(a, b, fma(c, i, Float64(x * y))); else tmp = fma(c, i, Float64(z * t)); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -1e+132], N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e+152], N[(a * b + N[(c * i + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1 \cdot 10^{+132}:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right)\\
\mathbf{elif}\;z \cdot t \leq 10^{+152}:\\
\;\;\;\;\mathsf{fma}\left(a, b, \mathsf{fma}\left(c, i, x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 z t) < -9.99999999999999991e131Initial program 90.6%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6496.2
Applied egg-rr96.2%
Taylor expanded in a around inf
*-lowering-*.f6486.9
Simplified86.9%
if -9.99999999999999991e131 < (*.f64 z t) < 1e152Initial program 96.4%
Taylor expanded in z around 0
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6486.3
Simplified86.3%
if 1e152 < (*.f64 z t) Initial program 79.4%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6491.2
Simplified91.2%
Taylor expanded in a around 0
*-lowering-*.f6481.3
Simplified81.3%
Final simplification85.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -2.4e+118) (fma z t (* a b)) (if (<= (* a b) 1.65e+160) (fma z t (* c i)) (fma i c (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.4e+118) {
tmp = fma(z, t, (a * b));
} else if ((a * b) <= 1.65e+160) {
tmp = fma(z, t, (c * i));
} else {
tmp = fma(i, c, (a * b));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.4e+118) tmp = fma(z, t, Float64(a * b)); elseif (Float64(a * b) <= 1.65e+160) tmp = fma(z, t, Float64(c * i)); else tmp = fma(i, c, Float64(a * b)); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.4e+118], N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.65e+160], N[(z * t + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(i * c + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.4 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right)\\
\mathbf{elif}\;a \cdot b \leq 1.65 \cdot 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(z, t, c \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.4e118Initial program 81.8%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6486.3
Applied egg-rr86.3%
Taylor expanded in a around inf
*-lowering-*.f6477.3
Simplified77.3%
if -2.4e118 < (*.f64 a b) < 1.6499999999999999e160Initial program 95.6%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6499.4
Applied egg-rr99.4%
Taylor expanded in c around inf
*-lowering-*.f6471.9
Simplified71.9%
if 1.6499999999999999e160 < (*.f64 a b) Initial program 93.1%
Taylor expanded in a around inf
*-lowering-*.f6486.2
Simplified86.2%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6489.7
Applied egg-rr89.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -2.4e+124) (fma z t (* a b)) (if (<= (* a b) 1e+160) (fma c i (* z t)) (fma i c (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.4e+124) {
tmp = fma(z, t, (a * b));
} else if ((a * b) <= 1e+160) {
tmp = fma(c, i, (z * t));
} else {
tmp = fma(i, c, (a * b));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.4e+124) tmp = fma(z, t, Float64(a * b)); elseif (Float64(a * b) <= 1e+160) tmp = fma(c, i, Float64(z * t)); else tmp = fma(i, c, Float64(a * b)); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.4e+124], N[(z * t + N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e+160], N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(i * c + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.4 \cdot 10^{+124}:\\
\;\;\;\;\mathsf{fma}\left(z, t, a \cdot b\right)\\
\mathbf{elif}\;a \cdot b \leq 10^{+160}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 a b) < -2.40000000000000006e124Initial program 81.8%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6486.3
Applied egg-rr86.3%
Taylor expanded in a around inf
*-lowering-*.f6477.3
Simplified77.3%
if -2.40000000000000006e124 < (*.f64 a b) < 1.00000000000000001e160Initial program 95.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6478.0
Simplified78.0%
Taylor expanded in a around 0
*-lowering-*.f6471.4
Simplified71.4%
if 1.00000000000000001e160 < (*.f64 a b) Initial program 93.1%
Taylor expanded in a around inf
*-lowering-*.f6486.2
Simplified86.2%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6489.7
Applied egg-rr89.7%
Final simplification74.5%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma i c (* a b))))
(if (<= (* a b) -1e+151)
t_1
(if (<= (* a b) 5.4e+159) (fma c i (* z t)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(i, c, (a * b));
double tmp;
if ((a * b) <= -1e+151) {
tmp = t_1;
} else if ((a * b) <= 5.4e+159) {
tmp = fma(c, i, (z * t));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = fma(i, c, Float64(a * b)) tmp = 0.0 if (Float64(a * b) <= -1e+151) tmp = t_1; elseif (Float64(a * b) <= 5.4e+159) tmp = fma(c, i, Float64(z * t)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * c + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+151], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 5.4e+159], N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, c, a \cdot b\right)\\
\mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 5.4 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 a b) < -1.00000000000000002e151 or 5.40000000000000016e159 < (*.f64 a b) Initial program 87.1%
Taylor expanded in a around inf
*-lowering-*.f6479.7
Simplified79.7%
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6484.0
Applied egg-rr84.0%
if -1.00000000000000002e151 < (*.f64 a b) < 5.40000000000000016e159Initial program 95.1%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6477.3
Simplified77.3%
Taylor expanded in a around 0
*-lowering-*.f6470.8
Simplified70.8%
Final simplification74.4%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -4e+134) (* a b) (if (<= (* a b) 7e+198) (fma c i (* z t)) (* a b))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -4e+134) {
tmp = a * b;
} else if ((a * b) <= 7e+198) {
tmp = fma(c, i, (z * t));
} else {
tmp = a * b;
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -4e+134) tmp = Float64(a * b); elseif (Float64(a * b) <= 7e+198) tmp = fma(c, i, Float64(z * t)); else tmp = Float64(a * b); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -4e+134], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 7e+198], N[(c * i + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -4 \cdot 10^{+134}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 7 \cdot 10^{+198}:\\
\;\;\;\;\mathsf{fma}\left(c, i, z \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -3.99999999999999969e134 or 7.00000000000000026e198 < (*.f64 a b) Initial program 85.3%
Taylor expanded in a around inf
*-lowering-*.f6473.8
Simplified73.8%
if -3.99999999999999969e134 < (*.f64 a b) < 7.00000000000000026e198Initial program 95.7%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6478.0
Simplified78.0%
Taylor expanded in a around 0
*-lowering-*.f6471.6
Simplified71.6%
Final simplification72.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -1.25e+141) (* c i) (if (<= (* c i) 7.8e+91) (* z t) (* c i))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.25e+141) {
tmp = c * i;
} else if ((c * i) <= 7.8e+91) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((c * i) <= (-1.25d+141)) then
tmp = c * i
else if ((c * i) <= 7.8d+91) then
tmp = z * t
else
tmp = c * i
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -1.25e+141) {
tmp = c * i;
} else if ((c * i) <= 7.8e+91) {
tmp = z * t;
} else {
tmp = c * i;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (c * i) <= -1.25e+141: tmp = c * i elif (c * i) <= 7.8e+91: tmp = z * t else: tmp = c * i return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -1.25e+141) tmp = Float64(c * i); elseif (Float64(c * i) <= 7.8e+91) tmp = Float64(z * t); else tmp = Float64(c * i); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((c * i) <= -1.25e+141)
tmp = c * i;
elseif ((c * i) <= 7.8e+91)
tmp = z * t;
else
tmp = c * i;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -1.25e+141], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 7.8e+91], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -1.25 \cdot 10^{+141}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;c \cdot i \leq 7.8 \cdot 10^{+91}:\\
\;\;\;\;z \cdot t\\
\mathbf{else}:\\
\;\;\;\;c \cdot i\\
\end{array}
\end{array}
if (*.f64 c i) < -1.25000000000000006e141 or 7.79999999999999935e91 < (*.f64 c i) Initial program 86.2%
Taylor expanded in c around inf
*-lowering-*.f6467.5
Simplified67.5%
if -1.25000000000000006e141 < (*.f64 c i) < 7.79999999999999935e91Initial program 97.4%
Taylor expanded in z around inf
*-lowering-*.f6440.4
Simplified40.4%
Final simplification51.2%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -5.2e+93) (* a b) (if (<= (* a b) 1.55e+196) (* c i) (* a b))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -5.2e+93) {
tmp = a * b;
} else if ((a * b) <= 1.55e+196) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-5.2d+93)) then
tmp = a * b
else if ((a * b) <= 1.55d+196) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -5.2e+93) {
tmp = a * b;
} else if ((a * b) <= 1.55e+196) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -5.2e+93: tmp = a * b elif (a * b) <= 1.55e+196: tmp = c * i else: tmp = a * b return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -5.2e+93) tmp = Float64(a * b); elseif (Float64(a * b) <= 1.55e+196) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((a * b) <= -5.2e+93)
tmp = a * b;
elseif ((a * b) <= 1.55e+196)
tmp = c * i;
else
tmp = a * b;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -5.2e+93], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.55e+196], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -5.2 \cdot 10^{+93}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 1.55 \cdot 10^{+196}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if (*.f64 a b) < -5.19999999999999999e93 or 1.55000000000000005e196 < (*.f64 a b) Initial program 86.1%
Taylor expanded in a around inf
*-lowering-*.f6469.9
Simplified69.9%
if -5.19999999999999999e93 < (*.f64 a b) < 1.55000000000000005e196Initial program 95.6%
Taylor expanded in c around inf
*-lowering-*.f6438.5
Simplified38.5%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (fma z t (fma x y (fma a b (* c i)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(z, t, fma(x, y, fma(a, b, (c * i))));
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return fma(z, t, fma(x, y, fma(a, b, Float64(c * i)))) end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z * t + N[(x * y + N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \mathsf{fma}\left(a, b, c \cdot i\right)\right)\right)
\end{array}
Initial program 92.9%
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6496.5
Applied egg-rr96.5%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (* a b))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return a * b
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = a * b;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
a \cdot b
\end{array}
Initial program 92.9%
Taylor expanded in a around inf
*-lowering-*.f6425.4
Simplified25.4%
herbie shell --seed 2024198
(FPCore (x y z t a b c i)
:name "Linear.V4:$cdot from linear-1.19.1.3, C"
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))