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

Percentage Accurate: 95.9% → 98.5%
Time: 11.7s
Alternatives: 16
Speedup: 0.4×

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 16 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: 98.5% 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 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\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
 (let* ((t_1 (+ (* c i) (+ (* a b) (+ (* x y) (* z t))))))
   (if (<= t_1 INFINITY) t_1 (* a (+ b (+ (* t (/ z a)) (* x (/ y a))))))))
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 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = t_1;
	} else {
		tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
	}
	return tmp;
}
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 t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else {
		tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
	}
	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):
	t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)))
	tmp = 0
	if t_1 <= math.inf:
		tmp = t_1
	else:
		tmp = a * (b + ((t * (z / a)) + (x * (y / a))))
	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(c * i) + Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = Float64(a * Float64(b + Float64(Float64(t * Float64(z / a)) + Float64(x * Float64(y / a)))));
	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)
	t_1 = (c * i) + ((a * b) + ((x * y) + (z * t)));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = t_1;
	else
		tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
	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_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(b + N[(N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := c \cdot i + \left(a \cdot b + \left(x \cdot y + z \cdot t\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0

    1. Initial program 100.0%

      \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
    2. Add Preprocessing

    if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i))

    1. Initial program 0.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 33.3%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 44.4%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*66.7%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*66.7%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified66.7%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification98.8%

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

Alternative 2: 97.9% accurate, 0.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right) \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
 (fma c i (fma x y (fma z t (* a b)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma(c, i, fma(x, y, fma(z, t, (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 fma(c, i, fma(x, y, fma(z, t, Float64(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[(c * i + N[(x * y + N[(z * t + 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])\\
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(x, y, \mathsf{fma}\left(z, t, a \cdot b\right)\right)\right)
\end{array}
Derivation
  1. Initial program 96.5%

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
  2. Step-by-step derivation
    1. +-commutative96.5%

      \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    2. fma-define97.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    3. associate-+l+97.7%

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

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

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

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

Alternative 3: 98.0% accurate, 0.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right) \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
 (fma c i (fma a b (fma x y (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return fma(c, i, fma(a, b, fma(x, y, (z * t))));
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	return fma(c, i, fma(a, b, fma(x, y, Float64(z * t))))
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[(c * i + N[(a * b + N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\mathsf{fma}\left(c, i, \mathsf{fma}\left(a, b, \mathsf{fma}\left(x, y, z \cdot t\right)\right)\right)
\end{array}
Derivation
  1. Initial program 96.5%

    \[\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i \]
  2. Step-by-step derivation
    1. +-commutative96.5%

      \[\leadsto \color{blue}{c \cdot i + \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    2. fma-define97.7%

      \[\leadsto \color{blue}{\mathsf{fma}\left(c, i, \left(x \cdot y + z \cdot t\right) + a \cdot b\right)} \]
    3. +-commutative97.7%

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

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

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

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

Alternative 4: 65.0% accurate, 0.2× 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 := a \cdot \left(b + \frac{x \cdot y}{a}\right)\\ t_2 := c \cdot i + z \cdot t\\ t_3 := x \cdot y + c \cdot i\\ \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+246}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+144}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+104}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-85}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-233}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-111}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 10^{-47}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+121}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \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 (* a (+ b (/ (* x y) a))))
        (t_2 (+ (* c i) (* z t)))
        (t_3 (+ (* x y) (* c i))))
   (if (<= (* a b) -5e+246)
     t_1
     (if (<= (* a b) -5e+144)
       t_2
       (if (<= (* a b) -2e+104)
         t_1
         (if (<= (* a b) -1e-85)
           t_2
           (if (<= (* a b) 5e-233)
             t_3
             (if (<= (* a b) 5e-111)
               (+ (* x y) (* z t))
               (if (<= (* a b) 1e-47)
                 t_3
                 (if (<= (* a b) 4e+121) t_2 (+ (* a b) (* c i))))))))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a * (b + ((x * y) / a));
	double t_2 = (c * i) + (z * t);
	double t_3 = (x * y) + (c * i);
	double tmp;
	if ((a * b) <= -5e+246) {
		tmp = t_1;
	} else if ((a * b) <= -5e+144) {
		tmp = t_2;
	} else if ((a * b) <= -2e+104) {
		tmp = t_1;
	} else if ((a * b) <= -1e-85) {
		tmp = t_2;
	} else if ((a * b) <= 5e-233) {
		tmp = t_3;
	} else if ((a * b) <= 5e-111) {
		tmp = (x * y) + (z * t);
	} else if ((a * b) <= 1e-47) {
		tmp = t_3;
	} else if ((a * b) <= 4e+121) {
		tmp = t_2;
	} else {
		tmp = (a * b) + (c * i);
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = a * (b + ((x * y) / a))
    t_2 = (c * i) + (z * t)
    t_3 = (x * y) + (c * i)
    if ((a * b) <= (-5d+246)) then
        tmp = t_1
    else if ((a * b) <= (-5d+144)) then
        tmp = t_2
    else if ((a * b) <= (-2d+104)) then
        tmp = t_1
    else if ((a * b) <= (-1d-85)) then
        tmp = t_2
    else if ((a * b) <= 5d-233) then
        tmp = t_3
    else if ((a * b) <= 5d-111) then
        tmp = (x * y) + (z * t)
    else if ((a * b) <= 1d-47) then
        tmp = t_3
    else if ((a * b) <= 4d+121) then
        tmp = t_2
    else
        tmp = (a * b) + (c * i)
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a * (b + ((x * y) / a));
	double t_2 = (c * i) + (z * t);
	double t_3 = (x * y) + (c * i);
	double tmp;
	if ((a * b) <= -5e+246) {
		tmp = t_1;
	} else if ((a * b) <= -5e+144) {
		tmp = t_2;
	} else if ((a * b) <= -2e+104) {
		tmp = t_1;
	} else if ((a * b) <= -1e-85) {
		tmp = t_2;
	} else if ((a * b) <= 5e-233) {
		tmp = t_3;
	} else if ((a * b) <= 5e-111) {
		tmp = (x * y) + (z * t);
	} else if ((a * b) <= 1e-47) {
		tmp = t_3;
	} else if ((a * b) <= 4e+121) {
		tmp = t_2;
	} else {
		tmp = (a * b) + (c * i);
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = a * (b + ((x * y) / a))
	t_2 = (c * i) + (z * t)
	t_3 = (x * y) + (c * i)
	tmp = 0
	if (a * b) <= -5e+246:
		tmp = t_1
	elif (a * b) <= -5e+144:
		tmp = t_2
	elif (a * b) <= -2e+104:
		tmp = t_1
	elif (a * b) <= -1e-85:
		tmp = t_2
	elif (a * b) <= 5e-233:
		tmp = t_3
	elif (a * b) <= 5e-111:
		tmp = (x * y) + (z * t)
	elif (a * b) <= 1e-47:
		tmp = t_3
	elif (a * b) <= 4e+121:
		tmp = t_2
	else:
		tmp = (a * b) + (c * i)
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a * Float64(b + Float64(Float64(x * y) / a)))
	t_2 = Float64(Float64(c * i) + Float64(z * t))
	t_3 = Float64(Float64(x * y) + Float64(c * i))
	tmp = 0.0
	if (Float64(a * b) <= -5e+246)
		tmp = t_1;
	elseif (Float64(a * b) <= -5e+144)
		tmp = t_2;
	elseif (Float64(a * b) <= -2e+104)
		tmp = t_1;
	elseif (Float64(a * b) <= -1e-85)
		tmp = t_2;
	elseif (Float64(a * b) <= 5e-233)
		tmp = t_3;
	elseif (Float64(a * b) <= 5e-111)
		tmp = Float64(Float64(x * y) + Float64(z * t));
	elseif (Float64(a * b) <= 1e-47)
		tmp = t_3;
	elseif (Float64(a * b) <= 4e+121)
		tmp = t_2;
	else
		tmp = Float64(Float64(a * b) + Float64(c * i));
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a * (b + ((x * y) / a));
	t_2 = (c * i) + (z * t);
	t_3 = (x * y) + (c * i);
	tmp = 0.0;
	if ((a * b) <= -5e+246)
		tmp = t_1;
	elseif ((a * b) <= -5e+144)
		tmp = t_2;
	elseif ((a * b) <= -2e+104)
		tmp = t_1;
	elseif ((a * b) <= -1e-85)
		tmp = t_2;
	elseif ((a * b) <= 5e-233)
		tmp = t_3;
	elseif ((a * b) <= 5e-111)
		tmp = (x * y) + (z * t);
	elseif ((a * b) <= 1e-47)
		tmp = t_3;
	elseif ((a * b) <= 4e+121)
		tmp = t_2;
	else
		tmp = (a * b) + (c * i);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a * N[(b + N[(N[(x * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -5e+246], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -5e+144], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], -2e+104], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], -1e-85], t$95$2, If[LessEqual[N[(a * b), $MachinePrecision], 5e-233], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 5e-111], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1e-47], t$95$3, If[LessEqual[N[(a * b), $MachinePrecision], 4e+121], t$95$2, N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(b + \frac{x \cdot y}{a}\right)\\
t_2 := c \cdot i + z \cdot t\\
t_3 := x \cdot y + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+246}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+144}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+104}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-85}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-233}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-111}:\\
\;\;\;\;x \cdot y + z \cdot t\\

\mathbf{elif}\;a \cdot b \leq 10^{-47}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+121}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 a b) < -4.99999999999999976e246 or -4.9999999999999999e144 < (*.f64 a b) < -2e104

    1. Initial program 86.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 89.7%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 89.7%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*96.6%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*96.6%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified96.6%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
    7. Taylor expanded in t around 0 93.2%

      \[\leadsto \color{blue}{a \cdot \left(b + \frac{x \cdot y}{a}\right)} \]

    if -4.99999999999999976e246 < (*.f64 a b) < -4.9999999999999999e144 or -2e104 < (*.f64 a b) < -9.9999999999999998e-86 or 9.9999999999999997e-48 < (*.f64 a b) < 4.00000000000000015e121

    1. Initial program 98.8%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in x around 0 79.5%

      \[\leadsto \color{blue}{c \cdot i + t \cdot z} \]

    if -9.9999999999999998e-86 < (*.f64 a b) < 5.00000000000000012e-233 or 5.0000000000000003e-111 < (*.f64 a b) < 9.9999999999999997e-48

    1. Initial program 96.5%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in t around 0 77.9%

      \[\leadsto \color{blue}{c \cdot i + x \cdot y} \]

    if 5.00000000000000012e-233 < (*.f64 a b) < 5.0000000000000003e-111

    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 0 93.3%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 74.5%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*74.5%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*67.8%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified67.8%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
    7. Taylor expanded in a around 0 93.3%

      \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]

    if 4.00000000000000015e121 < (*.f64 a b)

    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 x around 0 91.1%

      \[\leadsto \left(\color{blue}{t \cdot z} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in t around 0 84.7%

      \[\leadsto \color{blue}{a \cdot b + c \cdot i} \]
  3. Recombined 5 regimes into one program.
  4. Final simplification82.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+246}:\\ \;\;\;\;a \cdot \left(b + \frac{x \cdot y}{a}\right)\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+144}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq -2 \cdot 10^{+104}:\\ \;\;\;\;a \cdot \left(b + \frac{x \cdot y}{a}\right)\\ \mathbf{elif}\;a \cdot b \leq -1 \cdot 10^{-85}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-233}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 5 \cdot 10^{-111}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;a \cdot b \leq 10^{-47}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;a \cdot b \leq 4 \cdot 10^{+121}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 65.7% 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 := a \cdot b + z \cdot t\\ t_2 := c \cdot i + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+103}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \cdot i \leq -105:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq -3.9 \cdot 10^{-43}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-279}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+65}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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 (+ (* a b) (* z t))) (t_2 (+ (* c i) (* z t))))
   (if (<= (* c i) -3.8e+103)
     t_2
     (if (<= (* c i) -105.0)
       t_1
       (if (<= (* c i) -3.9e-43)
         (+ (* x y) (* c i))
         (if (<= (* c i) -1.55e-279)
           (+ (* x y) (* z t))
           (if (<= (* c i) 4.5e+65) t_1 t_2)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double t_2 = (c * i) + (z * t);
	double tmp;
	if ((c * i) <= -3.8e+103) {
		tmp = t_2;
	} else if ((c * i) <= -105.0) {
		tmp = t_1;
	} else if ((c * i) <= -3.9e-43) {
		tmp = (x * y) + (c * i);
	} else if ((c * i) <= -1.55e-279) {
		tmp = (x * y) + (z * t);
	} else if ((c * i) <= 4.5e+65) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    t_2 = (c * i) + (z * t)
    if ((c * i) <= (-3.8d+103)) then
        tmp = t_2
    else if ((c * i) <= (-105.0d0)) then
        tmp = t_1
    else if ((c * i) <= (-3.9d-43)) then
        tmp = (x * y) + (c * i)
    else if ((c * i) <= (-1.55d-279)) then
        tmp = (x * y) + (z * t)
    else if ((c * i) <= 4.5d+65) then
        tmp = t_1
    else
        tmp = t_2
    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 t_1 = (a * b) + (z * t);
	double t_2 = (c * i) + (z * t);
	double tmp;
	if ((c * i) <= -3.8e+103) {
		tmp = t_2;
	} else if ((c * i) <= -105.0) {
		tmp = t_1;
	} else if ((c * i) <= -3.9e-43) {
		tmp = (x * y) + (c * i);
	} else if ((c * i) <= -1.55e-279) {
		tmp = (x * y) + (z * t);
	} else if ((c * i) <= 4.5e+65) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	t_2 = (c * i) + (z * t)
	tmp = 0
	if (c * i) <= -3.8e+103:
		tmp = t_2
	elif (c * i) <= -105.0:
		tmp = t_1
	elif (c * i) <= -3.9e-43:
		tmp = (x * y) + (c * i)
	elif (c * i) <= -1.55e-279:
		tmp = (x * y) + (z * t)
	elif (c * i) <= 4.5e+65:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(z * t))
	t_2 = Float64(Float64(c * i) + Float64(z * t))
	tmp = 0.0
	if (Float64(c * i) <= -3.8e+103)
		tmp = t_2;
	elseif (Float64(c * i) <= -105.0)
		tmp = t_1;
	elseif (Float64(c * i) <= -3.9e-43)
		tmp = Float64(Float64(x * y) + Float64(c * i));
	elseif (Float64(c * i) <= -1.55e-279)
		tmp = Float64(Float64(x * y) + Float64(z * t));
	elseif (Float64(c * i) <= 4.5e+65)
		tmp = t_1;
	else
		tmp = t_2;
	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)
	t_1 = (a * b) + (z * t);
	t_2 = (c * i) + (z * t);
	tmp = 0.0;
	if ((c * i) <= -3.8e+103)
		tmp = t_2;
	elseif ((c * i) <= -105.0)
		tmp = t_1;
	elseif ((c * i) <= -3.9e-43)
		tmp = (x * y) + (c * i);
	elseif ((c * i) <= -1.55e-279)
		tmp = (x * y) + (z * t);
	elseif ((c * i) <= 4.5e+65)
		tmp = t_1;
	else
		tmp = t_2;
	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_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -3.8e+103], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -105.0], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -3.9e-43], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -1.55e-279], N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 4.5e+65], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+103}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \cdot i \leq -105:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq -3.9 \cdot 10^{-43}:\\
