Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A

Percentage Accurate: 90.7% → 94.4%
Time: 14.6s
Alternatives: 14
Speedup: 0.5×

Specification

?
\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i)))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\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 14 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: 90.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 = 2.0d0 * (((x * y) + (z * t)) - (((a + (b * c)) * 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 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i))
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(Float64(a + Float64(b * c)) * c) * i)))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (((x * y) + (z * t)) - (((a + (b * c)) * c) * i));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right)
\end{array}

Alternative 1: 94.4% 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 + c \cdot b\\ \mathbf{if}\;z \leq -6.6 \cdot 10^{+146}:\\ \;\;\;\;2 \cdot \left(z \cdot \left(\left(t + \frac{x \cdot y}{z}\right) - \frac{c \cdot \left(i \cdot t\_1\right)}{z}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - t\_1 \cdot \left(c \cdot i\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 (+ a (* c b))))
   (if (<= z -6.6e+146)
     (* 2.0 (* z (- (+ t (/ (* x y) z)) (/ (* c (* i t_1)) z))))
     (* 2.0 (- (fma x y (* z t)) (* t_1 (* 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 + (c * b);
	double tmp;
	if (z <= -6.6e+146) {
		tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / z)));
	} else {
		tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (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(c * b))
	tmp = 0.0
	if (z <= -6.6e+146)
		tmp = Float64(2.0 * Float64(z * Float64(Float64(t + Float64(Float64(x * y) / z)) - Float64(Float64(c * Float64(i * t_1)) / z))));
	else
		tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i))));
	end
	return tmp
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -6.6e+146], N[(2.0 * N[(z * N[(N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := a + c \cdot b\\
\mathbf{if}\;z \leq -6.6 \cdot 10^{+146}:\\
\;\;\;\;2 \cdot \left(z \cdot \left(\left(t + \frac{x \cdot y}{z}\right) - \frac{c \cdot \left(i \cdot t\_1\right)}{z}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -6.60000000000000032e146

    1. Initial program 90.6%

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

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

    if -6.60000000000000032e146 < z

    1. Initial program 90.8%

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

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

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

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

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

Alternative 2: 95.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 + c \cdot b\\ t_2 := x \cdot y + z \cdot t\\ \mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\ \;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot \left(\left(t + \frac{x \cdot y}{z}\right) - \frac{c \cdot \left(i \cdot t\_1\right)}{z}\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 (+ a (* c b))) (t_2 (+ (* x y) (* z t))))
   (if (<= (- t_2 (* i (* c t_1))) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 2.0 (* z (- (+ t (/ (* x y) z)) (/ (* c (* i t_1)) z)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (c * b);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / z)));
	}
	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 = a + (c * b);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / z)));
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (c * b)
	t_2 = (x * y) + (z * t)
	tmp = 0
	if (t_2 - (i * (c * t_1))) <= math.inf:
		tmp = 2.0 * (t_2 - (t_1 * (c * i)))
	else:
		tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / z)))
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(c * b))
	t_2 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(z * Float64(Float64(t + Float64(Float64(x * y) / z)) - Float64(Float64(c * Float64(i * t_1)) / z))));
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (c * b);
	t_2 = (x * y) + (z * t);
	tmp = 0.0;
	if ((t_2 - (i * (c * t_1))) <= Inf)
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	else
		tmp = 2.0 * (z * ((t + ((x * y) / z)) - ((c * (i * t_1)) / z)));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * N[(N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] - N[(N[(c * N[(i * t$95$1), $MachinePrecision]), $MachinePrecision] / z), $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 := a + c \cdot b\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\

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


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

    1. Initial program 96.4%

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define98.8%

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

        \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    6. Applied egg-rr98.8%

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

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

    1. Initial program 0.0%

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

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

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

Alternative 3: 95.8% 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} t_1 := a + c \cdot b\\ t_2 := x \cdot y + z \cdot t\\ \mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\ \;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot \left(t + \frac{x \cdot y}{z}\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 (+ a (* c b))) (t_2 (+ (* x y) (* z t))))
   (if (<= (- t_2 (* i (* c t_1))) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 2.0 (* z (+ t (/ (* x y) z)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (c * b);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (z * (t + ((x * y) / z)));
	}
	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 = a + (c * b);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (z * (t + ((x * y) / z)));
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (c * b)
	t_2 = (x * y) + (z * t)
	tmp = 0
	if (t_2 - (i * (c * t_1))) <= math.inf:
		tmp = 2.0 * (t_2 - (t_1 * (c * i)))
	else:
		tmp = 2.0 * (z * (t + ((x * y) / z)))
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(c * b))
	t_2 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(t_2 - Float64(i * Float64(c * t_1))) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(z * Float64(t + Float64(Float64(x * y) / z))));
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (c * b);
	t_2 = (x * y) + (z * t);
	tmp = 0.0;
	if ((t_2 - (i * (c * t_1))) <= Inf)
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	else
		tmp = 2.0 * (z * (t + ((x * y) / z)));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $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 := a + c \cdot b\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - i \cdot \left(c \cdot t\_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\

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


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

    1. Initial program 96.4%

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define98.8%

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

        \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\right)} - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \]
    6. Applied egg-rr98.8%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 4: 92.7% 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} t_1 := \left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + c \cdot b\right)\right)\\ \mathbf{if}\;t\_1 \leq \infty:\\ \;\;\;\;2 \cdot t\_1\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot \left(t + \frac{x \cdot y}{z}\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 (- (+ (* x y) (* z t)) (* i (* c (+ a (* c b)))))))
   (if (<= t_1 INFINITY) (* 2.0 t_1) (* 2.0 (* z (+ t (/ (* x y) z)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((x * y) + (z * t)) - (i * (c * (a + (c * b))));
	double tmp;
	if (t_1 <= ((double) INFINITY)) {
		tmp = 2.0 * t_1;
	} else {
		tmp = 2.0 * (z * (t + ((x * y) / z)));
	}
	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 = ((x * y) + (z * t)) - (i * (c * (a + (c * b))));
	double tmp;
	if (t_1 <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * t_1;
	} else {
		tmp = 2.0 * (z * (t + ((x * y) / z)));
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = ((x * y) + (z * t)) - (i * (c * (a + (c * b))))
	tmp = 0
	if t_1 <= math.inf:
		tmp = 2.0 * t_1
	else:
		tmp = 2.0 * (z * (t + ((x * y) / z)))
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * Float64(a + Float64(c * b)))))
	tmp = 0.0
	if (t_1 <= Inf)
		tmp = Float64(2.0 * t_1);
	else
		tmp = Float64(2.0 * Float64(z * Float64(t + Float64(Float64(x * y) / z))));
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = ((x * y) + (z * t)) - (i * (c * (a + (c * b))));
	tmp = 0.0;
	if (t_1 <= Inf)
		tmp = 2.0 * t_1;
	else
		tmp = 2.0 * (z * (t + ((x * y) / z)));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], N[(2.0 * t$95$1), $MachinePrecision], N[(2.0 * N[(z * N[(t + N[(N[(x * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(a + c \cdot b\right)\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;2 \cdot t\_1\\

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


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

    1. Initial program 96.4%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

Alternative 5: 72.9% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\ t_2 := 2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\ \mathbf{if}\;c \leq -4.6 \cdot 10^{+152}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{+108}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{+56}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.05 \cdot 10^{-27}:\\ \;\;\;\;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 (* 2.0 (+ (* x y) (* z t))))
        (t_2 (* 2.0 (* c (* i (- (- (* c b)) a))))))
   (if (<= c -4.6e+152)
     t_2
     (if (<= c -2.1e+108)
       t_1
       (if (<= c -9.5e+56)
         (* 2.0 (- (* z t) (* c (* b (* c i)))))
         (if (<= c 1.05e-27) 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 = 2.0 * ((x * y) + (z * t));
	double t_2 = 2.0 * (c * (i * (-(c * b) - a)));
	double tmp;
	if (c <= -4.6e+152) {
		tmp = t_2;
	} else if (c <= -2.1e+108) {
		tmp = t_1;
	} else if (c <= -9.5e+56) {
		tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
	} else if (c <= 1.05e-27) {
		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 = 2.0d0 * ((x * y) + (z * t))
    t_2 = 2.0d0 * (c * (i * (-(c * b) - a)))
    if (c <= (-4.6d+152)) then
        tmp = t_2
    else if (c <= (-2.1d+108)) then
        tmp = t_1
    else if (c <= (-9.5d+56)) then
        tmp = 2.0d0 * ((z * t) - (c * (b * (c * i))))
    else if (c <= 1.05d-27) 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 = 2.0 * ((x * y) + (z * t));
	double t_2 = 2.0 * (c * (i * (-(c * b) - a)));
	double tmp;
	if (c <= -4.6e+152) {
		tmp = t_2;
	} else if (c <= -2.1e+108) {
		tmp = t_1;
	} else if (c <= -9.5e+56) {
		tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
	} else if (c <= 1.05e-27) {
		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 = 2.0 * ((x * y) + (z * t))
	t_2 = 2.0 * (c * (i * (-(c * b) - a)))
	tmp = 0
	if c <= -4.6e+152:
		tmp = t_2
	elif c <= -2.1e+108:
		tmp = t_1
	elif c <= -9.5e+56:
		tmp = 2.0 * ((z * t) - (c * (b * (c * i))))
	elif c <= 1.05e-27:
		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(2.0 * Float64(Float64(x * y) + Float64(z * t)))
	t_2 = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-Float64(c * b)) - a))))
	tmp = 0.0
	if (c <= -4.6e+152)
		tmp = t_2;
	elseif (c <= -2.1e+108)
		tmp = t_1;
	elseif (c <= -9.5e+56)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i)))));
	elseif (c <= 1.05e-27)
		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 = 2.0 * ((x * y) + (z * t));
	t_2 = 2.0 * (c * (i * (-(c * b) - a)));
	tmp = 0.0;
	if (c <= -4.6e+152)
		tmp = t_2;
	elseif (c <= -2.1e+108)
		tmp = t_1;
	elseif (c <= -9.5e+56)
		tmp = 2.0 * ((z * t) - (c * (b * (c * i))));
	elseif (c <= 1.05e-27)
		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[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(c * N[(i * N[((-N[(c * b), $MachinePrecision]) - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.6e+152], t$95$2, If[LessEqual[c, -2.1e+108], t$95$1, If[LessEqual[c, -9.5e+56], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.05e-27], 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 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\
t_2 := 2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\
\mathbf{if}\;c \leq -4.6 \cdot 10^{+152}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \leq -2.1 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq -9.5 \cdot 10^{+56}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

\mathbf{elif}\;c \leq 1.05 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -4.5999999999999997e152 or 1.05000000000000008e-27 < c

    1. Initial program 79.2%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]

    if -4.5999999999999997e152 < c < -2.1000000000000001e108 or -9.4999999999999997e56 < c < 1.05000000000000008e-27

    1. Initial program 97.9%

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

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

    if -2.1000000000000001e108 < c < -9.4999999999999997e56

    1. Initial program 100.0%

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

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

      \[\leadsto 2 \cdot \left(t \cdot z - c \cdot \color{blue}{\left(b \cdot \left(c \cdot i\right)\right)}\right) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification82.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.6 \cdot 10^{+152}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{+108}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{+56}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.05 \cdot 10^{-27}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 85.3% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := x \cdot y + z \cdot t\\ \mathbf{if}\;c \leq -6.8 \cdot 10^{+160}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\ \mathbf{elif}\;c \leq -5.2 \cdot 10^{-99}:\\ \;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot \left(c \cdot b\right)\right)\right)\\ \mathbf{elif}\;c \leq 9.8 \cdot 10^{-28}:\\ \;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* x y) (* z t))))
   (if (<= c -6.8e+160)
     (* 2.0 (* c (* i (- (- (* c b)) a))))
     (if (<= c -5.2e-99)
       (* 2.0 (- t_1 (* i (* c (* c b)))))
       (if (<= c 9.8e-28)
         (* 2.0 (- t_1 (* i (* c a))))
         (* 2.0 (- (* z t) (* c (* i (+ a (* c 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 t_1 = (x * y) + (z * t);
	double tmp;
	if (c <= -6.8e+160) {
		tmp = 2.0 * (c * (i * (-(c * b) - a)));
	} else if (c <= -5.2e-99) {
		tmp = 2.0 * (t_1 - (i * (c * (c * b))));
	} else if (c <= 9.8e-28) {
		tmp = 2.0 * (t_1 - (i * (c * a)));
	} else {
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * 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) :: t_1
    real(8) :: tmp
    t_1 = (x * y) + (z * t)
    if (c <= (-6.8d+160)) then
        tmp = 2.0d0 * (c * (i * (-(c * b) - a)))
    else if (c <= (-5.2d-99)) then
        tmp = 2.0d0 * (t_1 - (i * (c * (c * b))))
    else if (c <= 9.8d-28) then
        tmp = 2.0d0 * (t_1 - (i * (c * a)))
    else
        tmp = 2.0d0 * ((z * t) - (c * (i * (a + (c * 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 t_1 = (x * y) + (z * t);
	double tmp;
	if (c <= -6.8e+160) {
		tmp = 2.0 * (c * (i * (-(c * b) - a)));
	} else if (c <= -5.2e-99) {
		tmp = 2.0 * (t_1 - (i * (c * (c * b))));
	} else if (c <= 9.8e-28) {
		tmp = 2.0 * (t_1 - (i * (c * a)));
	} else {
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * 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):
	t_1 = (x * y) + (z * t)
	tmp = 0
	if c <= -6.8e+160:
		tmp = 2.0 * (c * (i * (-(c * b) - a)))
	elif c <= -5.2e-99:
		tmp = 2.0 * (t_1 - (i * (c * (c * b))))
	elif c <= 9.8e-28:
		tmp = 2.0 * (t_1 - (i * (c * a)))
	else:
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * 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)
	t_1 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if (c <= -6.8e+160)
		tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-Float64(c * b)) - a))));
	elseif (c <= -5.2e-99)
		tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(c * b)))));
	elseif (c <= 9.8e-28)
		tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * a))));
	else
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(c * 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)
	t_1 = (x * y) + (z * t);
	tmp = 0.0;
	if (c <= -6.8e+160)
		tmp = 2.0 * (c * (i * (-(c * b) - a)));
	elseif (c <= -5.2e-99)
		tmp = 2.0 * (t_1 - (i * (c * (c * b))));
	elseif (c <= 9.8e-28)
		tmp = 2.0 * (t_1 - (i * (c * a)));
	else
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * 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_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.8e+160], N[(2.0 * N[(c * N[(i * N[((-N[(c * b), $MachinePrecision]) - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -5.2e-99], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 9.8e-28], N[(2.0 * N[(t$95$1 - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $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 := x \cdot y + z \cdot t\\
\mathbf{if}\;c \leq -6.8 \cdot 10^{+160}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\

\mathbf{elif}\;c \leq -5.2 \cdot 10^{-99}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot \left(c \cdot b\right)\right)\right)\\

\mathbf{elif}\;c \leq 9.8 \cdot 10^{-28}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(c \cdot a\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -6.80000000000000061e160

    1. Initial program 70.1%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]

    if -6.80000000000000061e160 < c < -5.2000000000000001e-99

    1. Initial program 96.2%

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

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

    if -5.2000000000000001e-99 < c < 9.80000000000000059e-28

    1. Initial program 99.0%

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(a \cdot c\right)} \cdot i\right) \]
    4. Step-by-step derivation
      1. *-commutative96.8%

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot a\right)} \cdot i\right) \]
    5. Simplified96.8%

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

    if 9.80000000000000059e-28 < c

    1. Initial program 82.5%

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification91.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -6.8 \cdot 10^{+160}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\ \mathbf{elif}\;c \leq -5.2 \cdot 10^{-99}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(c \cdot b\right)\right)\right)\\ \mathbf{elif}\;c \leq 9.8 \cdot 10^{-28}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 59.0% 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 \leq -4.6 \cdot 10^{+152}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{-36}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 2.1 \cdot 10^{+247}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(c \cdot 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
 (if (<= c -4.6e+152)
   (* 2.0 (- (* z t) (* c (* i a))))
   (if (<= c 2.8e-36)
     (* 2.0 (+ (* x y) (* z t)))
     (if (<= c 2.1e+247)
       (* 2.0 (- (* x y) (* a (* c i))))
       (* 2.0 (* i (* c 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 tmp;
	if (c <= -4.6e+152) {
		tmp = 2.0 * ((z * t) - (c * (i * a)));
	} else if (c <= 2.8e-36) {
		tmp = 2.0 * ((x * y) + (z * t));
	} else if (c <= 2.1e+247) {
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	} else {
		tmp = 2.0 * (i * (c * a));
	}
	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 <= (-4.6d+152)) then
        tmp = 2.0d0 * ((z * t) - (c * (i * a)))
    else if (c <= 2.8d-36) then
        tmp = 2.0d0 * ((x * y) + (z * t))
    else if (c <= 2.1d+247) then
        tmp = 2.0d0 * ((x * y) - (a * (c * i)))
    else
        tmp = 2.0d0 * (i * (c * a))
    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 <= -4.6e+152) {
		tmp = 2.0 * ((z * t) - (c * (i * a)));
	} else if (c <= 2.8e-36) {
		tmp = 2.0 * ((x * y) + (z * t));
	} else if (c <= 2.1e+247) {
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	} else {
		tmp = 2.0 * (i * (c * 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):
	tmp = 0
	if c <= -4.6e+152:
		tmp = 2.0 * ((z * t) - (c * (i * a)))
	elif c <= 2.8e-36:
		tmp = 2.0 * ((x * y) + (z * t))
	elif c <= 2.1e+247:
		tmp = 2.0 * ((x * y) - (a * (c * i)))
	else:
		tmp = 2.0 * (i * (c * 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)
	tmp = 0.0
	if (c <= -4.6e+152)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * a))));
	elseif (c <= 2.8e-36)
		tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t)));
	elseif (c <= 2.1e+247)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(i * Float64(c * 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)
	tmp = 0.0;
	if (c <= -4.6e+152)
		tmp = 2.0 * ((z * t) - (c * (i * a)));
	elseif (c <= 2.8e-36)
		tmp = 2.0 * ((x * y) + (z * t));
	elseif (c <= 2.1e+247)
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	else
		tmp = 2.0 * (i * (c * 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_] := If[LessEqual[c, -4.6e+152], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.8e-36], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.1e+247], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(i * N[(c * a), $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 \leq -4.6 \cdot 10^{+152}:\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\

\mathbf{elif}\;c \leq 2.8 \cdot 10^{-36}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\

\mathbf{elif}\;c \leq 2.1 \cdot 10^{+247}:\\
\;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -4.5999999999999997e152

    1. Initial program 72.0%

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

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

      \[\leadsto 2 \cdot \left(t \cdot z - c \cdot \color{blue}{\left(a \cdot i\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative56.0%

        \[\leadsto 2 \cdot \left(t \cdot z - c \cdot \color{blue}{\left(i \cdot a\right)}\right) \]
    6. Simplified56.0%

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

    if -4.5999999999999997e152 < c < 2.8000000000000001e-36

    1. Initial program 98.0%

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

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

    if 2.8000000000000001e-36 < c < 2.1e247

    1. Initial program 80.2%

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

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

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

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

        \[\leadsto 2 \cdot \left(z \cdot \left(\left(t + \frac{x \cdot y}{z}\right) - a \cdot \color{blue}{\left(c \cdot \frac{i}{z}\right)}\right)\right) \]
    6. Simplified64.3%

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

      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y - a \cdot \left(c \cdot i\right)\right)} \]

    if 2.1e247 < c

    1. Initial program 99.9%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg10.4%

        \[\leadsto 2 \cdot \color{blue}{\left(-a \cdot \left(c \cdot i\right)\right)} \]
      2. *-commutative10.4%

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      3. associate-*l*10.3%

        \[\leadsto 2 \cdot \left(-\color{blue}{c \cdot \left(i \cdot a\right)}\right) \]
      4. *-commutative10.3%

        \[\leadsto 2 \cdot \left(-c \cdot \color{blue}{\left(a \cdot i\right)}\right) \]
      5. distribute-rgt-neg-in10.3%

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(-a \cdot i\right)\right)} \]
      6. *-commutative10.3%

        \[\leadsto 2 \cdot \left(c \cdot \left(-\color{blue}{i \cdot a}\right)\right) \]
      7. distribute-rgt-neg-in10.3%

        \[\leadsto 2 \cdot \left(c \cdot \color{blue}{\left(i \cdot \left(-a\right)\right)}\right) \]
    5. Simplified10.3%

      \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)} \]
    6. Step-by-step derivation
      1. pow110.3%

        \[\leadsto 2 \cdot \color{blue}{{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)}^{1}} \]
      2. *-commutative10.3%

        \[\leadsto 2 \cdot {\left(c \cdot \color{blue}{\left(\left(-a\right) \cdot i\right)}\right)}^{1} \]
      3. add-sqr-sqrt0.1%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot i\right)\right)}^{1} \]
      4. sqrt-unprod27.8%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} \cdot i\right)\right)}^{1} \]
      5. sqr-neg27.8%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\sqrt{\color{blue}{a \cdot a}} \cdot i\right)\right)}^{1} \]
      6. sqrt-unprod10.4%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot i\right)\right)}^{1} \]
      7. add-sqr-sqrt37.9%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{a} \cdot i\right)\right)}^{1} \]
    7. Applied egg-rr37.9%

      \[\leadsto 2 \cdot \color{blue}{{\left(c \cdot \left(a \cdot i\right)\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow137.9%

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(a \cdot i\right)\right)} \]
      2. associate-*r*54.8%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot i\right)} \]
    9. Simplified54.8%

      \[\leadsto 2 \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot i\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification71.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.6 \cdot 10^{+152}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{-36}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 2.1 \cdot 10^{+247}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 57.6% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\ \mathbf{if}\;c \leq -5.5 \cdot 10^{+152}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 2.7 \cdot 10^{-21}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.02 \cdot 10^{+242}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(c \cdot 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 (* 2.0 (- (* z t) (* c (* i a))))))
   (if (<= c -5.5e+152)
     t_1
     (if (<= c 2.7e-21)
       (* 2.0 (+ (* x y) (* z t)))
       (if (<= c 1.02e+242) t_1 (* 2.0 (* i (* c 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 = 2.0 * ((z * t) - (c * (i * a)));
	double tmp;
	if (c <= -5.5e+152) {
		tmp = t_1;
	} else if (c <= 2.7e-21) {
		tmp = 2.0 * ((x * y) + (z * t));
	} else if (c <= 1.02e+242) {
		tmp = t_1;
	} else {
		tmp = 2.0 * (i * (c * a));
	}
	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 = 2.0d0 * ((z * t) - (c * (i * a)))
    if (c <= (-5.5d+152)) then
        tmp = t_1
    else if (c <= 2.7d-21) then
        tmp = 2.0d0 * ((x * y) + (z * t))
    else if (c <= 1.02d+242) then
        tmp = t_1
    else
        tmp = 2.0d0 * (i * (c * a))
    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 = 2.0 * ((z * t) - (c * (i * a)));
	double tmp;
	if (c <= -5.5e+152) {
		tmp = t_1;
	} else if (c <= 2.7e-21) {
		tmp = 2.0 * ((x * y) + (z * t));
	} else if (c <= 1.02e+242) {
		tmp = t_1;
	} else {
		tmp = 2.0 * (i * (c * 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 = 2.0 * ((z * t) - (c * (i * a)))
	tmp = 0
	if c <= -5.5e+152:
		tmp = t_1
	elif c <= 2.7e-21:
		tmp = 2.0 * ((x * y) + (z * t))
	elif c <= 1.02e+242:
		tmp = t_1
	else:
		tmp = 2.0 * (i * (c * 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(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * a))))
	tmp = 0.0
	if (c <= -5.5e+152)
		tmp = t_1;
	elseif (c <= 2.7e-21)
		tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t)));
	elseif (c <= 1.02e+242)
		tmp = t_1;
	else
		tmp = Float64(2.0 * Float64(i * Float64(c * 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 = 2.0 * ((z * t) - (c * (i * a)));
	tmp = 0.0;
	if (c <= -5.5e+152)
		tmp = t_1;
	elseif (c <= 2.7e-21)
		tmp = 2.0 * ((x * y) + (z * t));
	elseif (c <= 1.02e+242)
		tmp = t_1;
	else
		tmp = 2.0 * (i * (c * 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[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.5e+152], t$95$1, If[LessEqual[c, 2.7e-21], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.02e+242], t$95$1, N[(2.0 * N[(i * N[(c * a), $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 := 2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\
\mathbf{if}\;c \leq -5.5 \cdot 10^{+152}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq 2.7 \cdot 10^{-21}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\

\mathbf{elif}\;c \leq 1.02 \cdot 10^{+242}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -5.4999999999999999e152 or 2.7000000000000001e-21 < c < 1.02e242

    1. Initial program 77.0%

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

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

      \[\leadsto 2 \cdot \left(t \cdot z - c \cdot \color{blue}{\left(a \cdot i\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative57.1%

        \[\leadsto 2 \cdot \left(t \cdot z - c \cdot \color{blue}{\left(i \cdot a\right)}\right) \]
    6. Simplified57.1%

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

    if -5.4999999999999999e152 < c < 2.7000000000000001e-21

    1. Initial program 98.0%

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

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

    if 1.02e242 < c

    1. Initial program 91.5%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg17.9%

        \[\leadsto 2 \cdot \color{blue}{\left(-a \cdot \left(c \cdot i\right)\right)} \]
      2. *-commutative17.9%

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      3. associate-*l*17.7%

        \[\leadsto 2 \cdot \left(-\color{blue}{c \cdot \left(i \cdot a\right)}\right) \]
      4. *-commutative17.7%

        \[\leadsto 2 \cdot \left(-c \cdot \color{blue}{\left(a \cdot i\right)}\right) \]
      5. distribute-rgt-neg-in17.7%

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(-a \cdot i\right)\right)} \]
      6. *-commutative17.7%

        \[\leadsto 2 \cdot \left(c \cdot \left(-\color{blue}{i \cdot a}\right)\right) \]
      7. distribute-rgt-neg-in17.7%

        \[\leadsto 2 \cdot \left(c \cdot \color{blue}{\left(i \cdot \left(-a\right)\right)}\right) \]
    5. Simplified17.7%

      \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)} \]
    6. Step-by-step derivation
      1. pow117.7%

        \[\leadsto 2 \cdot \color{blue}{{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)}^{1}} \]
      2. *-commutative17.7%

        \[\leadsto 2 \cdot {\left(c \cdot \color{blue}{\left(\left(-a\right) \cdot i\right)}\right)}^{1} \]
      3. add-sqr-sqrt8.5%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot i\right)\right)}^{1} \]
      4. sqrt-unprod33.8%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} \cdot i\right)\right)}^{1} \]
      5. sqr-neg33.8%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\sqrt{\color{blue}{a \cdot a}} \cdot i\right)\right)}^{1} \]
      6. sqrt-unprod9.6%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot i\right)\right)}^{1} \]
      7. add-sqr-sqrt34.7%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{a} \cdot i\right)\right)}^{1} \]
    7. Applied egg-rr34.7%

      \[\leadsto 2 \cdot \color{blue}{{\left(c \cdot \left(a \cdot i\right)\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow134.7%

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(a \cdot i\right)\right)} \]
      2. associate-*r*50.2%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot i\right)} \]
    9. Simplified50.2%

      \[\leadsto 2 \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot i\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification70.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.5 \cdot 10^{+152}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\ \mathbf{elif}\;c \leq 2.7 \cdot 10^{-21}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.02 \cdot 10^{+242}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 86.0% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;c \leq -1.45 \cdot 10^{-40} \lor \neg \left(c \leq 4.5 \cdot 10^{-27}\right):\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot 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
 (if (or (<= c -1.45e-40) (not (<= c 4.5e-27)))
   (* 2.0 (- (* z t) (* c (* i (+ a (* c b))))))
   (* 2.0 (- (+ (* x y) (* z t)) (* i (* c 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 tmp;
	if ((c <= -1.45e-40) || !(c <= 4.5e-27)) {
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
	} else {
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * a)));
	}
	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 <= (-1.45d-40)) .or. (.not. (c <= 4.5d-27))) then
        tmp = 2.0d0 * ((z * t) - (c * (i * (a + (c * b)))))
    else
        tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (c * a)))
    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 <= -1.45e-40) || !(c <= 4.5e-27)) {
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
	} else {
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * 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):
	tmp = 0
	if (c <= -1.45e-40) or not (c <= 4.5e-27):
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))))
	else:
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * 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)
	tmp = 0.0
	if ((c <= -1.45e-40) || !(c <= 4.5e-27))
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(c * b))))));
	else
		tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(c * 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)
	tmp = 0.0;
	if ((c <= -1.45e-40) || ~((c <= 4.5e-27)))
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
	else
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (c * 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_] := If[Or[LessEqual[c, -1.45e-40], N[Not[LessEqual[c, 4.5e-27]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.45 \cdot 10^{-40} \lor \neg \left(c \leq 4.5 \cdot 10^{-27}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.4499999999999999e-40 or 4.5000000000000002e-27 < c

    1. Initial program 84.7%

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

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

    if -1.4499999999999999e-40 < c < 4.5000000000000002e-27

    1. Initial program 98.2%

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(a \cdot c\right)} \cdot i\right) \]
    4. Step-by-step derivation
      1. *-commutative94.5%

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

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

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

Alternative 10: 79.1% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;c \leq -1.05 \cdot 10^{-30} \lor \neg \left(c \leq 2.36 \cdot 10^{-29}\right):\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \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 -1.05e-30) (not (<= c 2.36e-29)))
   (* 2.0 (- (* z t) (* c (* i (+ a (* c b))))))
   (* 2.0 (+ (* 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 <= -1.05e-30) || !(c <= 2.36e-29)) {
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
	} else {
		tmp = 2.0 * ((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 <= (-1.05d-30)) .or. (.not. (c <= 2.36d-29))) then
        tmp = 2.0d0 * ((z * t) - (c * (i * (a + (c * b)))))
    else
        tmp = 2.0d0 * ((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 <= -1.05e-30) || !(c <= 2.36e-29)) {
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
	} else {
		tmp = 2.0 * ((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 <= -1.05e-30) or not (c <= 2.36e-29):
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))))
	else:
		tmp = 2.0 * ((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 ((c <= -1.05e-30) || !(c <= 2.36e-29))
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(i * Float64(a + Float64(c * b))))));
	else
		tmp = Float64(2.0 * 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 <= -1.05e-30) || ~((c <= 2.36e-29)))
		tmp = 2.0 * ((z * t) - (c * (i * (a + (c * b)))));
	else
		tmp = 2.0 * ((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[c, -1.05e-30], N[Not[LessEqual[c, 2.36e-29]], $MachinePrecision]], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * 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 \leq -1.05 \cdot 10^{-30} \lor \neg \left(c \leq 2.36 \cdot 10^{-29}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.0500000000000001e-30 or 2.35999999999999992e-29 < c

    1. Initial program 85.1%

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

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

    if -1.0500000000000001e-30 < c < 2.35999999999999992e-29

    1. Initial program 97.4%

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

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

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

Alternative 11: 72.0% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;c \leq -4.6 \cdot 10^{+152} \lor \neg \left(c \leq 2.2 \cdot 10^{-28}\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \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 -4.6e+152) (not (<= c 2.2e-28)))
   (* 2.0 (* c (* i (- (- (* c b)) a))))
   (* 2.0 (+ (* 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 <= -4.6e+152) || !(c <= 2.2e-28)) {
		tmp = 2.0 * (c * (i * (-(c * b) - a)));
	} else {
		tmp = 2.0 * ((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 <= (-4.6d+152)) .or. (.not. (c <= 2.2d-28))) then
        tmp = 2.0d0 * (c * (i * (-(c * b) - a)))
    else
        tmp = 2.0d0 * ((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 <= -4.6e+152) || !(c <= 2.2e-28)) {
		tmp = 2.0 * (c * (i * (-(c * b) - a)));
	} else {
		tmp = 2.0 * ((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 <= -4.6e+152) or not (c <= 2.2e-28):
		tmp = 2.0 * (c * (i * (-(c * b) - a)))
	else:
		tmp = 2.0 * ((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 ((c <= -4.6e+152) || !(c <= 2.2e-28))
		tmp = Float64(2.0 * Float64(c * Float64(i * Float64(Float64(-Float64(c * b)) - a))));
	else
		tmp = Float64(2.0 * 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 <= -4.6e+152) || ~((c <= 2.2e-28)))
		tmp = 2.0 * (c * (i * (-(c * b) - a)));
	else
		tmp = 2.0 * ((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[c, -4.6e+152], N[Not[LessEqual[c, 2.2e-28]], $MachinePrecision]], N[(2.0 * N[(c * N[(i * N[((-N[(c * b), $MachinePrecision]) - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * 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 \leq -4.6 \cdot 10^{+152} \lor \neg \left(c \leq 2.2 \cdot 10^{-28}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-c \cdot b\right) - a\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -4.5999999999999997e152 or 2.19999999999999996e-28 < c

    1. Initial program 79.2%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]

    if -4.5999999999999997e152 < c < 2.19999999999999996e-28

    1. Initial program 98.0%

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

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

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

Alternative 12: 54.9% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{if}\;c \leq -3.8 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 3.6 \cdot 10^{-19}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 5.2 \cdot 10^{+248}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(c \cdot 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 (* (* a (* c i)) -2.0)))
   (if (<= c -3.8e+154)
     t_1
     (if (<= c 3.6e-19)
       (* 2.0 (+ (* x y) (* z t)))
       (if (<= c 5.2e+248) t_1 (* 2.0 (* i (* c 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 = (a * (c * i)) * -2.0;
	double tmp;
	if (c <= -3.8e+154) {
		tmp = t_1;
	} else if (c <= 3.6e-19) {
		tmp = 2.0 * ((x * y) + (z * t));
	} else if (c <= 5.2e+248) {
		tmp = t_1;
	} else {
		tmp = 2.0 * (i * (c * a));
	}
	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 * (c * i)) * (-2.0d0)
    if (c <= (-3.8d+154)) then
        tmp = t_1
    else if (c <= 3.6d-19) then
        tmp = 2.0d0 * ((x * y) + (z * t))
    else if (c <= 5.2d+248) then
        tmp = t_1
    else
        tmp = 2.0d0 * (i * (c * a))
    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 * (c * i)) * -2.0;
	double tmp;
	if (c <= -3.8e+154) {
		tmp = t_1;
	} else if (c <= 3.6e-19) {
		tmp = 2.0 * ((x * y) + (z * t));
	} else if (c <= 5.2e+248) {
		tmp = t_1;
	} else {
		tmp = 2.0 * (i * (c * 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 = (a * (c * i)) * -2.0
	tmp = 0
	if c <= -3.8e+154:
		tmp = t_1
	elif c <= 3.6e-19:
		tmp = 2.0 * ((x * y) + (z * t))
	elif c <= 5.2e+248:
		tmp = t_1
	else:
		tmp = 2.0 * (i * (c * 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(a * Float64(c * i)) * -2.0)
	tmp = 0.0
	if (c <= -3.8e+154)
		tmp = t_1;
	elseif (c <= 3.6e-19)
		tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(z * t)));
	elseif (c <= 5.2e+248)
		tmp = t_1;
	else
		tmp = Float64(2.0 * Float64(i * Float64(c * 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 = (a * (c * i)) * -2.0;
	tmp = 0.0;
	if (c <= -3.8e+154)
		tmp = t_1;
	elseif (c <= 3.6e-19)
		tmp = 2.0 * ((x * y) + (z * t));
	elseif (c <= 5.2e+248)
		tmp = t_1;
	else
		tmp = 2.0 * (i * (c * 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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -3.8e+154], t$95$1, If[LessEqual[c, 3.6e-19], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.2e+248], t$95$1, N[(2.0 * N[(i * N[(c * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\
\mathbf{if}\;c \leq -3.8 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq 3.6 \cdot 10^{-19}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\

\mathbf{elif}\;c \leq 5.2 \cdot 10^{+248}:\\
\;\;\;\;t\_1\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.7999999999999998e154 or 3.6000000000000001e-19 < c < 5.20000000000000019e248

    1. Initial program 76.1%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg49.7%

        \[\leadsto 2 \cdot \color{blue}{\left(-a \cdot \left(c \cdot i\right)\right)} \]
      2. *-commutative49.7%

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      3. associate-*l*46.3%

        \[\leadsto 2 \cdot \left(-\color{blue}{c \cdot \left(i \cdot a\right)}\right) \]
      4. *-commutative46.3%

        \[\leadsto 2 \cdot \left(-c \cdot \color{blue}{\left(a \cdot i\right)}\right) \]
      5. distribute-rgt-neg-in46.3%

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(-a \cdot i\right)\right)} \]
      6. *-commutative46.3%

        \[\leadsto 2 \cdot \left(c \cdot \left(-\color{blue}{i \cdot a}\right)\right) \]
      7. distribute-rgt-neg-in46.3%

        \[\leadsto 2 \cdot \left(c \cdot \color{blue}{\left(i \cdot \left(-a\right)\right)}\right) \]
    5. Simplified46.3%

      \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)} \]
    6. Taylor expanded in c around 0 49.7%

      \[\leadsto \color{blue}{-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutative49.7%

        \[\leadsto \color{blue}{\left(a \cdot \left(c \cdot i\right)\right) \cdot -2} \]
    8. Simplified49.7%

      \[\leadsto \color{blue}{\left(a \cdot \left(c \cdot i\right)\right) \cdot -2} \]

    if -3.7999999999999998e154 < c < 3.6000000000000001e-19

    1. Initial program 98.0%

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

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

    if 5.20000000000000019e248 < c

    1. Initial program 99.9%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Step-by-step derivation
      1. mul-1-neg10.4%

        \[\leadsto 2 \cdot \color{blue}{\left(-a \cdot \left(c \cdot i\right)\right)} \]
      2. *-commutative10.4%

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      3. associate-*l*10.3%

        \[\leadsto 2 \cdot \left(-\color{blue}{c \cdot \left(i \cdot a\right)}\right) \]
      4. *-commutative10.3%

        \[\leadsto 2 \cdot \left(-c \cdot \color{blue}{\left(a \cdot i\right)}\right) \]
      5. distribute-rgt-neg-in10.3%

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(-a \cdot i\right)\right)} \]
      6. *-commutative10.3%

        \[\leadsto 2 \cdot \left(c \cdot \left(-\color{blue}{i \cdot a}\right)\right) \]
      7. distribute-rgt-neg-in10.3%

        \[\leadsto 2 \cdot \left(c \cdot \color{blue}{\left(i \cdot \left(-a\right)\right)}\right) \]
    5. Simplified10.3%

      \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)} \]
    6. Step-by-step derivation
      1. pow110.3%

        \[\leadsto 2 \cdot \color{blue}{{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)}^{1}} \]
      2. *-commutative10.3%

        \[\leadsto 2 \cdot {\left(c \cdot \color{blue}{\left(\left(-a\right) \cdot i\right)}\right)}^{1} \]
      3. add-sqr-sqrt0.1%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\left(\sqrt{-a} \cdot \sqrt{-a}\right)} \cdot i\right)\right)}^{1} \]
      4. sqrt-unprod27.8%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\sqrt{\left(-a\right) \cdot \left(-a\right)}} \cdot i\right)\right)}^{1} \]
      5. sqr-neg27.8%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\sqrt{\color{blue}{a \cdot a}} \cdot i\right)\right)}^{1} \]
      6. sqrt-unprod10.4%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{\left(\sqrt{a} \cdot \sqrt{a}\right)} \cdot i\right)\right)}^{1} \]
      7. add-sqr-sqrt37.9%

        \[\leadsto 2 \cdot {\left(c \cdot \left(\color{blue}{a} \cdot i\right)\right)}^{1} \]
    7. Applied egg-rr37.9%

      \[\leadsto 2 \cdot \color{blue}{{\left(c \cdot \left(a \cdot i\right)\right)}^{1}} \]
    8. Step-by-step derivation
      1. unpow137.9%

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(a \cdot i\right)\right)} \]
      2. associate-*r*54.8%

        \[\leadsto 2 \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot i\right)} \]
    9. Simplified54.8%

      \[\leadsto 2 \cdot \color{blue}{\left(\left(c \cdot a\right) \cdot i\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification68.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.8 \cdot 10^{+154}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;c \leq 3.6 \cdot 10^{-19}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 5.2 \cdot 10^{+248}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(c \cdot a\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 39.7% accurate, 1.3× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+87} \lor \neg \left(y \leq 1.75 \cdot 10^{+58}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(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 (<= y -3.9e+87) (not (<= y 1.75e+58)))
   (* 2.0 (* x y))
   (* 2.0 (* 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 ((y <= -3.9e+87) || !(y <= 1.75e+58)) {
		tmp = 2.0 * (x * y);
	} else {
		tmp = 2.0 * (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 ((y <= (-3.9d+87)) .or. (.not. (y <= 1.75d+58))) then
        tmp = 2.0d0 * (x * y)
    else
        tmp = 2.0d0 * (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 ((y <= -3.9e+87) || !(y <= 1.75e+58)) {
		tmp = 2.0 * (x * y);
	} else {
		tmp = 2.0 * (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 (y <= -3.9e+87) or not (y <= 1.75e+58):
		tmp = 2.0 * (x * y)
	else:
		tmp = 2.0 * (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 ((y <= -3.9e+87) || !(y <= 1.75e+58))
		tmp = Float64(2.0 * Float64(x * y));
	else
		tmp = Float64(2.0 * 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 ((y <= -3.9e+87) || ~((y <= 1.75e+58)))
		tmp = 2.0 * (x * y);
	else
		tmp = 2.0 * (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[y, -3.9e+87], N[Not[LessEqual[y, 1.75e+58]], $MachinePrecision]], N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision], N[(2.0 * 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}\;y \leq -3.9 \cdot 10^{+87} \lor \neg \left(y \leq 1.75 \cdot 10^{+58}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -3.9000000000000002e87 or 1.7499999999999999e58 < y

    1. Initial program 84.7%

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

      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y\right)} \]

    if -3.9000000000000002e87 < y < 1.7499999999999999e58

    1. Initial program 94.5%

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification44.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.9 \cdot 10^{+87} \lor \neg \left(y \leq 1.75 \cdot 10^{+58}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 29.0% accurate, 3.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ 2 \cdot \left(z \cdot t\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 (* 2.0 (* 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 2.0 * (z * t);
}
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 = 2.0d0 * (z * t)
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 2.0 * (z * t);
}
[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 2.0 * (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 Float64(2.0 * Float64(z * t))
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 = 2.0 * (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[(2.0 * 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])\\
\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 90.8%

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

    \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
  4. Final simplification31.4%

    \[\leadsto 2 \cdot \left(z \cdot t\right) \]
  5. Add Preprocessing

Developer target: 94.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (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 = 2.0d0 * (((x * y) + (z * t)) - ((a + (b * c)) * (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 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)))
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i))))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (((x * y) + (z * t)) - ((a + (b * c)) * (c * i)));
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}

Reproduce

?
herbie shell --seed 2024100 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :alt
  (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))

  (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))