Linear.V4:$cdot from linear-1.19.1.3, C

Percentage Accurate: 95.9% → 97.5%
Time: 9.6s
Alternatives: 15
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \end{array} \]
(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:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 15 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 95.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \end{array} \]
(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}

Alternative 1: 97.5% accurate, 1.0× speedup?

\[\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}\;b \leq -55000000000:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, a \cdot b\right)\right)\right)\\ \end{array} \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
 (if (<= b -55000000000.0)
   (fma b a (fma i c (* t z)))
   (fma z t (fma y x (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 (b <= -55000000000.0) {
		tmp = fma(b, a, fma(i, c, (t * z)));
	} else {
		tmp = fma(z, t, fma(y, x, 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 (b <= -55000000000.0)
		tmp = fma(b, a, fma(i, c, Float64(t * z)));
	else
		tmp = fma(z, t, fma(y, x, 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[b, -55000000000.0], N[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(y * x + N[(i * c + N[(a * b), $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}
\mathbf{if}\;b \leq -55000000000:\\
\;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, a \cdot b\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.5e10

    1. Initial program 84.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0

      \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
      3. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
      4. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
      5. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
      6. lower-*.f6477.5

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
    5. Applied rewrites77.5%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, z \cdot t\right)\right)} \]

    if -5.5e10 < b

    1. Initial program 98.9%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i} \]
      2. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
      3. associate-+l+N/A

        \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
      4. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right)} + \left(a \cdot b + c \cdot i\right) \]
      5. +-commutativeN/A

        \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
      6. associate-+l+N/A

        \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
      7. lift-*.f64N/A

        \[\leadsto \color{blue}{z \cdot t} + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right) \]
      8. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
      9. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y} + \left(a \cdot b + c \cdot i\right)\right) \]
      10. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x} + \left(a \cdot b + c \cdot i\right)\right) \]
      11. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{\mathsf{fma}\left(y, x, a \cdot b + c \cdot i\right)}\right) \]
      12. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
      13. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i} + a \cdot b\right)\right) \]
      14. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c} + a \cdot b\right)\right) \]
      15. lower-fma.f64100.0

        \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)}\right)\right) \]
      16. lift-*.f64N/A

        \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{a \cdot b}\right)\right)\right) \]
      17. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
      18. lower-*.f64100.0

        \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
    4. Applied rewrites100.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification94.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -55000000000:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, a \cdot b\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 75.2% accurate, 0.4× speedup?