\;\;\;\;x \cdot y + c \cdot i\\

\mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-279}:\\
\;\;\;\;x \cdot y + z \cdot t\\

\mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -3.7999999999999997e103 or 4.5e65 < (*.f64 c i)

    1. Initial program 95.4%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in x around 0 84.5%

      \[\leadsto \color{blue}{c \cdot i + t \cdot z} \]

    if -3.7999999999999997e103 < (*.f64 c i) < -105 or -1.55e-279 < (*.f64 c i) < 4.5e65

    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 x around 0 73.2%

      \[\leadsto \left(\color{blue}{t \cdot z} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in c around 0 69.9%

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]

    if -105 < (*.f64 c i) < -3.9e-43

    1. Initial program 88.9%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in t around 0 79.1%

      \[\leadsto \color{blue}{c \cdot i + x \cdot y} \]

    if -3.9e-43 < (*.f64 c i) < -1.55e-279

    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 0 100.0%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 74.9%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*74.9%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*69.2%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified69.2%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
    7. Taylor expanded in a around 0 77.4%

      \[\leadsto \color{blue}{t \cdot z + x \cdot y} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification77.4%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -3.8 \cdot 10^{+103}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -105:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -3.9 \cdot 10^{-43}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-279}:\\ \;\;\;\;x \cdot y + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq 4.5 \cdot 10^{+65}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 43.4% 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} \mathbf{if}\;c \cdot i \leq -9 \cdot 10^{+102}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -2.8 \cdot 10^{-279}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{-20}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{+32}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 9.5 \cdot 10^{+56}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \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 (<= (* c i) -9e+102)
   (* c i)
   (if (<= (* c i) -2.8e-279)
     (* x y)
     (if (<= (* c i) 2.5e-20)
       (* a b)
       (if (<= (* c i) 1.5e+32)
         (* x y)
         (if (<= (* c i) 9.5e+56) (* z t) (* c i)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c * i) <= -9e+102) {
		tmp = c * i;
	} else if ((c * i) <= -2.8e-279) {
		tmp = x * y;
	} else if ((c * i) <= 2.5e-20) {
		tmp = a * b;
	} else if ((c * i) <= 1.5e+32) {
		tmp = x * y;
	} else if ((c * i) <= 9.5e+56) {
		tmp = z * t;
	} else {
		tmp = c * i;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((c * i) <= (-9d+102)) then
        tmp = c * i
    else if ((c * i) <= (-2.8d-279)) then
        tmp = x * y
    else if ((c * i) <= 2.5d-20) then
        tmp = a * b
    else if ((c * i) <= 1.5d+32) then
        tmp = x * y
    else if ((c * i) <= 9.5d+56) then
        tmp = z * t
    else
        tmp = c * i
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c * i) <= -9e+102) {
		tmp = c * i;
	} else if ((c * i) <= -2.8e-279) {
		tmp = x * y;
	} else if ((c * i) <= 2.5e-20) {
		tmp = a * b;
	} else if ((c * i) <= 1.5e+32) {
		tmp = x * y;
	} else if ((c * i) <= 9.5e+56) {
		tmp = z * t;
	} else {
		tmp = c * i;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c * i) <= -9e+102:
		tmp = c * i
	elif (c * i) <= -2.8e-279:
		tmp = x * y
	elif (c * i) <= 2.5e-20:
		tmp = a * b
	elif (c * i) <= 1.5e+32:
		tmp = x * y
	elif (c * i) <= 9.5e+56:
		tmp = z * t
	else:
		tmp = c * i
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(c * i) <= -9e+102)
		tmp = Float64(c * i);
	elseif (Float64(c * i) <= -2.8e-279)
		tmp = Float64(x * y);
	elseif (Float64(c * i) <= 2.5e-20)
		tmp = Float64(a * b);
	elseif (Float64(c * i) <= 1.5e+32)
		tmp = Float64(x * y);
	elseif (Float64(c * i) <= 9.5e+56)
		tmp = Float64(z * t);
	else
		tmp = Float64(c * i);
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c * i) <= -9e+102)
		tmp = c * i;
	elseif ((c * i) <= -2.8e-279)
		tmp = x * y;
	elseif ((c * i) <= 2.5e-20)
		tmp = a * b;
	elseif ((c * i) <= 1.5e+32)
		tmp = x * y;
	elseif ((c * i) <= 9.5e+56)
		tmp = z * t;
	else
		tmp = c * i;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -9e+102], N[(c * i), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], -2.8e-279], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2.5e-20], N[(a * b), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.5e+32], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 9.5e+56], N[(z * t), $MachinePrecision], N[(c * i), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -9 \cdot 10^{+102}:\\
\;\;\;\;c \cdot i\\

\mathbf{elif}\;c \cdot i \leq -2.8 \cdot 10^{-279}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{-20}:\\
\;\;\;\;a \cdot b\\

\mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{+32}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;c \cdot i \leq 9.5 \cdot 10^{+56}:\\
\;\;\;\;z \cdot t\\

\mathbf{else}:\\
\;\;\;\;c \cdot i\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 c i) < -9.00000000000000042e102 or 9.4999999999999997e56 < (*.f64 c i)

    1. Initial program 95.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 66.9%

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

    if -9.00000000000000042e102 < (*.f64 c i) < -2.8000000000000001e-279 or 2.4999999999999999e-20 < (*.f64 c i) < 1.5e32

    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 c around 0 94.3%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 72.5%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*73.9%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*71.1%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified71.1%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
    7. Taylor expanded in x around inf 45.7%

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

    if -2.8000000000000001e-279 < (*.f64 c i) < 2.4999999999999999e-20

    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 a around inf 44.0%

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

    if 1.5e32 < (*.f64 c i) < 9.4999999999999997e56

    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 0 100.0%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 66.7%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*66.7%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*66.7%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified66.7%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
    7. Taylor expanded in t around inf 66.9%

      \[\leadsto \color{blue}{t \cdot z} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification54.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -9 \cdot 10^{+102}:\\ \;\;\;\;c \cdot i\\ \mathbf{elif}\;c \cdot i \leq -2.8 \cdot 10^{-279}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 2.5 \cdot 10^{-20}:\\ \;\;\;\;a \cdot b\\ \mathbf{elif}\;c \cdot i \leq 1.5 \cdot 10^{+32}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 9.5 \cdot 10^{+56}:\\ \;\;\;\;z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 65.6% 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 := a \cdot b + z \cdot t\\ t_2 := c \cdot i + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -6.5 \cdot 10^{+104}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \cdot i \leq -0.0024:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-70}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 8.5 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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 (+ (* a b) (* z t))) (t_2 (+ (* c i) (* z t))))
   (if (<= (* c i) -6.5e+104)
     t_2
     (if (<= (* c i) -0.0024)
       t_1
       (if (<= (* c i) -1.55e-70)
         (+ (* x y) (* c i))
         (if (<= (* c i) 8.5e+64) t_1 t_2))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double t_2 = (c * i) + (z * t);
	double tmp;
	if ((c * i) <= -6.5e+104) {
		tmp = t_2;
	} else if ((c * i) <= -0.0024) {
		tmp = t_1;
	} else if ((c * i) <= -1.55e-70) {
		tmp = (x * y) + (c * i);
	} else if ((c * i) <= 8.5e+64) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    t_2 = (c * i) + (z * t)
    if ((c * i) <= (-6.5d+104)) then
        tmp = t_2
    else if ((c * i) <= (-0.0024d0)) then
        tmp = t_1
    else if ((c * i) <= (-1.55d-70)) then
        tmp = (x * y) + (c * i)
    else if ((c * i) <= 8.5d+64) then
        tmp = t_1
    else
        tmp = t_2
    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 t_1 = (a * b) + (z * t);
	double t_2 = (c * i) + (z * t);
	double tmp;
	if ((c * i) <= -6.5e+104) {
		tmp = t_2;
	} else if ((c * i) <= -0.0024) {
		tmp = t_1;
	} else if ((c * i) <= -1.55e-70) {
		tmp = (x * y) + (c * i);
	} else if ((c * i) <= 8.5e+64) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	t_2 = (c * i) + (z * t)
	tmp = 0
	if (c * i) <= -6.5e+104:
		tmp = t_2
	elif (c * i) <= -0.0024:
		tmp = t_1
	elif (c * i) <= -1.55e-70:
		tmp = (x * y) + (c * i)
	elif (c * i) <= 8.5e+64:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(z * t))
	t_2 = Float64(Float64(c * i) + Float64(z * t))
	tmp = 0.0
	if (Float64(c * i) <= -6.5e+104)
		tmp = t_2;
	elseif (Float64(c * i) <= -0.0024)
		tmp = t_1;
	elseif (Float64(c * i) <= -1.55e-70)
		tmp = Float64(Float64(x * y) + Float64(c * i));
	elseif (Float64(c * i) <= 8.5e+64)
		tmp = t_1;
	else
		tmp = t_2;
	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)
	t_1 = (a * b) + (z * t);
	t_2 = (c * i) + (z * t);
	tmp = 0.0;
	if ((c * i) <= -6.5e+104)
		tmp = t_2;
	elseif ((c * i) <= -0.0024)
		tmp = t_1;
	elseif ((c * i) <= -1.55e-70)
		tmp = (x * y) + (c * i);
	elseif ((c * i) <= 8.5e+64)
		tmp = t_1;
	else
		tmp = t_2;
	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_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -6.5e+104], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -0.0024], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -1.55e-70], N[(N[(x * y), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 8.5e+64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -6.5 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \cdot i \leq -0.0024:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-70}:\\
\;\;\;\;x \cdot y + c \cdot i\\

\mathbf{elif}\;c \cdot i \leq 8.5 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -6.5000000000000005e104 or 8.4999999999999998e64 < (*.f64 c i)

    1. Initial program 95.4%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in x around 0 84.5%

      \[\leadsto \color{blue}{c \cdot i + t \cdot z} \]

    if -6.5000000000000005e104 < (*.f64 c i) < -0.00239999999999999979 or -1.55e-70 < (*.f64 c i) < 8.4999999999999998e64

    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 x around 0 70.2%

      \[\leadsto \left(\color{blue}{t \cdot z} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in c around 0 67.7%

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]

    if -0.00239999999999999979 < (*.f64 c i) < -1.55e-70

    1. Initial program 90.9%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in t around 0 82.9%

      \[\leadsto \color{blue}{c \cdot i + x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.5%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -6.5 \cdot 10^{+104}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -0.0024:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-70}:\\ \;\;\;\;x \cdot y + c \cdot i\\ \mathbf{elif}\;c \cdot i \leq 8.5 \cdot 10^{+64}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 65.1% 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 := a \cdot b + z \cdot t\\ t_2 := c \cdot i + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+104}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \cdot i \leq -6.5:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-70}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 1.7 \cdot 10^{+64}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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 (+ (* a b) (* z t))) (t_2 (+ (* c i) (* z t))))
   (if (<= (* c i) -1.4e+104)
     t_2
     (if (<= (* c i) -6.5)
       t_1
       (if (<= (* c i) -1.55e-70)
         (* x y)
         (if (<= (* c i) 1.7e+64) t_1 t_2))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (a * b) + (z * t);
	double t_2 = (c * i) + (z * t);
	double tmp;
	if ((c * i) <= -1.4e+104) {
		tmp = t_2;
	} else if ((c * i) <= -6.5) {
		tmp = t_1;
	} else if ((c * i) <= -1.55e-70) {
		tmp = x * y;
	} else if ((c * i) <= 1.7e+64) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (a * b) + (z * t)
    t_2 = (c * i) + (z * t)
    if ((c * i) <= (-1.4d+104)) then
        tmp = t_2
    else if ((c * i) <= (-6.5d0)) then
        tmp = t_1
    else if ((c * i) <= (-1.55d-70)) then
        tmp = x * y
    else if ((c * i) <= 1.7d+64) then
        tmp = t_1
    else
        tmp = t_2
    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 t_1 = (a * b) + (z * t);
	double t_2 = (c * i) + (z * t);
	double tmp;
	if ((c * i) <= -1.4e+104) {
		tmp = t_2;
	} else if ((c * i) <= -6.5) {
		tmp = t_1;
	} else if ((c * i) <= -1.55e-70) {
		tmp = x * y;
	} else if ((c * i) <= 1.7e+64) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = (a * b) + (z * t)
	t_2 = (c * i) + (z * t)
	tmp = 0
	if (c * i) <= -1.4e+104:
		tmp = t_2
	elif (c * i) <= -6.5:
		tmp = t_1
	elif (c * i) <= -1.55e-70:
		tmp = x * y
	elif (c * i) <= 1.7e+64:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(a * b) + Float64(z * t))
	t_2 = Float64(Float64(c * i) + Float64(z * t))
	tmp = 0.0
	if (Float64(c * i) <= -1.4e+104)
		tmp = t_2;
	elseif (Float64(c * i) <= -6.5)
		tmp = t_1;
	elseif (Float64(c * i) <= -1.55e-70)
		tmp = Float64(x * y);
	elseif (Float64(c * i) <= 1.7e+64)
		tmp = t_1;
	else
		tmp = t_2;
	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)
	t_1 = (a * b) + (z * t);
	t_2 = (c * i) + (z * t);
	tmp = 0.0;
	if ((c * i) <= -1.4e+104)
		tmp = t_2;
	elseif ((c * i) <= -6.5)
		tmp = t_1;
	elseif ((c * i) <= -1.55e-70)
		tmp = x * y;
	elseif ((c * i) <= 1.7e+64)
		tmp = t_1;
	else
		tmp = t_2;
	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_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(c * i), $MachinePrecision], -1.4e+104], t$95$2, If[LessEqual[N[(c * i), $MachinePrecision], -6.5], t$95$1, If[LessEqual[N[(c * i), $MachinePrecision], -1.55e-70], N[(x * y), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 1.7e+64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a \cdot b + z \cdot t\\
t_2 := c \cdot i + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+104}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \cdot i \leq -6.5:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-70}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;c \cdot i \leq 1.7 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 c i) < -1.4e104 or 1.7000000000000001e64 < (*.f64 c i)

    1. Initial program 95.4%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in x around 0 84.5%

      \[\leadsto \color{blue}{c \cdot i + t \cdot z} \]

    if -1.4e104 < (*.f64 c i) < -6.5 or -1.55e-70 < (*.f64 c i) < 1.7000000000000001e64

    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 x around 0 70.2%

      \[\leadsto \left(\color{blue}{t \cdot z} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in c around 0 67.7%

      \[\leadsto \color{blue}{a \cdot b + t \cdot z} \]

    if -6.5 < (*.f64 c i) < -1.55e-70

    1. Initial program 90.9%

      \[\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 82.1%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 56.3%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*65.3%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*65.1%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified65.1%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
    7. Taylor expanded in x around inf 74.0%

      \[\leadsto \color{blue}{x \cdot y} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification75.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.4 \cdot 10^{+104}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -6.5:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{elif}\;c \cdot i \leq -1.55 \cdot 10^{-70}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;c \cdot i \leq 1.7 \cdot 10^{+64}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 62.5% 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 := a \cdot b + c \cdot i\\ \mathbf{if}\;x \cdot y \leq -2.35 \cdot 10^{+244}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-16}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-36}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{+197}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \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 (+ (* a b) (* c i))))
   (if (<= (* x y) -2.35e+244)
     (* x y)
     (if (<= (* x y) -1.7e-16)
       t_1
       (if (<= (* x y) -2.6e-36)
         (* z t)
         (if (<= (* x y) 4.8e+197) t_1 (* x y)))))))
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 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -2.35e+244) {
		tmp = x * y;
	} else if ((x * y) <= -1.7e-16) {
		tmp = t_1;
	} else if ((x * y) <= -2.6e-36) {
		tmp = z * t;
	} else if ((x * y) <= 4.8e+197) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = (a * b) + (c * i)
    if ((x * y) <= (-2.35d+244)) then
        tmp = x * y
    else if ((x * y) <= (-1.7d-16)) then
        tmp = t_1
    else if ((x * y) <= (-2.6d-36)) then
        tmp = z * t
    else if ((x * y) <= 4.8d+197) then
        tmp = t_1
    else
        tmp = x * y
    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 t_1 = (a * b) + (c * i);
	double tmp;
	if ((x * y) <= -2.35e+244) {
		tmp = x * y;
	} else if ((x * y) <= -1.7e-16) {
		tmp = t_1;
	} else if ((x * y) <= -2.6e-36) {
		tmp = z * t;
	} else if ((x * y) <= 4.8e+197) {
		tmp = t_1;
	} else {
		tmp = x * y;
	}
	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):
	t_1 = (a * b) + (c * i)
	tmp = 0
	if (x * y) <= -2.35e+244:
		tmp = x * y
	elif (x * y) <= -1.7e-16:
		tmp = t_1
	elif (x * y) <= -2.6e-36:
		tmp = z * t
	elif (x * y) <= 4.8e+197:
		tmp = t_1
	else:
		tmp = x * y
	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(a * b) + Float64(c * i))
	tmp = 0.0
	if (Float64(x * y) <= -2.35e+244)
		tmp = Float64(x * y);
	elseif (Float64(x * y) <= -1.7e-16)
		tmp = t_1;
	elseif (Float64(x * y) <= -2.6e-36)
		tmp = Float64(z * t);
	elseif (Float64(x * y) <= 4.8e+197)
		tmp = t_1;
	else
		tmp = Float64(x * y);
	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)
	t_1 = (a * b) + (c * i);
	tmp = 0.0;
	if ((x * y) <= -2.35e+244)
		tmp = x * y;
	elseif ((x * y) <= -1.7e-16)
		tmp = t_1;
	elseif ((x * y) <= -2.6e-36)
		tmp = z * t;
	elseif ((x * y) <= 4.8e+197)
		tmp = t_1;
	else
		tmp = x * y;
	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_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.35e+244], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1.7e-16], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.6e-36], N[(z * t), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4.8e+197], t$95$1, N[(x * y), $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 := a \cdot b + c \cdot i\\
\mathbf{if}\;x \cdot y \leq -2.35 \cdot 10^{+244}:\\
\;\;\;\;x \cdot y\\

\mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-36}:\\
\;\;\;\;z \cdot t\\

\mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot y\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.35000000000000006e244 or 4.7999999999999998e197 < (*.f64 x y)

    1. Initial program 90.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 81.8%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 63.4%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*65.3%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*65.3%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified65.3%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
    7. Taylor expanded in x around inf 73.0%

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

    if -2.35000000000000006e244 < (*.f64 x y) < -1.7e-16 or -2.6e-36 < (*.f64 x y) < 4.7999999999999998e197

    1. Initial program 97.9%

      \[\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 87.7%

      \[\leadsto \left(\color{blue}{t \cdot z} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in t around 0 65.7%

      \[\leadsto \color{blue}{a \cdot b + c \cdot i} \]

    if -1.7e-16 < (*.f64 x y) < -2.6e-36

    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 0 89.4%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 78.3%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*78.3%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*78.1%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified78.1%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]
    7. Taylor expanded in t around inf 78.5%

      \[\leadsto \color{blue}{t \cdot z} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification67.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.35 \cdot 10^{+244}:\\ \;\;\;\;x \cdot y\\ \mathbf{elif}\;x \cdot y \leq -1.7 \cdot 10^{-16}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-36}:\\ \;\;\;\;z \cdot t\\ \mathbf{elif}\;x \cdot y \leq 4.8 \cdot 10^{+197}:\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;x \cdot y\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 88.1% accurate, 0.5× 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^{+274}:\\ \;\;\;\;a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 10^{-47}\right):\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\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 (<= (* a b) -1e+274)
   (* a (+ b (+ (* t (/ z a)) (* x (/ y a)))))
   (if (or (<= (* a b) -5e+84) (not (<= (* a b) 1e-47)))
     (+ (* c i) (+ (* a b) (* z t)))
     (+ (* c i) (+ (* x y) (* z t))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((a * b) <= -1e+274) {
		tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
	} else if (((a * b) <= -5e+84) || !((a * b) <= 1e-47)) {
		tmp = (c * i) + ((a * b) + (z * t));
	} else {
		tmp = (c * i) + ((x * y) + (z * t));
	}
	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+274)) then
        tmp = a * (b + ((t * (z / a)) + (x * (y / a))))
    else if (((a * b) <= (-5d+84)) .or. (.not. ((a * b) <= 1d-47))) then
        tmp = (c * i) + ((a * b) + (z * t))
    else
        tmp = (c * i) + ((x * y) + (z * t))
    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+274) {
		tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
	} else if (((a * b) <= -5e+84) || !((a * b) <= 1e-47)) {
		tmp = (c * i) + ((a * b) + (z * t));
	} else {
		tmp = (c * i) + ((x * y) + (z * t));
	}
	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+274:
		tmp = a * (b + ((t * (z / a)) + (x * (y / a))))
	elif ((a * b) <= -5e+84) or not ((a * b) <= 1e-47):
		tmp = (c * i) + ((a * b) + (z * t))
	else:
		tmp = (c * i) + ((x * y) + (z * t))
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(a * b) <= -1e+274)
		tmp = Float64(a * Float64(b + Float64(Float64(t * Float64(z / a)) + Float64(x * Float64(y / a)))));
	elseif ((Float64(a * b) <= -5e+84) || !(Float64(a * b) <= 1e-47))
		tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t)));
	else
		tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t)));
	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+274)
		tmp = a * (b + ((t * (z / a)) + (x * (y / a))));
	elseif (((a * b) <= -5e+84) || ~(((a * b) <= 1e-47)))
		tmp = (c * i) + ((a * b) + (z * t));
	else
		tmp = (c * i) + ((x * y) + (z * t));
	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+274], N[(a * N[(b + N[(N[(t * N[(z / a), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+84], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e-47]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $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}\;a \cdot b \leq -1 \cdot 10^{+274}:\\
\;\;\;\;a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)\\

\mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 10^{-47}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 a b) < -9.99999999999999921e273

    1. Initial program 77.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 83.3%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in a around inf 88.9%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(\frac{t \cdot z}{a} + \frac{x \cdot y}{a}\right)\right)} \]
    5. Step-by-step derivation
      1. associate-/l*100.0%

        \[\leadsto a \cdot \left(b + \left(\color{blue}{t \cdot \frac{z}{a}} + \frac{x \cdot y}{a}\right)\right) \]
      2. associate-/l*100.0%

        \[\leadsto a \cdot \left(b + \left(t \cdot \frac{z}{a} + \color{blue}{x \cdot \frac{y}{a}}\right)\right) \]
    6. Simplified100.0%

      \[\leadsto \color{blue}{a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)} \]

    if -9.99999999999999921e273 < (*.f64 a b) < -5.0000000000000001e84 or 9.9999999999999997e-48 < (*.f64 a b)

    1. Initial program 98.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 92.7%

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

    if -5.0000000000000001e84 < (*.f64 a b) < 9.9999999999999997e-48

    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 a around 0 95.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -1 \cdot 10^{+274}:\\ \;\;\;\;a \cdot \left(b + \left(t \cdot \frac{z}{a} + x \cdot \frac{y}{a}\right)\right)\\ \mathbf{elif}\;a \cdot b \leq -5 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 10^{-47}\right):\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 87.2% 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}\;a \cdot b \leq -5 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 10^{-47}\right):\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\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 (or (<= (* a b) -5e+84) (not (<= (* a b) 1e-47)))
   (+ (* c i) (+ (* a b) (* z t)))
   (+ (* c i) (+ (* x y) (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((a * b) <= -5e+84) || !((a * b) <= 1e-47)) {
		tmp = (c * i) + ((a * b) + (z * t));
	} else {
		tmp = (c * i) + ((x * y) + (z * t));
	}
	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) <= (-5d+84)) .or. (.not. ((a * b) <= 1d-47))) then
        tmp = (c * i) + ((a * b) + (z * t))
    else
        tmp = (c * i) + ((x * y) + (z * t))
    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) <= -5e+84) || !((a * b) <= 1e-47)) {
		tmp = (c * i) + ((a * b) + (z * t));
	} else {
		tmp = (c * i) + ((x * y) + (z * t));
	}
	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) <= -5e+84) or not ((a * b) <= 1e-47):
		tmp = (c * i) + ((a * b) + (z * t))
	else:
		tmp = (c * i) + ((x * y) + (z * t))
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(a * b) <= -5e+84) || !(Float64(a * b) <= 1e-47))
		tmp = Float64(Float64(c * i) + Float64(Float64(a * b) + Float64(z * t)));
	else
		tmp = Float64(Float64(c * i) + Float64(Float64(x * y) + Float64(z * t)));
	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) <= -5e+84) || ~(((a * b) <= 1e-47)))
		tmp = (c * i) + ((a * b) + (z * t));
	else
		tmp = (c * i) + ((x * y) + (z * t));
	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[Or[LessEqual[N[(a * b), $MachinePrecision], -5e+84], N[Not[LessEqual[N[(a * b), $MachinePrecision], 1e-47]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * i), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $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}\;a \cdot b \leq -5 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 10^{-47}\right):\\
\;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 a b) < -5.0000000000000001e84 or 9.9999999999999997e-48 < (*.f64 a b)

    1. Initial program 95.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 89.7%

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

    if -5.0000000000000001e84 < (*.f64 a b) < 9.9999999999999997e-48

    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 a around 0 95.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \cdot b \leq -5 \cdot 10^{+84} \lor \neg \left(a \cdot b \leq 10^{-47}\right):\\ \;\;\;\;c \cdot i + \left(a \cdot b + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 88.1% 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 := x \cdot y + z \cdot t\\ \mathbf{if}\;c \cdot i \leq -9 \cdot 10^{+102} \lor \neg \left(c \cdot i \leq 7.6 \cdot 10^{+66}\right):\\ \;\;\;\;c \cdot i + t\_1\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + 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 (+ (* x y) (* z t))))
   (if (or (<= (* c i) -9e+102) (not (<= (* c i) 7.6e+66)))
     (+ (* c i) t_1)
     (+ (* 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 = (x * y) + (z * t);
	double tmp;
	if (((c * i) <= -9e+102) || !((c * i) <= 7.6e+66)) {
		tmp = (c * i) + t_1;
	} else {
		tmp = (a * b) + t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = (x * y) + (z * t)
    if (((c * i) <= (-9d+102)) .or. (.not. ((c * i) <= 7.6d+66))) then
        tmp = (c * i) + t_1
    else
        tmp = (a * b) + t_1
    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 t_1 = (x * y) + (z * t);
	double tmp;
	if (((c * i) <= -9e+102) || !((c * i) <= 7.6e+66)) {
		tmp = (c * i) + t_1;
	} else {
		tmp = (a * b) + t_1;
	}
	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):
	t_1 = (x * y) + (z * t)
	tmp = 0
	if ((c * i) <= -9e+102) or not ((c * i) <= 7.6e+66):
		tmp = (c * i) + t_1
	else:
		tmp = (a * b) + 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 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if ((Float64(c * i) <= -9e+102) || !(Float64(c * i) <= 7.6e+66))
		tmp = Float64(Float64(c * i) + t_1);
	else
		tmp = Float64(Float64(a * b) + t_1);
	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)
	t_1 = (x * y) + (z * t);
	tmp = 0.0;
	if (((c * i) <= -9e+102) || ~(((c * i) <= 7.6e+66)))
		tmp = (c * i) + t_1;
	else
		tmp = (a * b) + t_1;
	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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[N[(c * i), $MachinePrecision], -9e+102], N[Not[LessEqual[N[(c * i), $MachinePrecision], 7.6e+66]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + t$95$1), $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 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \cdot i \leq -9 \cdot 10^{+102} \lor \neg \left(c \cdot i \leq 7.6 \cdot 10^{+66}\right):\\
\;\;\;\;c \cdot i + t\_1\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -9.00000000000000042e102 or 7.6000000000000004e66 < (*.f64 c i)

    1. Initial program 95.4%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]

    if -9.00000000000000042e102 < (*.f64 c i) < 7.6000000000000004e66

    1. Initial program 97.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 94.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -9 \cdot 10^{+102} \lor \neg \left(c \cdot i \leq 7.6 \cdot 10^{+66}\right):\\ \;\;\;\;c \cdot i + \left(x \cdot y + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 85.2% 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}\;c \cdot i \leq -1.05 \cdot 10^{+106} \lor \neg \left(c \cdot i \leq 4.5 \cdot 10^{+145}\right):\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\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 (or (<= (* c i) -1.05e+106) (not (<= (* c i) 4.5e+145)))
   (+ (* c i) (* z t))
   (+ (* a b) (+ (* x y) (* z t)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -1.05e+106) || !((c * i) <= 4.5e+145)) {
		tmp = (c * i) + (z * t);
	} else {
		tmp = (a * b) + ((x * y) + (z * t));
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((c * i) <= (-1.05d+106)) .or. (.not. ((c * i) <= 4.5d+145))) then
        tmp = (c * i) + (z * t)
    else
        tmp = (a * b) + ((x * y) + (z * t))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -1.05e+106) || !((c * i) <= 4.5e+145)) {
		tmp = (c * i) + (z * t);
	} else {
		tmp = (a * b) + ((x * y) + (z * t));
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((c * i) <= -1.05e+106) or not ((c * i) <= 4.5e+145):
		tmp = (c * i) + (z * t)
	else:
		tmp = (a * b) + ((x * y) + (z * t))
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(c * i) <= -1.05e+106) || !(Float64(c * i) <= 4.5e+145))
		tmp = Float64(Float64(c * i) + Float64(z * t));
	else
		tmp = Float64(Float64(a * b) + Float64(Float64(x * y) + Float64(z * t)));
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((c * i) <= -1.05e+106) || ~(((c * i) <= 4.5e+145)))
		tmp = (c * i) + (z * t);
	else
		tmp = (a * b) + ((x * y) + (z * t));
	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[Or[LessEqual[N[(c * i), $MachinePrecision], -1.05e+106], N[Not[LessEqual[N[(c * i), $MachinePrecision], 4.5e+145]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(N[(x * y), $MachinePrecision] + N[(z * t), $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}\;c \cdot i \leq -1.05 \cdot 10^{+106} \lor \neg \left(c \cdot i \leq 4.5 \cdot 10^{+145}\right):\\
\;\;\;\;c \cdot i + z \cdot t\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -1.05000000000000002e106 or 4.4999999999999998e145 < (*.f64 c i)

    1. Initial program 94.3%

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

      \[\leadsto \color{blue}{c \cdot i + \left(t \cdot z + x \cdot y\right)} \]
    4. Taylor expanded in x around 0 88.8%

      \[\leadsto \color{blue}{c \cdot i + t \cdot z} \]

    if -1.05000000000000002e106 < (*.f64 c i) < 4.4999999999999998e145

    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 c around 0 90.8%

      \[\leadsto \color{blue}{a \cdot b + \left(t \cdot z + x \cdot y\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -1.05 \cdot 10^{+106} \lor \neg \left(c \cdot i \leq 4.5 \cdot 10^{+145}\right):\\ \;\;\;\;c \cdot i + z \cdot t\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + \left(x \cdot y + z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 65.7% 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}\;c \cdot i \leq -7 \cdot 10^{+101} \lor \neg \left(c \cdot i \leq 2.8 \cdot 10^{+155}\right):\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \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 (or (<= (* c i) -7e+101) (not (<= (* c i) 2.8e+155)))
   (+ (* a b) (* c i))
   (+ (* a b) (* z t))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -7e+101) || !((c * i) <= 2.8e+155)) {
		tmp = (a * b) + (c * i);
	} else {
		tmp = (a * b) + (z * t);
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((c * i) <= (-7d+101)) .or. (.not. ((c * i) <= 2.8d+155))) then
        tmp = (a * b) + (c * i)
    else
        tmp = (a * b) + (z * t)
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -7e+101) || !((c * i) <= 2.8e+155)) {
		tmp = (a * b) + (c * i);
	} else {
		tmp = (a * b) + (z * t);
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((c * i) <= -7e+101) or not ((c * i) <= 2.8e+155):
		tmp = (a * b) + (c * i)
	else:
		tmp = (a * b) + (z * t)
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(c * i) <= -7e+101) || !(Float64(c * i) <= 2.8e+155))
		tmp = Float64(Float64(a * b) + Float64(c * i));
	else
		tmp = Float64(Float64(a * b) + Float64(z * t));
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((c * i) <= -7e+101) || ~(((c * i) <= 2.8e+155)))
		tmp = (a * b) + (c * i);
	else
		tmp = (a * b) + (z * t);
	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[Or[LessEqual[N[(c * i), $MachinePrecision], -7e+101], N[Not[LessEqual[N[(c * i), $MachinePrecision], 2.8e+155]], $MachinePrecision]], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -7 \cdot 10^{+101} \lor \neg \left(c \cdot i \leq 2.8 \cdot 10^{+155}\right):\\
\;\;\;\;a \cdot b + c \cdot i\\

\mathbf{else}:\\
\;\;\;\;a \cdot b + z \cdot t\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -7.00000000000000046e101 or 2.80000000000000016e155 < (*.f64 c i)

    1. Initial program 94.3%

      \[\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 89.9%

      \[\leadsto \left(\color{blue}{t \cdot z} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in t around 0 80.0%

      \[\leadsto \color{blue}{a \cdot b + c \cdot i} \]

    if -7.00000000000000046e101 < (*.f64 c i) < 2.80000000000000016e155

    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 69.8%

      \[\leadsto \left(\color{blue}{t \cdot z} + a \cdot b\right) + c \cdot i \]
    4. Taylor expanded in c around 0 63.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -7 \cdot 10^{+101} \lor \neg \left(c \cdot i \leq 2.8 \cdot 10^{+155}\right):\\ \;\;\;\;a \cdot b + c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b + z \cdot t\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 43.4% 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}\;c \cdot i \leq -3.1 \cdot 10^{+105} \lor \neg \left(c \cdot i \leq 1.22 \cdot 10^{+64}\right):\\ \;\;\;\;c \cdot i\\ \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 (or (<= (* c i) -3.1e+105) (not (<= (* c i) 1.22e+64))) (* c i) (* a b)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -3.1e+105) || !((c * i) <= 1.22e+64)) {
		tmp = c * i;
	} else {
		tmp = a * b;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((c * i) <= (-3.1d+105)) .or. (.not. ((c * i) <= 1.22d+64))) then
        tmp = c * i
    else
        tmp = a * b
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((c * i) <= -3.1e+105) || !((c * i) <= 1.22e+64)) {
		tmp = c * i;
	} else {
		tmp = a * b;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((c * i) <= -3.1e+105) or not ((c * i) <= 1.22e+64):
		tmp = c * i
	else:
		tmp = a * b
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(c * i) <= -3.1e+105) || !(Float64(c * i) <= 1.22e+64))
		tmp = Float64(c * i);
	else
		tmp = Float64(a * b);
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((c * i) <= -3.1e+105) || ~(((c * i) <= 1.22e+64)))
		tmp = c * i;
	else
		tmp = a * b;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(c * i), $MachinePrecision], -3.1e+105], N[Not[LessEqual[N[(c * i), $MachinePrecision], 1.22e+64]], $MachinePrecision]], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -3.1 \cdot 10^{+105} \lor \neg \left(c \cdot i \leq 1.22 \cdot 10^{+64}\right):\\
\;\;\;\;c \cdot i\\

\mathbf{else}:\\
\;\;\;\;a \cdot b\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 c i) < -3.10000000000000004e105 or 1.21999999999999994e64 < (*.f64 c i)

    1. Initial program 95.4%

      \[\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 67.7%

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

    if -3.10000000000000004e105 < (*.f64 c i) < 1.21999999999999994e64

    1. Initial program 97.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot i \leq -3.1 \cdot 10^{+105} \lor \neg \left(c \cdot i \leq 1.22 \cdot 10^{+64}\right):\\ \;\;\;\;c \cdot i\\ \mathbf{else}:\\ \;\;\;\;a \cdot b\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 27.4% 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 96.5%

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

    \[\leadsto \color{blue}{a \cdot b} \]
  4. Add Preprocessing

Reproduce

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