\[\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 := y \cdot x + t \cdot z\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(z, t, i \cdot c\right)\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, y \cdot x\right)\\ \end{array} \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 (+ (* y x) (* t z))))
   (if (<= t_1 -2e+138)
     (fma y x (* t z))
     (if (<= t_1 -4e+95)
       (fma z t (* i c))
       (if (<= t_1 2e+126) (fma i c (* a b)) (fma z t (* y x)))))))
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 = (y * x) + (t * z);
	double tmp;
	if (t_1 <= -2e+138) {
		tmp = fma(y, x, (t * z));
	} else if (t_1 <= -4e+95) {
		tmp = fma(z, t, (i * c));
	} else if (t_1 <= 2e+126) {
		tmp = fma(i, c, (a * b));
	} else {
		tmp = fma(z, t, (y * x));
	}
	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(y * x) + Float64(t * z))
	tmp = 0.0
	if (t_1 <= -2e+138)
		tmp = fma(y, x, Float64(t * z));
	elseif (t_1 <= -4e+95)
		tmp = fma(z, t, Float64(i * c));
	elseif (t_1 <= 2e+126)
		tmp = fma(i, c, Float64(a * b));
	else
		tmp = fma(z, t, Float64(y * x));
	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[(y * x), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+138], N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -4e+95], N[(z * t + N[(i * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+126], N[(i * c + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(z * t + N[(y * x), $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 := y \cdot x + t \cdot z\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+138}:\\
\;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\

\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(z, t, i \cdot c\right)\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+126}:\\
\;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, t, y \cdot x\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (+.f64 (*.f64 x y) (*.f64 z t)) < -2.0000000000000001e138

    1. Initial program 94.8%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing
    3. Taylor expanded in c around 0

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
      2. lower-fma.f64N/A

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
      3. +-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
      4. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
      5. lower-fma.f64N/A

        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
      6. *-commutativeN/A

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
      7. lower-*.f6493.8

        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
    5. Applied rewrites93.8%

      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
    6. Taylor expanded in b around 0

      \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
    7. Step-by-step derivation
      1. Applied rewrites82.0%

        \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, z \cdot t\right) \]

      if -2.0000000000000001e138 < (+.f64 (*.f64 x y) (*.f64 z t)) < -4.00000000000000008e95

      1. Initial program 100.0%

        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i} \]
        2. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
        3. associate-+l+N/A

          \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
        4. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right)} + \left(a \cdot b + c \cdot i\right) \]
        5. +-commutativeN/A

          \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
        6. associate-+l+N/A

          \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
        7. lift-*.f64N/A

          \[\leadsto \color{blue}{z \cdot t} + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right) \]
        8. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
        9. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y} + \left(a \cdot b + c \cdot i\right)\right) \]
        10. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x} + \left(a \cdot b + c \cdot i\right)\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{\mathsf{fma}\left(y, x, a \cdot b + c \cdot i\right)}\right) \]
        12. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
        13. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i} + a \cdot b\right)\right) \]
        14. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c} + a \cdot b\right)\right) \]
        15. lower-fma.f64100.0

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)}\right)\right) \]
        16. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{a \cdot b}\right)\right)\right) \]
        17. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
        18. lower-*.f64100.0

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
      4. Applied rewrites100.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)} \]
      5. Taylor expanded in c around inf

        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{c \cdot i}\right) \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{i \cdot c}\right) \]
        2. lower-*.f6482.8

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{i \cdot c}\right) \]
      7. Applied rewrites82.8%

        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{i \cdot c}\right) \]

      if -4.00000000000000008e95 < (+.f64 (*.f64 x y) (*.f64 z t)) < 1.99999999999999985e126

      1. Initial program 97.1%

        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
      2. Add Preprocessing
      3. Taylor expanded in b around inf

        \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
        2. lower-*.f6473.0

          \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
      5. Applied rewrites73.0%

        \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
      6. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{b \cdot a + c \cdot i} \]
        2. +-commutativeN/A

          \[\leadsto \color{blue}{c \cdot i + b \cdot a} \]
        3. lift-*.f64N/A

          \[\leadsto \color{blue}{c \cdot i} + b \cdot a \]
        4. *-commutativeN/A

          \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
        5. lower-fma.f6473.9

          \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, b \cdot a\right)} \]
      7. Applied rewrites73.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)} \]

      if 1.99999999999999985e126 < (+.f64 (*.f64 x y) (*.f64 z t))

      1. Initial program 92.1%

        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i} \]
        2. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
        3. associate-+l+N/A

          \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
        4. lift-+.f64N/A

          \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right)} + \left(a \cdot b + c \cdot i\right) \]
        5. +-commutativeN/A

          \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
        6. associate-+l+N/A

          \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
        7. lift-*.f64N/A

          \[\leadsto \color{blue}{z \cdot t} + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right) \]
        8. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
        9. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y} + \left(a \cdot b + c \cdot i\right)\right) \]
        10. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x} + \left(a \cdot b + c \cdot i\right)\right) \]
        11. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{\mathsf{fma}\left(y, x, a \cdot b + c \cdot i\right)}\right) \]
        12. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
        13. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i} + a \cdot b\right)\right) \]
        14. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c} + a \cdot b\right)\right) \]
        15. lower-fma.f6497.4

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)}\right)\right) \]
        16. lift-*.f64N/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{a \cdot b}\right)\right)\right) \]
        17. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
        18. lower-*.f6497.4

          \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
      4. Applied rewrites97.4%

        \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)} \]
      5. Taylor expanded in x around inf

        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y}\right) \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x}\right) \]
        2. lower-*.f6485.1

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x}\right) \]
      7. Applied rewrites85.1%

        \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x}\right) \]
    8. Recombined 4 regimes into one program.
    9. Final simplification79.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x + t \cdot z \leq -2 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;y \cdot x + t \cdot z \leq -4 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(z, t, i \cdot c\right)\\ \mathbf{elif}\;y \cdot x + t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(z, t, y \cdot x\right)\\ \end{array} \]
    10. Add Preprocessing

    Alternative 3: 75.3% accurate, 0.4× speedup?

    \[\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(y, x, t \cdot z\right)\\ t_2 := y \cdot x + t \cdot z\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+138}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(z, t, i \cdot c\right)\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \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 (fma y x (* t z))) (t_2 (+ (* y x) (* t z))))
       (if (<= t_2 -2e+138)
         t_1
         (if (<= t_2 -4e+95)
           (fma z t (* i c))
           (if (<= t_2 2e+126) (fma i c (* a b)) 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(y, x, (t * z));
    	double t_2 = (y * x) + (t * z);
    	double tmp;
    	if (t_2 <= -2e+138) {
    		tmp = t_1;
    	} else if (t_2 <= -4e+95) {
    		tmp = fma(z, t, (i * c));
    	} else if (t_2 <= 2e+126) {
    		tmp = fma(i, c, (a * b));
    	} 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(y, x, Float64(t * z))
    	t_2 = Float64(Float64(y * x) + Float64(t * z))
    	tmp = 0.0
    	if (t_2 <= -2e+138)
    		tmp = t_1;
    	elseif (t_2 <= -4e+95)
    		tmp = fma(z, t, Float64(i * c));
    	elseif (t_2 <= 2e+126)
    		tmp = fma(i, c, Float64(a * b));
    	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[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+138], t$95$1, If[LessEqual[t$95$2, -4e+95], N[(z * t + N[(i * c), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+126], N[(i * c + N[(a * b), $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(y, x, t \cdot z\right)\\
    t_2 := y \cdot x + t \cdot z\\
    \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+138}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_2 \leq -4 \cdot 10^{+95}:\\
    \;\;\;\;\mathsf{fma}\left(z, t, i \cdot c\right)\\
    
    \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+126}:\\
    \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 (*.f64 x y) (*.f64 z t)) < -2.0000000000000001e138 or 1.99999999999999985e126 < (+.f64 (*.f64 x y) (*.f64 z t))

      1. Initial program 93.3%

        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
      2. Add Preprocessing
      3. Taylor expanded in c around 0

        \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
        2. lower-fma.f64N/A

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
        3. +-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
        5. lower-fma.f64N/A

          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
        6. *-commutativeN/A

          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
        7. lower-*.f6490.9

          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
      5. Applied rewrites90.9%

        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
      6. Taylor expanded in b around 0

        \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
      7. Step-by-step derivation
        1. Applied rewrites83.0%

          \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, z \cdot t\right) \]

        if -2.0000000000000001e138 < (+.f64 (*.f64 x y) (*.f64 z t)) < -4.00000000000000008e95

        1. Initial program 100.0%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i} \]
          2. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
          3. associate-+l+N/A

            \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
          4. lift-+.f64N/A

            \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right)} + \left(a \cdot b + c \cdot i\right) \]
          5. +-commutativeN/A

            \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
          6. associate-+l+N/A

            \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
          7. lift-*.f64N/A

            \[\leadsto \color{blue}{z \cdot t} + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right) \]
          8. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
          9. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y} + \left(a \cdot b + c \cdot i\right)\right) \]
          10. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x} + \left(a \cdot b + c \cdot i\right)\right) \]
          11. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{\mathsf{fma}\left(y, x, a \cdot b + c \cdot i\right)}\right) \]
          12. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
          13. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i} + a \cdot b\right)\right) \]
          14. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c} + a \cdot b\right)\right) \]
          15. lower-fma.f64100.0

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)}\right)\right) \]
          16. lift-*.f64N/A

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{a \cdot b}\right)\right)\right) \]
          17. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
          18. lower-*.f64100.0

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
        4. Applied rewrites100.0%

          \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)} \]
        5. Taylor expanded in c around inf

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{c \cdot i}\right) \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{i \cdot c}\right) \]
          2. lower-*.f6482.8

            \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{i \cdot c}\right) \]
        7. Applied rewrites82.8%

          \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{i \cdot c}\right) \]

        if -4.00000000000000008e95 < (+.f64 (*.f64 x y) (*.f64 z t)) < 1.99999999999999985e126

        1. Initial program 97.1%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in b around inf

          \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
          2. lower-*.f6473.0

            \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
        5. Applied rewrites73.0%

          \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
        6. Step-by-step derivation
          1. lift-+.f64N/A

            \[\leadsto \color{blue}{b \cdot a + c \cdot i} \]
          2. +-commutativeN/A

            \[\leadsto \color{blue}{c \cdot i + b \cdot a} \]
          3. lift-*.f64N/A

            \[\leadsto \color{blue}{c \cdot i} + b \cdot a \]
          4. *-commutativeN/A

            \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
          5. lower-fma.f6473.9

            \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, b \cdot a\right)} \]
        7. Applied rewrites73.9%

          \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)} \]
      8. Recombined 3 regimes into one program.
      9. Final simplification79.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x + t \cdot z \leq -2 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;y \cdot x + t \cdot z \leq -4 \cdot 10^{+95}:\\ \;\;\;\;\mathsf{fma}\left(z, t, i \cdot c\right)\\ \mathbf{elif}\;y \cdot x + t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \end{array} \]
      10. Add Preprocessing

      Alternative 4: 42.3% accurate, 0.6× speedup?

      \[\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}\;t \cdot z \leq -1.1 \cdot 10^{+91}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq -4000000:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;t \cdot z \leq 5.5 \cdot 10^{-197}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;t \cdot z \leq 1.65 \cdot 10^{+76}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \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
       (if (<= (* t z) -1.1e+91)
         (* t z)
         (if (<= (* t z) -4000000.0)
           (* i c)
           (if (<= (* t z) 5.5e-197)
             (* y x)
             (if (<= (* t z) 1.65e+76) (* a b) (* t z))))))
      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 ((t * z) <= -1.1e+91) {
      		tmp = t * z;
      	} else if ((t * z) <= -4000000.0) {
      		tmp = i * c;
      	} else if ((t * z) <= 5.5e-197) {
      		tmp = y * x;
      	} else if ((t * z) <= 1.65e+76) {
      		tmp = a * b;
      	} else {
      		tmp = t * z;
      	}
      	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 ((t * z) <= (-1.1d+91)) then
              tmp = t * z
          else if ((t * z) <= (-4000000.0d0)) then
              tmp = i * c
          else if ((t * z) <= 5.5d-197) then
              tmp = y * x
          else if ((t * z) <= 1.65d+76) then
              tmp = a * b
          else
              tmp = t * z
          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 ((t * z) <= -1.1e+91) {
      		tmp = t * z;
      	} else if ((t * z) <= -4000000.0) {
      		tmp = i * c;
      	} else if ((t * z) <= 5.5e-197) {
      		tmp = y * x;
      	} else if ((t * z) <= 1.65e+76) {
      		tmp = a * b;
      	} else {
      		tmp = t * z;
      	}
      	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 (t * z) <= -1.1e+91:
      		tmp = t * z
      	elif (t * z) <= -4000000.0:
      		tmp = i * c
      	elif (t * z) <= 5.5e-197:
      		tmp = y * x
      	elif (t * z) <= 1.65e+76:
      		tmp = a * b
      	else:
      		tmp = t * z
      	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(t * z) <= -1.1e+91)
      		tmp = Float64(t * z);
      	elseif (Float64(t * z) <= -4000000.0)
      		tmp = Float64(i * c);
      	elseif (Float64(t * z) <= 5.5e-197)
      		tmp = Float64(y * x);
      	elseif (Float64(t * z) <= 1.65e+76)
      		tmp = Float64(a * b);
      	else
      		tmp = Float64(t * z);
      	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 ((t * z) <= -1.1e+91)
      		tmp = t * z;
      	elseif ((t * z) <= -4000000.0)
      		tmp = i * c;
      	elseif ((t * z) <= 5.5e-197)
      		tmp = y * x;
      	elseif ((t * z) <= 1.65e+76)
      		tmp = a * b;
      	else
      		tmp = t * z;
      	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[(t * z), $MachinePrecision], -1.1e+91], N[(t * z), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], -4000000.0], N[(i * c), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 5.5e-197], N[(y * x), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 1.65e+76], N[(a * b), $MachinePrecision], N[(t * z), $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}\;t \cdot z \leq -1.1 \cdot 10^{+91}:\\
      \;\;\;\;t \cdot z\\
      
      \mathbf{elif}\;t \cdot z \leq -4000000:\\
      \;\;\;\;i \cdot c\\
      
      \mathbf{elif}\;t \cdot z \leq 5.5 \cdot 10^{-197}:\\
      \;\;\;\;y \cdot x\\
      
      \mathbf{elif}\;t \cdot z \leq 1.65 \cdot 10^{+76}:\\
      \;\;\;\;a \cdot b\\
      
      \mathbf{else}:\\
      \;\;\;\;t \cdot z\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 4 regimes
      2. if (*.f64 z t) < -1.1e91 or 1.65e76 < (*.f64 z t)

        1. Initial program 94.2%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in t around inf

          \[\leadsto \color{blue}{t \cdot z} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{z \cdot t} \]
          2. lower-*.f6469.9

            \[\leadsto \color{blue}{z \cdot t} \]
        5. Applied rewrites69.9%

          \[\leadsto \color{blue}{z \cdot t} \]

        if -1.1e91 < (*.f64 z t) < -4e6

        1. Initial program 84.5%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in c around inf

          \[\leadsto \color{blue}{c \cdot i} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{i \cdot c} \]
          2. lower-*.f6454.4

            \[\leadsto \color{blue}{i \cdot c} \]
        5. Applied rewrites54.4%

          \[\leadsto \color{blue}{i \cdot c} \]

        if -4e6 < (*.f64 z t) < 5.50000000000000037e-197

        1. Initial program 97.2%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in x around inf

          \[\leadsto \color{blue}{x \cdot y} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{y \cdot x} \]
          2. lower-*.f6447.5

            \[\leadsto \color{blue}{y \cdot x} \]
        5. Applied rewrites47.5%

          \[\leadsto \color{blue}{y \cdot x} \]

        if 5.50000000000000037e-197 < (*.f64 z t) < 1.65e76

        1. Initial program 95.9%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in b around inf

          \[\leadsto \color{blue}{a \cdot b} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{b \cdot a} \]
          2. lower-*.f6440.4

            \[\leadsto \color{blue}{b \cdot a} \]
        5. Applied rewrites40.4%

          \[\leadsto \color{blue}{b \cdot a} \]
      3. Recombined 4 regimes into one program.
      4. Final simplification54.1%

        \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1.1 \cdot 10^{+91}:\\ \;\;\;\;t \cdot z\\ \mathbf{elif}\;t \cdot z \leq -4000000:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;t \cdot z \leq 5.5 \cdot 10^{-197}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;t \cdot z \leq 1.65 \cdot 10^{+76}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;t \cdot z\\ \end{array} \]
      5. Add Preprocessing

      Alternative 5: 74.9% accurate, 0.6× speedup?

      \[\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(y, x, t \cdot z\right)\\ t_2 := y \cdot x + t \cdot z\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+94}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \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 (fma y x (* t z))) (t_2 (+ (* y x) (* t z))))
         (if (<= t_2 -1e+94) t_1 (if (<= t_2 2e+126) (fma i c (* a b)) 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(y, x, (t * z));
      	double t_2 = (y * x) + (t * z);
      	double tmp;
      	if (t_2 <= -1e+94) {
      		tmp = t_1;
      	} else if (t_2 <= 2e+126) {
      		tmp = fma(i, c, (a * b));
      	} 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(y, x, Float64(t * z))
      	t_2 = Float64(Float64(y * x) + Float64(t * z))
      	tmp = 0.0
      	if (t_2 <= -1e+94)
      		tmp = t_1;
      	elseif (t_2 <= 2e+126)
      		tmp = fma(i, c, Float64(a * b));
      	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[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * x), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+94], t$95$1, If[LessEqual[t$95$2, 2e+126], N[(i * c + N[(a * b), $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(y, x, t \cdot z\right)\\
      t_2 := y \cdot x + t \cdot z\\
      \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+94}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+126}:\\
      \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if (+.f64 (*.f64 x y) (*.f64 z t)) < -1e94 or 1.99999999999999985e126 < (+.f64 (*.f64 x y) (*.f64 z t))

        1. Initial program 94.0%

          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
        2. Add Preprocessing
        3. Taylor expanded in c around 0

          \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
        4. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
          2. lower-fma.f64N/A

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
          3. +-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
          4. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
          5. lower-fma.f64N/A

            \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
          6. *-commutativeN/A

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
          7. lower-*.f6488.7

            \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
        5. Applied rewrites88.7%

          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
        6. Taylor expanded in b around 0

          \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
        7. Step-by-step derivation
          1. Applied rewrites79.8%

            \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, z \cdot t\right) \]

          if -1e94 < (+.f64 (*.f64 x y) (*.f64 z t)) < 1.99999999999999985e126

          1. Initial program 97.1%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in b around inf

            \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
            2. lower-*.f6473.5

              \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
          5. Applied rewrites73.5%

            \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
          6. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{b \cdot a + c \cdot i} \]
            2. +-commutativeN/A

              \[\leadsto \color{blue}{c \cdot i + b \cdot a} \]
            3. lift-*.f64N/A

              \[\leadsto \color{blue}{c \cdot i} + b \cdot a \]
            4. *-commutativeN/A

              \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
            5. lower-fma.f6474.5

              \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, b \cdot a\right)} \]
          7. Applied rewrites74.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification77.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x + t \cdot z \leq -1 \cdot 10^{+94}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;y \cdot x + t \cdot z \leq 2 \cdot 10^{+126}:\\ \;\;\;\;\mathsf{fma}\left(i, c, a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \end{array} \]
        10. Add Preprocessing

        Alternative 6: 87.3% accurate, 0.7× speedup?

        \[\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(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+213}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 50000000000000:\\ \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \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 (fma b a (fma i c (* t z)))))
           (if (<= (* a b) -1e+213)
             t_1
             (if (<= (* a b) 50000000000000.0) (fma z t (fma y x (* i c))) 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(b, a, fma(i, c, (t * z)));
        	double tmp;
        	if ((a * b) <= -1e+213) {
        		tmp = t_1;
        	} else if ((a * b) <= 50000000000000.0) {
        		tmp = fma(z, t, fma(y, x, (i * c)));
        	} 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(b, a, fma(i, c, Float64(t * z)))
        	tmp = 0.0
        	if (Float64(a * b) <= -1e+213)
        		tmp = t_1;
        	elseif (Float64(a * b) <= 50000000000000.0)
        		tmp = fma(z, t, fma(y, x, Float64(i * c)));
        	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[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+213], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 50000000000000.0], N[(z * t + N[(y * x + N[(i * c), $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(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\
        \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+213}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;a \cdot b \leq 50000000000000:\\
        \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, i \cdot c\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 a b) < -9.99999999999999984e212 or 5e13 < (*.f64 a b)

          1. Initial program 89.1%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
            4. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
            6. lower-*.f6490.4

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
          5. Applied rewrites90.4%

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, z \cdot t\right)\right)} \]

          if -9.99999999999999984e212 < (*.f64 a b) < 5e13

          1. Initial program 99.3%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift-+.f64N/A

              \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i} \]
            2. lift-+.f64N/A

              \[\leadsto \color{blue}{\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} + c \cdot i \]
            3. associate-+l+N/A

              \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right) + \left(a \cdot b + c \cdot i\right)} \]
            4. lift-+.f64N/A

              \[\leadsto \color{blue}{\left(x \cdot y + z \cdot t\right)} + \left(a \cdot b + c \cdot i\right) \]
            5. +-commutativeN/A

              \[\leadsto \color{blue}{\left(z \cdot t + x \cdot y\right)} + \left(a \cdot b + c \cdot i\right) \]
            6. associate-+l+N/A

              \[\leadsto \color{blue}{z \cdot t + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
            7. lift-*.f64N/A

              \[\leadsto \color{blue}{z \cdot t} + \left(x \cdot y + \left(a \cdot b + c \cdot i\right)\right) \]
            8. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, x \cdot y + \left(a \cdot b + c \cdot i\right)\right)} \]
            9. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{x \cdot y} + \left(a \cdot b + c \cdot i\right)\right) \]
            10. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{y \cdot x} + \left(a \cdot b + c \cdot i\right)\right) \]
            11. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(z, t, \color{blue}{\mathsf{fma}\left(y, x, a \cdot b + c \cdot i\right)}\right) \]
            12. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i + a \cdot b}\right)\right) \]
            13. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i} + a \cdot b\right)\right) \]
            14. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c} + a \cdot b\right)\right) \]
            15. lower-fma.f64100.0

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)}\right)\right) \]
            16. lift-*.f64N/A

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{a \cdot b}\right)\right)\right) \]
            17. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
            18. lower-*.f64100.0

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, \color{blue}{b \cdot a}\right)\right)\right) \]
          4. Applied rewrites100.0%

            \[\leadsto \color{blue}{\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \mathsf{fma}\left(i, c, b \cdot a\right)\right)\right)} \]
          5. Taylor expanded in c around inf

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{c \cdot i}\right)\right) \]
          6. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c}\right)\right) \]
            2. lower-*.f6495.9

              \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c}\right)\right) \]
          7. Applied rewrites95.9%

            \[\leadsto \mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, \color{blue}{i \cdot c}\right)\right) \]
        3. Recombined 2 regimes into one program.
        4. Final simplification93.7%

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+213}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{elif}\;a \cdot b \leq 50000000000000:\\ \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(y, x, i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 7: 87.3% accurate, 0.7× speedup?

        \[\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(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+213}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq 50000000000000:\\ \;\;\;\;\mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \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 (fma b a (fma i c (* t z)))))
           (if (<= (* a b) -1e+213)
             t_1
             (if (<= (* a b) 50000000000000.0) (fma i c (fma y x (* t z))) 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(b, a, fma(i, c, (t * z)));
        	double tmp;
        	if ((a * b) <= -1e+213) {
        		tmp = t_1;
        	} else if ((a * b) <= 50000000000000.0) {
        		tmp = fma(i, c, fma(y, x, (t * z)));
        	} 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(b, a, fma(i, c, Float64(t * z)))
        	tmp = 0.0
        	if (Float64(a * b) <= -1e+213)
        		tmp = t_1;
        	elseif (Float64(a * b) <= 50000000000000.0)
        		tmp = fma(i, c, fma(y, x, Float64(t * z)));
        	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[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -1e+213], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 50000000000000.0], N[(i * c + N[(y * x + N[(t * z), $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(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\
        \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+213}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;a \cdot b \leq 50000000000000:\\
        \;\;\;\;\mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 a b) < -9.99999999999999984e212 or 5e13 < (*.f64 a b)

          1. Initial program 89.1%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
            4. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
            6. lower-*.f6490.4

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
          5. Applied rewrites90.4%

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, z \cdot t\right)\right)} \]

          if -9.99999999999999984e212 < (*.f64 a b) < 5e13

          1. Initial program 99.3%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in b around 0

            \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{i \cdot c} + \left(t \cdot z + x \cdot y\right) \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, t \cdot z + x \cdot y\right)} \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{x \cdot y + t \cdot z}\right) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{y \cdot x} + t \cdot z\right) \]
            5. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
            7. lower-*.f6495.3

              \[\leadsto \mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
          5. Applied rewrites95.3%

            \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification93.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+213}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{elif}\;a \cdot b \leq 50000000000000:\\ \;\;\;\;\mathsf{fma}\left(i, c, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 8: 89.1% accurate, 0.7× speedup?

        \[\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(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{if}\;i \cdot c \leq -2 \cdot 10^{+117}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;i \cdot c \leq 5 \cdot 10^{+86}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \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 (fma b a (fma i c (* t z)))))
           (if (<= (* i c) -2e+117)
             t_1
             (if (<= (* i c) 5e+86) (fma b a (fma y x (* t z))) 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(b, a, fma(i, c, (t * z)));
        	double tmp;
        	if ((i * c) <= -2e+117) {
        		tmp = t_1;
        	} else if ((i * c) <= 5e+86) {
        		tmp = fma(b, a, fma(y, x, (t * z)));
        	} 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(b, a, fma(i, c, Float64(t * z)))
        	tmp = 0.0
        	if (Float64(i * c) <= -2e+117)
        		tmp = t_1;
        	elseif (Float64(i * c) <= 5e+86)
        		tmp = fma(b, a, fma(y, x, Float64(t * z)));
        	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[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(i * c), $MachinePrecision], -2e+117], t$95$1, If[LessEqual[N[(i * c), $MachinePrecision], 5e+86], N[(b * a + N[(y * x + N[(t * z), $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(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\
        \mathbf{if}\;i \cdot c \leq -2 \cdot 10^{+117}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;i \cdot c \leq 5 \cdot 10^{+86}:\\
        \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 c i) < -2.0000000000000001e117 or 4.9999999999999998e86 < (*.f64 c i)

          1. Initial program 90.1%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in x around 0

            \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
            3. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
            4. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
            5. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
            6. lower-*.f6484.6

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
          5. Applied rewrites84.6%

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, z \cdot t\right)\right)} \]

          if -2.0000000000000001e117 < (*.f64 c i) < 4.9999999999999998e86

          1. Initial program 97.7%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in c around 0

            \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
            5. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
            7. lower-*.f6490.5

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
          5. Applied rewrites90.5%

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification88.6%

          \[\leadsto \begin{array}{l} \mathbf{if}\;i \cdot c \leq -2 \cdot 10^{+117}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{elif}\;i \cdot c \leq 5 \cdot 10^{+86}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \end{array} \]
        5. Add Preprocessing

        Alternative 9: 86.5% accurate, 0.7× speedup?

        \[\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}\;y \cdot x \leq -2 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+149}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \end{array} \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
         (if (<= (* y x) -2e+138)
           (fma y x (* t z))
           (if (<= (* y x) 5e+149) (fma b a (fma i c (* t z))) (fma i c (* y x)))))
        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 ((y * x) <= -2e+138) {
        		tmp = fma(y, x, (t * z));
        	} else if ((y * x) <= 5e+149) {
        		tmp = fma(b, a, fma(i, c, (t * z)));
        	} else {
        		tmp = fma(i, c, (y * x));
        	}
        	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(y * x) <= -2e+138)
        		tmp = fma(y, x, Float64(t * z));
        	elseif (Float64(y * x) <= 5e+149)
        		tmp = fma(b, a, fma(i, c, Float64(t * z)));
        	else
        		tmp = fma(i, c, Float64(y * x));
        	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[(y * x), $MachinePrecision], -2e+138], N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(y * x), $MachinePrecision], 5e+149], N[(b * a + N[(i * c + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * c + N[(y * x), $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}\;y \cdot x \leq -2 \cdot 10^{+138}:\\
        \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\
        
        \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+149}:\\
        \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\
        
        \mathbf{else}:\\
        \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 x y) < -2.0000000000000001e138

          1. Initial program 94.6%

            \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
          2. Add Preprocessing
          3. Taylor expanded in c around 0

            \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
            2. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
            3. +-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
            4. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
            5. lower-fma.f64N/A

              \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
            6. *-commutativeN/A

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
            7. lower-*.f6492.7

              \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
          5. Applied rewrites92.7%

            \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
          6. Taylor expanded in b around 0

            \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
          7. Step-by-step derivation
            1. Applied rewrites82.2%

              \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, z \cdot t\right) \]

            if -2.0000000000000001e138 < (*.f64 x y) < 4.9999999999999999e149

            1. Initial program 97.6%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in x around 0

              \[\leadsto \color{blue}{a \cdot b + \left(c \cdot i + t \cdot z\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + \left(c \cdot i + t \cdot z\right) \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, c \cdot i + t \cdot z\right)} \]
              3. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{i \cdot c} + t \cdot z\right) \]
              4. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(i, c, t \cdot z\right)}\right) \]
              5. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
              6. lower-*.f6486.9

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, \color{blue}{z \cdot t}\right)\right) \]
            5. Applied rewrites86.9%

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, z \cdot t\right)\right)} \]

            if 4.9999999999999999e149 < (*.f64 x y)

            1. Initial program 87.5%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in b around inf

              \[\leadsto \color{blue}{a \cdot b} + c \cdot i \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
              2. lower-*.f6416.9

                \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
            5. Applied rewrites16.9%

              \[\leadsto \color{blue}{b \cdot a} + c \cdot i \]
            6. Step-by-step derivation
              1. lift-+.f64N/A

                \[\leadsto \color{blue}{b \cdot a + c \cdot i} \]
              2. +-commutativeN/A

                \[\leadsto \color{blue}{c \cdot i + b \cdot a} \]
              3. lift-*.f64N/A

                \[\leadsto \color{blue}{c \cdot i} + b \cdot a \]
              4. *-commutativeN/A

                \[\leadsto \color{blue}{i \cdot c} + b \cdot a \]
              5. lower-fma.f6416.9

                \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, b \cdot a\right)} \]
            7. Applied rewrites16.9%

              \[\leadsto \color{blue}{\mathsf{fma}\left(i, c, a \cdot b\right)} \]
            8. Taylor expanded in x around inf

              \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{x \cdot y}\right) \]
            9. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right) \]
              2. lower-*.f6484.0

                \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right) \]
            10. Applied rewrites84.0%

              \[\leadsto \mathsf{fma}\left(i, c, \color{blue}{y \cdot x}\right) \]
          8. Recombined 3 regimes into one program.
          9. Final simplification85.6%

            \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot x \leq -2 \cdot 10^{+138}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;y \cdot x \leq 5 \cdot 10^{+149}:\\ \;\;\;\;\mathsf{fma}\left(b, a, \mathsf{fma}\left(i, c, t \cdot z\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(i, c, y \cdot x\right)\\ \end{array} \]
          10. Add Preprocessing

          Alternative 10: 42.2% accurate, 0.8× speedup?

          \[\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 -1 \cdot 10^{+213}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-260}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+50}:\\ \;\;\;\;i \cdot c\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \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
           (if (<= (* a b) -1e+213)
             (* a b)
             (if (<= (* a b) 5e-260) (* y x) (if (<= (* a b) 5e+50) (* 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) <= -1e+213) {
          		tmp = a * b;
          	} else if ((a * b) <= 5e-260) {
          		tmp = y * x;
          	} else if ((a * b) <= 5e+50) {
          		tmp = i * c;
          	} 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) <= (-1d+213)) then
                  tmp = a * b
              else if ((a * b) <= 5d-260) then
                  tmp = y * x
              else if ((a * b) <= 5d+50) then
                  tmp = i * c
              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) <= -1e+213) {
          		tmp = a * b;
          	} else if ((a * b) <= 5e-260) {
          		tmp = y * x;
          	} else if ((a * b) <= 5e+50) {
          		tmp = i * c;
          	} 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) <= -1e+213:
          		tmp = a * b
          	elif (a * b) <= 5e-260:
          		tmp = y * x
          	elif (a * b) <= 5e+50:
          		tmp = i * c
          	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) <= -1e+213)
          		tmp = Float64(a * b);
          	elseif (Float64(a * b) <= 5e-260)
          		tmp = Float64(y * x);
          	elseif (Float64(a * b) <= 5e+50)
          		tmp = Float64(i * c);
          	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) <= -1e+213)
          		tmp = a * b;
          	elseif ((a * b) <= 5e-260)
          		tmp = y * x;
          	elseif ((a * b) <= 5e+50)
          		tmp = i * c;
          	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], -1e+213], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e-260], N[(y * x), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 5e+50], N[(i * c), $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 -1 \cdot 10^{+213}:\\
          \;\;\;\;a \cdot b\\
          
          \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-260}:\\
          \;\;\;\;y \cdot x\\
          
          \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+50}:\\
          \;\;\;\;i \cdot c\\
          
          \mathbf{else}:\\
          \;\;\;\;a \cdot b\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 a b) < -9.99999999999999984e212 or 5e50 < (*.f64 a b)

            1. Initial program 87.6%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in b around inf

              \[\leadsto \color{blue}{a \cdot b} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} \]
              2. lower-*.f6459.4

                \[\leadsto \color{blue}{b \cdot a} \]
            5. Applied rewrites59.4%

              \[\leadsto \color{blue}{b \cdot a} \]

            if -9.99999999999999984e212 < (*.f64 a b) < 5.0000000000000003e-260

            1. Initial program 99.0%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in x around inf

              \[\leadsto \color{blue}{x \cdot y} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{y \cdot x} \]
              2. lower-*.f6449.1

                \[\leadsto \color{blue}{y \cdot x} \]
            5. Applied rewrites49.1%

              \[\leadsto \color{blue}{y \cdot x} \]

            if 5.0000000000000003e-260 < (*.f64 a b) < 5e50

            1. Initial program 100.0%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in c around inf

              \[\leadsto \color{blue}{c \cdot i} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{i \cdot c} \]
              2. lower-*.f6437.4

                \[\leadsto \color{blue}{i \cdot c} \]
            5. Applied rewrites37.4%

              \[\leadsto \color{blue}{i \cdot c} \]
          3. Recombined 3 regimes into one program.
          4. Final simplification49.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+213}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-260}:\\ \;\;\;\;y \cdot x\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{+50}:\\ \;\;\;\;i \cdot c\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
          5. Add Preprocessing

          Alternative 11: 66.9% accurate, 0.9× speedup?

          \[\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}\;t \cdot z \leq -4.4 \cdot 10^{+60}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq 3.85 \cdot 10^{+59}:\\ \;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\ \end{array} \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
           (if (<= (* t z) -4.4e+60)
             (fma y x (* t z))
             (if (<= (* t z) 3.85e+59) (fma b a (* y x)) (fma b a (* t z)))))
          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 ((t * z) <= -4.4e+60) {
          		tmp = fma(y, x, (t * z));
          	} else if ((t * z) <= 3.85e+59) {
          		tmp = fma(b, a, (y * x));
          	} else {
          		tmp = fma(b, a, (t * z));
          	}
          	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(t * z) <= -4.4e+60)
          		tmp = fma(y, x, Float64(t * z));
          	elseif (Float64(t * z) <= 3.85e+59)
          		tmp = fma(b, a, Float64(y * x));
          	else
          		tmp = fma(b, a, Float64(t * z));
          	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[(t * z), $MachinePrecision], -4.4e+60], N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 3.85e+59], N[(b * a + N[(y * x), $MachinePrecision]), $MachinePrecision], N[(b * a + N[(t * z), $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}\;t \cdot z \leq -4.4 \cdot 10^{+60}:\\
          \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\
          
          \mathbf{elif}\;t \cdot z \leq 3.85 \cdot 10^{+59}:\\
          \;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 z t) < -4.39999999999999992e60

            1. Initial program 96.0%

              \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
            2. Add Preprocessing
            3. Taylor expanded in c around 0

              \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
            4. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
              2. lower-fma.f64N/A

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
              3. +-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
              4. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
              5. lower-fma.f64N/A

                \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
              6. *-commutativeN/A

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
              7. lower-*.f6486.5

                \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
            5. Applied rewrites86.5%

              \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
            6. Taylor expanded in b around 0

              \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
            7. Step-by-step derivation
              1. Applied rewrites80.6%

                \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, z \cdot t\right) \]

              if -4.39999999999999992e60 < (*.f64 z t) < 3.84999999999999993e59

              1. Initial program 95.6%

                \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
              2. Add Preprocessing
              3. Taylor expanded in c around 0

                \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
              4. Step-by-step derivation
                1. *-commutativeN/A

                  \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
                2. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
                3. +-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
                4. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
                5. lower-fma.f64N/A

                  \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
                6. *-commutativeN/A

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                7. lower-*.f6471.7

                  \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
              5. Applied rewrites71.7%

                \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
              6. Taylor expanded in t around 0

                \[\leadsto \mathsf{fma}\left(b, a, x \cdot y\right) \]
              7. Step-by-step derivation
                1. Applied rewrites68.9%

                  \[\leadsto \mathsf{fma}\left(b, a, y \cdot x\right) \]

                if 3.84999999999999993e59 < (*.f64 z t)

                1. Initial program 93.2%

                  \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                2. Add Preprocessing
                3. Taylor expanded in c around 0

                  \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
                  2. lower-fma.f64N/A

                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
                  3. +-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
                  5. lower-fma.f64N/A

                    \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
                  6. *-commutativeN/A

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                  7. lower-*.f6487.9

                    \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                5. Applied rewrites87.9%

                  \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
                6. Taylor expanded in t around inf

                  \[\leadsto \mathsf{fma}\left(b, a, t \cdot z\right) \]
                7. Step-by-step derivation
                  1. Applied rewrites82.2%

                    \[\leadsto \mathsf{fma}\left(b, a, z \cdot t\right) \]
                8. Recombined 3 regimes into one program.
                9. Final simplification73.5%

                  \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -4.4 \cdot 10^{+60}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq 3.85 \cdot 10^{+59}:\\ \;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(b, a, t \cdot z\right)\\ \end{array} \]
                10. Add Preprocessing

                Alternative 12: 66.6% accurate, 0.9× speedup?

                \[\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(y, x, t \cdot z\right)\\ \mathbf{if}\;t \cdot z \leq -4.4 \cdot 10^{+60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 4.4 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \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 (fma y x (* t z))))
                   (if (<= (* t z) -4.4e+60)
                     t_1
                     (if (<= (* t z) 4.4e+68) (fma b a (* y x)) 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(y, x, (t * z));
                	double tmp;
                	if ((t * z) <= -4.4e+60) {
                		tmp = t_1;
                	} else if ((t * z) <= 4.4e+68) {
                		tmp = fma(b, a, (y * x));
                	} 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(y, x, Float64(t * z))
                	tmp = 0.0
                	if (Float64(t * z) <= -4.4e+60)
                		tmp = t_1;
                	elseif (Float64(t * z) <= 4.4e+68)
                		tmp = fma(b, a, Float64(y * x));
                	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[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -4.4e+60], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 4.4e+68], N[(b * a + N[(y * x), $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(y, x, t \cdot z\right)\\
                \mathbf{if}\;t \cdot z \leq -4.4 \cdot 10^{+60}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;t \cdot z \leq 4.4 \cdot 10^{+68}:\\
                \;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 z t) < -4.39999999999999992e60 or 4.39999999999999974e68 < (*.f64 z t)

                  1. Initial program 94.5%

                    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                  2. Add Preprocessing
                  3. Taylor expanded in c around 0

                    \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
                  4. Step-by-step derivation
                    1. *-commutativeN/A

                      \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
                    2. lower-fma.f64N/A

                      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
                    3. +-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
                    4. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
                    5. lower-fma.f64N/A

                      \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
                    6. *-commutativeN/A

                      \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                    7. lower-*.f6487.9

                      \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                  5. Applied rewrites87.9%

                    \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
                  6. Taylor expanded in b around 0

                    \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
                  7. Step-by-step derivation
                    1. Applied rewrites81.7%

                      \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, z \cdot t\right) \]

                    if -4.39999999999999992e60 < (*.f64 z t) < 4.39999999999999974e68

                    1. Initial program 95.7%

                      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                    2. Add Preprocessing
                    3. Taylor expanded in c around 0

                      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
                      2. lower-fma.f64N/A

                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
                      3. +-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
                      4. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
                      5. lower-fma.f64N/A

                        \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
                      6. *-commutativeN/A

                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                      7. lower-*.f6471.5

                        \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                    5. Applied rewrites71.5%

                      \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
                    6. Taylor expanded in t around 0

                      \[\leadsto \mathsf{fma}\left(b, a, x \cdot y\right) \]
                    7. Step-by-step derivation
                      1. Applied rewrites68.7%

                        \[\leadsto \mathsf{fma}\left(b, a, y \cdot x\right) \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification73.4%

                      \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -4.4 \cdot 10^{+60}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq 4.4 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{fma}\left(b, a, y \cdot x\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \end{array} \]
                    10. Add Preprocessing

                    Alternative 13: 61.0% accurate, 0.9× speedup?

                    \[\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}\;i \cdot c \leq -2 \cdot 10^{+105}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;i \cdot c \leq 4 \cdot 10^{+297}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \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
                     (if (<= (* i c) -2e+105)
                       (* i c)
                       (if (<= (* i c) 4e+297) (fma y x (* t z)) (* i c))))
                    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 ((i * c) <= -2e+105) {
                    		tmp = i * c;
                    	} else if ((i * c) <= 4e+297) {
                    		tmp = fma(y, x, (t * z));
                    	} else {
                    		tmp = i * c;
                    	}
                    	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(i * c) <= -2e+105)
                    		tmp = Float64(i * c);
                    	elseif (Float64(i * c) <= 4e+297)
                    		tmp = fma(y, x, Float64(t * z));
                    	else
                    		tmp = Float64(i * c);
                    	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[(i * c), $MachinePrecision], -2e+105], N[(i * c), $MachinePrecision], If[LessEqual[N[(i * c), $MachinePrecision], 4e+297], N[(y * x + N[(t * z), $MachinePrecision]), $MachinePrecision], N[(i * c), $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}\;i \cdot c \leq -2 \cdot 10^{+105}:\\
                    \;\;\;\;i \cdot c\\
                    
                    \mathbf{elif}\;i \cdot c \leq 4 \cdot 10^{+297}:\\
                    \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;i \cdot c\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (*.f64 c i) < -1.9999999999999999e105 or 4.0000000000000001e297 < (*.f64 c i)

                      1. Initial program 87.2%

                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around inf

                        \[\leadsto \color{blue}{c \cdot i} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{i \cdot c} \]
                        2. lower-*.f6475.2

                          \[\leadsto \color{blue}{i \cdot c} \]
                      5. Applied rewrites75.2%

                        \[\leadsto \color{blue}{i \cdot c} \]

                      if -1.9999999999999999e105 < (*.f64 c i) < 4.0000000000000001e297

                      1. Initial program 97.5%

                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                      2. Add Preprocessing
                      3. Taylor expanded in c around 0

                        \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{b \cdot a} + \left(t \cdot z + x \cdot y\right) \]
                        2. lower-fma.f64N/A

                          \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, t \cdot z + x \cdot y\right)} \]
                        3. +-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{x \cdot y + t \cdot z}\right) \]
                        4. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{y \cdot x} + t \cdot z\right) \]
                        5. lower-fma.f64N/A

                          \[\leadsto \mathsf{fma}\left(b, a, \color{blue}{\mathsf{fma}\left(y, x, t \cdot z\right)}\right) \]
                        6. *-commutativeN/A

                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                        7. lower-*.f6487.5

                          \[\leadsto \mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, \color{blue}{z \cdot t}\right)\right) \]
                      5. Applied rewrites87.5%

                        \[\leadsto \color{blue}{\mathsf{fma}\left(b, a, \mathsf{fma}\left(y, x, z \cdot t\right)\right)} \]
                      6. Taylor expanded in b around 0

                        \[\leadsto t \cdot z + \color{blue}{x \cdot y} \]
                      7. Step-by-step derivation
                        1. Applied rewrites65.5%

                          \[\leadsto \mathsf{fma}\left(y, \color{blue}{x}, z \cdot t\right) \]
                      8. Recombined 2 regimes into one program.
                      9. Final simplification67.5%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;i \cdot c \leq -2 \cdot 10^{+105}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;i \cdot c \leq 4 \cdot 10^{+297}:\\ \;\;\;\;\mathsf{fma}\left(y, x, t \cdot z\right)\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \]
                      10. Add Preprocessing

                      Alternative 14: 42.5% accurate, 1.1× speedup?

                      \[\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}\;i \cdot c \leq -4 \cdot 10^{-31}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;i \cdot c \leq 10^{+57}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \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
                       (if (<= (* i c) -4e-31) (* i c) (if (<= (* i c) 1e+57) (* a b) (* i c))))
                      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 ((i * c) <= -4e-31) {
                      		tmp = i * c;
                      	} else if ((i * c) <= 1e+57) {
                      		tmp = a * b;
                      	} else {
                      		tmp = i * c;
                      	}
                      	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 ((i * c) <= (-4d-31)) then
                              tmp = i * c
                          else if ((i * c) <= 1d+57) then
                              tmp = a * b
                          else
                              tmp = i * c
                          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 ((i * c) <= -4e-31) {
                      		tmp = i * c;
                      	} else if ((i * c) <= 1e+57) {
                      		tmp = a * b;
                      	} else {
                      		tmp = i * c;
                      	}
                      	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 (i * c) <= -4e-31:
                      		tmp = i * c
                      	elif (i * c) <= 1e+57:
                      		tmp = a * b
                      	else:
                      		tmp = i * c
                      	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(i * c) <= -4e-31)
                      		tmp = Float64(i * c);
                      	elseif (Float64(i * c) <= 1e+57)
                      		tmp = Float64(a * b);
                      	else
                      		tmp = Float64(i * c);
                      	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 ((i * c) <= -4e-31)
                      		tmp = i * c;
                      	elseif ((i * c) <= 1e+57)
                      		tmp = a * b;
                      	else
                      		tmp = i * c;
                      	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[(i * c), $MachinePrecision], -4e-31], N[(i * c), $MachinePrecision], If[LessEqual[N[(i * c), $MachinePrecision], 1e+57], N[(a * b), $MachinePrecision], N[(i * c), $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}\;i \cdot c \leq -4 \cdot 10^{-31}:\\
                      \;\;\;\;i \cdot c\\
                      
                      \mathbf{elif}\;i \cdot c \leq 10^{+57}:\\
                      \;\;\;\;a \cdot b\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;i \cdot c\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 c i) < -4e-31 or 1.00000000000000005e57 < (*.f64 c i)

                        1. Initial program 92.3%

                          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                        2. Add Preprocessing
                        3. Taylor expanded in c around inf

                          \[\leadsto \color{blue}{c \cdot i} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{i \cdot c} \]
                          2. lower-*.f6447.1

                            \[\leadsto \color{blue}{i \cdot c} \]
                        5. Applied rewrites47.1%

                          \[\leadsto \color{blue}{i \cdot c} \]

                        if -4e-31 < (*.f64 c i) < 1.00000000000000005e57

                        1. Initial program 97.8%

                          \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                        2. Add Preprocessing
                        3. Taylor expanded in b around inf

                          \[\leadsto \color{blue}{a \cdot b} \]
                        4. Step-by-step derivation
                          1. *-commutativeN/A

                            \[\leadsto \color{blue}{b \cdot a} \]
                          2. lower-*.f6431.9

                            \[\leadsto \color{blue}{b \cdot a} \]
                        5. Applied rewrites31.9%

                          \[\leadsto \color{blue}{b \cdot a} \]
                      3. Recombined 2 regimes into one program.
                      4. Final simplification38.9%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;i \cdot c \leq -4 \cdot 10^{-31}:\\ \;\;\;\;i \cdot c\\ \mathbf{elif}\;i \cdot c \leq 10^{+57}:\\ \;\;\;\;a \cdot b\\ \mathbf{else}:\\ \;\;\;\;i \cdot c\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 15: 27.8% accurate, 5.0× speedup?

                      \[\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} \]
                      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}
                      
                      Derivation
                      1. Initial program 95.3%

                        \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
                      2. Add Preprocessing
                      3. Taylor expanded in b around inf

                        \[\leadsto \color{blue}{a \cdot b} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{b \cdot a} \]
                        2. lower-*.f6425.0

                          \[\leadsto \color{blue}{b \cdot a} \]
                      5. Applied rewrites25.0%

                        \[\leadsto \color{blue}{b \cdot a} \]
                      6. Final simplification25.0%

                        \[\leadsto a \cdot b \]
                      7. Add Preprocessing

                      Reproduce

                      ?
                      herbie shell --seed 2024268 
                      (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)))