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

Percentage Accurate: 90.6% → 97.1%
Time: 17.1s
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.6% 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: 97.1% accurate, 0.1× speedup?

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

\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot 2 - 2 \cdot \left(c \cdot \left(\frac{a \cdot i}{z} + \frac{b \cdot \left(c \cdot i\right)}{z}\right)\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 93.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. Step-by-step derivation
      1. fma-define93.7%

        \[\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*97.5%

        \[\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. Simplified97.5%

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

    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. Step-by-step derivation
      1. fma-define0.0%

        \[\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*14.3%

        \[\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. Simplified14.3%

      \[\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. Taylor expanded in z around inf 42.9%

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

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

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

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

Alternative 2: 46.0% 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 := \left(x \cdot y\right) \cdot 2\\ t_2 := -2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{if}\;c \leq -2 \cdot 10^{+191}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \leq -2 \cdot 10^{+19}:\\ \;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq -1.6 \cdot 10^{-21}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \leq -4.3 \cdot 10^{-49}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -6.8 \cdot 10^{-224}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-273}:\\ \;\;\;\;z \cdot \left(t \cdot 2\right)\\ \mathbf{elif}\;c \leq 1.7 \cdot 10^{-205}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 4 \cdot 10^{-143}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.54 \cdot 10^{+88}:\\ \;\;\;\;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 (* (* x y) 2.0)) (t_2 (* -2.0 (* c (* (* b c) i)))))
   (if (<= c -2e+191)
     t_2
     (if (<= c -2e+19)
       (* c (* i (* a -2.0)))
       (if (<= c -1.6e-21)
         t_2
         (if (<= c -4.3e-49)
           (* -2.0 (* a (* c i)))
           (if (<= c -6.8e-224)
             (* y (* x 2.0))
             (if (<= c -9.5e-273)
               (* z (* t 2.0))
               (if (<= c 1.7e-205)
                 t_1
                 (if (<= c 4e-143)
                   (* 2.0 (* z t))
                   (if (<= c 1.54e+88) 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 = (x * y) * 2.0;
	double t_2 = -2.0 * (c * ((b * c) * i));
	double tmp;
	if (c <= -2e+191) {
		tmp = t_2;
	} else if (c <= -2e+19) {
		tmp = c * (i * (a * -2.0));
	} else if (c <= -1.6e-21) {
		tmp = t_2;
	} else if (c <= -4.3e-49) {
		tmp = -2.0 * (a * (c * i));
	} else if (c <= -6.8e-224) {
		tmp = y * (x * 2.0);
	} else if (c <= -9.5e-273) {
		tmp = z * (t * 2.0);
	} else if (c <= 1.7e-205) {
		tmp = t_1;
	} else if (c <= 4e-143) {
		tmp = 2.0 * (z * t);
	} else if (c <= 1.54e+88) {
		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 = (x * y) * 2.0d0
    t_2 = (-2.0d0) * (c * ((b * c) * i))
    if (c <= (-2d+191)) then
        tmp = t_2
    else if (c <= (-2d+19)) then
        tmp = c * (i * (a * (-2.0d0)))
    else if (c <= (-1.6d-21)) then
        tmp = t_2
    else if (c <= (-4.3d-49)) then
        tmp = (-2.0d0) * (a * (c * i))
    else if (c <= (-6.8d-224)) then
        tmp = y * (x * 2.0d0)
    else if (c <= (-9.5d-273)) then
        tmp = z * (t * 2.0d0)
    else if (c <= 1.7d-205) then
        tmp = t_1
    else if (c <= 4d-143) then
        tmp = 2.0d0 * (z * t)
    else if (c <= 1.54d+88) 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 = (x * y) * 2.0;
	double t_2 = -2.0 * (c * ((b * c) * i));
	double tmp;
	if (c <= -2e+191) {
		tmp = t_2;
	} else if (c <= -2e+19) {
		tmp = c * (i * (a * -2.0));
	} else if (c <= -1.6e-21) {
		tmp = t_2;
	} else if (c <= -4.3e-49) {
		tmp = -2.0 * (a * (c * i));
	} else if (c <= -6.8e-224) {
		tmp = y * (x * 2.0);
	} else if (c <= -9.5e-273) {
		tmp = z * (t * 2.0);
	} else if (c <= 1.7e-205) {
		tmp = t_1;
	} else if (c <= 4e-143) {
		tmp = 2.0 * (z * t);
	} else if (c <= 1.54e+88) {
		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 = (x * y) * 2.0
	t_2 = -2.0 * (c * ((b * c) * i))
	tmp = 0
	if c <= -2e+191:
		tmp = t_2
	elif c <= -2e+19:
		tmp = c * (i * (a * -2.0))
	elif c <= -1.6e-21:
		tmp = t_2
	elif c <= -4.3e-49:
		tmp = -2.0 * (a * (c * i))
	elif c <= -6.8e-224:
		tmp = y * (x * 2.0)
	elif c <= -9.5e-273:
		tmp = z * (t * 2.0)
	elif c <= 1.7e-205:
		tmp = t_1
	elif c <= 4e-143:
		tmp = 2.0 * (z * t)
	elif c <= 1.54e+88:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x * y) * 2.0)
	t_2 = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i)))
	tmp = 0.0
	if (c <= -2e+191)
		tmp = t_2;
	elseif (c <= -2e+19)
		tmp = Float64(c * Float64(i * Float64(a * -2.0)));
	elseif (c <= -1.6e-21)
		tmp = t_2;
	elseif (c <= -4.3e-49)
		tmp = Float64(-2.0 * Float64(a * Float64(c * i)));
	elseif (c <= -6.8e-224)
		tmp = Float64(y * Float64(x * 2.0));
	elseif (c <= -9.5e-273)
		tmp = Float64(z * Float64(t * 2.0));
	elseif (c <= 1.7e-205)
		tmp = t_1;
	elseif (c <= 4e-143)
		tmp = Float64(2.0 * Float64(z * t));
	elseif (c <= 1.54e+88)
		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 = (x * y) * 2.0;
	t_2 = -2.0 * (c * ((b * c) * i));
	tmp = 0.0;
	if (c <= -2e+191)
		tmp = t_2;
	elseif (c <= -2e+19)
		tmp = c * (i * (a * -2.0));
	elseif (c <= -1.6e-21)
		tmp = t_2;
	elseif (c <= -4.3e-49)
		tmp = -2.0 * (a * (c * i));
	elseif (c <= -6.8e-224)
		tmp = y * (x * 2.0);
	elseif (c <= -9.5e-273)
		tmp = z * (t * 2.0);
	elseif (c <= 1.7e-205)
		tmp = t_1;
	elseif (c <= 4e-143)
		tmp = 2.0 * (z * t);
	elseif (c <= 1.54e+88)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2e+191], t$95$2, If[LessEqual[c, -2e+19], N[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.6e-21], t$95$2, If[LessEqual[c, -4.3e-49], N[(-2.0 * N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -6.8e-224], N[(y * N[(x * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -9.5e-273], N[(z * N[(t * 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.7e-205], t$95$1, If[LessEqual[c, 4e-143], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.54e+88], 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 := \left(x \cdot y\right) \cdot 2\\
t_2 := -2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2 \cdot 10^{+191}:\\
\;\;\;\;t\_2\\

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

\mathbf{elif}\;c \leq -1.6 \cdot 10^{-21}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \leq -4.3 \cdot 10^{-49}:\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\

\mathbf{elif}\;c \leq -6.8 \cdot 10^{-224}:\\
\;\;\;\;y \cdot \left(x \cdot 2\right)\\

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

\mathbf{elif}\;c \leq 1.7 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq 4 \cdot 10^{-143}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

\mathbf{elif}\;c \leq 1.54 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 7 regimes
  2. if c < -2.00000000000000015e191 or -2e19 < c < -1.6000000000000001e-21 or 1.54000000000000006e88 < c

    1. Initial program 82.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. Step-by-step derivation
      1. fma-define82.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*89.3%

        \[\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. Simplified89.3%

      \[\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. Taylor expanded in i around inf 82.4%

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

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

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

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

    if -2.00000000000000015e191 < c < -2e19

    1. Initial program 63.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. Step-by-step derivation
      1. fma-define63.0%

        \[\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*81.2%

        \[\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. Simplified81.2%

      \[\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. Taylor expanded in a around inf 55.3%

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

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

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

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

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

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

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

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

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

    if -1.6000000000000001e-21 < c < -4.30000000000000016e-49

    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. Step-by-step derivation
      1. fma-define100.0%

        \[\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*99.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. Simplified99.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. Taylor expanded in a around inf 53.7%

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

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

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

    if -4.30000000000000016e-49 < c < -6.79999999999999984e-224

    1. Initial program 99.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-define99.8%

        \[\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*99.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. Simplified99.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. Taylor expanded in x around inf 52.9%

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative52.9%

        \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
      2. associate-*r*52.9%

        \[\leadsto \color{blue}{\left(2 \cdot y\right) \cdot x} \]
      3. *-commutative52.9%

        \[\leadsto \color{blue}{\left(y \cdot 2\right)} \cdot x \]
      4. associate-*r*52.9%

        \[\leadsto \color{blue}{y \cdot \left(2 \cdot x\right)} \]
    7. Simplified52.9%

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

    if -6.79999999999999984e-224 < c < -9.49999999999999925e-273

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

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*71.3%

        \[\leadsto \color{blue}{\left(2 \cdot t\right) \cdot z} \]
      2. *-commutative71.3%

        \[\leadsto \color{blue}{z \cdot \left(2 \cdot t\right)} \]
    6. Simplified71.3%

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

    if -9.49999999999999925e-273 < c < 1.7000000000000001e-205 or 3.9999999999999998e-143 < c < 1.54000000000000006e88

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

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

    if 1.7000000000000001e-205 < c < 3.9999999999999998e-143

    1. Initial program 99.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 z around inf 60.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2 \cdot 10^{+191}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -2 \cdot 10^{+19}:\\ \;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq -1.6 \cdot 10^{-21}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -4.3 \cdot 10^{-49}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -6.8 \cdot 10^{-224}:\\ \;\;\;\;y \cdot \left(x \cdot 2\right)\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{-273}:\\ \;\;\;\;z \cdot \left(t \cdot 2\right)\\ \mathbf{elif}\;c \leq 1.7 \cdot 10^{-205}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq 4 \cdot 10^{-143}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.54 \cdot 10^{+88}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 94.5% accurate, 0.4× speedup?

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

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


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

    1. Initial program 74.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. Step-by-step derivation
      1. fma-define74.1%

        \[\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*87.1%

        \[\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. Simplified87.1%

      \[\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. Taylor expanded in i around inf 87.5%

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e262

    1. Initial program 99.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. Recombined 2 regimes into one program.
  4. Final simplification94.2%

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

Alternative 4: 97.1% accurate, 0.4× speedup?

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

\mathbf{else}:\\
\;\;\;\;z \cdot \left(t \cdot 2 - 2 \cdot \left(c \cdot \left(\frac{a \cdot i}{z} + \frac{b \cdot \left(c \cdot i\right)}{z}\right)\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 93.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. Step-by-step derivation
      1. fma-define93.7%

        \[\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*97.5%

        \[\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. Simplified97.5%

      \[\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-define97.5%

        \[\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. +-commutative97.5%

        \[\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-rr97.5%

      \[\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. Step-by-step derivation
      1. fma-define0.0%

        \[\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*14.3%

        \[\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. Simplified14.3%

      \[\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. Taylor expanded in z around inf 42.9%

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

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

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

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

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

\mathbf{else}:\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\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 93.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. Step-by-step derivation
      1. fma-define93.7%

        \[\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*97.5%

        \[\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. Simplified97.5%

      \[\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-define97.5%

        \[\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. +-commutative97.5%

        \[\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-rr97.5%

      \[\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. Step-by-step derivation
      1. fma-define0.0%

        \[\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*14.3%

        \[\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. Simplified14.3%

      \[\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. Taylor expanded in i around inf 64.4%

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

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

Alternative 6: 74.0% 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 := \left(x \cdot y + z \cdot t\right) \cdot 2\\ t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{if}\;c \leq -2.45 \cdot 10^{-51}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \leq 7.5 \cdot 10^{-28}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 5.2 \cdot 10^{+24}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.55 \cdot 10^{+85}:\\ \;\;\;\;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 (* (+ (* x y) (* z t)) 2.0))
        (t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
   (if (<= c -2.45e-51)
     t_2
     (if (<= c 7.5e-28)
       t_1
       (if (<= c 5.2e+24)
         (* 2.0 (- (* x y) (* a (* c i))))
         (if (<= c 2.55e+85) 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 = ((x * y) + (z * t)) * 2.0;
	double t_2 = -2.0 * (c * ((a + (b * c)) * i));
	double tmp;
	if (c <= -2.45e-51) {
		tmp = t_2;
	} else if (c <= 7.5e-28) {
		tmp = t_1;
	} else if (c <= 5.2e+24) {
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	} else if (c <= 2.55e+85) {
		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 = ((x * y) + (z * t)) * 2.0d0
    t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
    if (c <= (-2.45d-51)) then
        tmp = t_2
    else if (c <= 7.5d-28) then
        tmp = t_1
    else if (c <= 5.2d+24) then
        tmp = 2.0d0 * ((x * y) - (a * (c * i)))
    else if (c <= 2.55d+85) 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 = ((x * y) + (z * t)) * 2.0;
	double t_2 = -2.0 * (c * ((a + (b * c)) * i));
	double tmp;
	if (c <= -2.45e-51) {
		tmp = t_2;
	} else if (c <= 7.5e-28) {
		tmp = t_1;
	} else if (c <= 5.2e+24) {
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	} else if (c <= 2.55e+85) {
		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 = ((x * y) + (z * t)) * 2.0
	t_2 = -2.0 * (c * ((a + (b * c)) * i))
	tmp = 0
	if c <= -2.45e-51:
		tmp = t_2
	elif c <= 7.5e-28:
		tmp = t_1
	elif c <= 5.2e+24:
		tmp = 2.0 * ((x * y) - (a * (c * i)))
	elif c <= 2.55e+85:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0)
	t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i)))
	tmp = 0.0
	if (c <= -2.45e-51)
		tmp = t_2;
	elseif (c <= 7.5e-28)
		tmp = t_1;
	elseif (c <= 5.2e+24)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(c * i))));
	elseif (c <= 2.55e+85)
		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 = ((x * y) + (z * t)) * 2.0;
	t_2 = -2.0 * (c * ((a + (b * c)) * i));
	tmp = 0.0;
	if (c <= -2.45e-51)
		tmp = t_2;
	elseif (c <= 7.5e-28)
		tmp = t_1;
	elseif (c <= 5.2e+24)
		tmp = 2.0 * ((x * y) - (a * (c * i)));
	elseif (c <= 2.55e+85)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.45e-51], t$95$2, If[LessEqual[c, 7.5e-28], t$95$1, If[LessEqual[c, 5.2e+24], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.55e+85], 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 := \left(x \cdot y + z \cdot t\right) \cdot 2\\
t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.45 \cdot 10^{-51}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \leq 7.5 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;c \leq 2.55 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -2.44999999999999987e-51 or 2.5499999999999999e85 < c

    1. Initial program 79.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. Step-by-step derivation
      1. fma-define79.7%

        \[\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*88.5%

        \[\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. Simplified88.5%

      \[\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. Taylor expanded in i around inf 80.5%

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

    if -2.44999999999999987e-51 < c < 7.5000000000000003e-28 or 5.1999999999999997e24 < c < 2.5499999999999999e85

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

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

    if 7.5000000000000003e-28 < c < 5.1999999999999997e24

    1. Initial program 92.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 77.2%

      \[\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. *-commutative77.2%

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

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

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

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

Alternative 7: 35.1% accurate, 0.6× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\ t_2 := \left(x \cdot y\right) \cdot 2\\ t_3 := 2 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;y \leq -2.85 \cdot 10^{-142}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-219}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-101}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;y \leq 520:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+47}:\\ \;\;\;\;t\_3\\ \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 (* c (* i (* a -2.0))))
        (t_2 (* (* x y) 2.0))
        (t_3 (* 2.0 (* z t))))
   (if (<= y -2.85e-142)
     t_2
     (if (<= y 7.2e-219)
       t_1
       (if (<= y 1.9e-101)
         t_3
         (if (<= y 520.0) t_1 (if (<= y 1.5e+47) t_3 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 = c * (i * (a * -2.0));
	double t_2 = (x * y) * 2.0;
	double t_3 = 2.0 * (z * t);
	double tmp;
	if (y <= -2.85e-142) {
		tmp = t_2;
	} else if (y <= 7.2e-219) {
		tmp = t_1;
	} else if (y <= 1.9e-101) {
		tmp = t_3;
	} else if (y <= 520.0) {
		tmp = t_1;
	} else if (y <= 1.5e+47) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = c * (i * (a * (-2.0d0)))
    t_2 = (x * y) * 2.0d0
    t_3 = 2.0d0 * (z * t)
    if (y <= (-2.85d-142)) then
        tmp = t_2
    else if (y <= 7.2d-219) then
        tmp = t_1
    else if (y <= 1.9d-101) then
        tmp = t_3
    else if (y <= 520.0d0) then
        tmp = t_1
    else if (y <= 1.5d+47) then
        tmp = t_3
    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 = c * (i * (a * -2.0));
	double t_2 = (x * y) * 2.0;
	double t_3 = 2.0 * (z * t);
	double tmp;
	if (y <= -2.85e-142) {
		tmp = t_2;
	} else if (y <= 7.2e-219) {
		tmp = t_1;
	} else if (y <= 1.9e-101) {
		tmp = t_3;
	} else if (y <= 520.0) {
		tmp = t_1;
	} else if (y <= 1.5e+47) {
		tmp = t_3;
	} 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 = c * (i * (a * -2.0))
	t_2 = (x * y) * 2.0
	t_3 = 2.0 * (z * t)
	tmp = 0
	if y <= -2.85e-142:
		tmp = t_2
	elif y <= 7.2e-219:
		tmp = t_1
	elif y <= 1.9e-101:
		tmp = t_3
	elif y <= 520.0:
		tmp = t_1
	elif y <= 1.5e+47:
		tmp = t_3
	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(c * Float64(i * Float64(a * -2.0)))
	t_2 = Float64(Float64(x * y) * 2.0)
	t_3 = Float64(2.0 * Float64(z * t))
	tmp = 0.0
	if (y <= -2.85e-142)
		tmp = t_2;
	elseif (y <= 7.2e-219)
		tmp = t_1;
	elseif (y <= 1.9e-101)
		tmp = t_3;
	elseif (y <= 520.0)
		tmp = t_1;
	elseif (y <= 1.5e+47)
		tmp = t_3;
	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 = c * (i * (a * -2.0));
	t_2 = (x * y) * 2.0;
	t_3 = 2.0 * (z * t);
	tmp = 0.0;
	if (y <= -2.85e-142)
		tmp = t_2;
	elseif (y <= 7.2e-219)
		tmp = t_1;
	elseif (y <= 1.9e-101)
		tmp = t_3;
	elseif (y <= 520.0)
		tmp = t_1;
	elseif (y <= 1.5e+47)
		tmp = t_3;
	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[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.85e-142], t$95$2, If[LessEqual[y, 7.2e-219], t$95$1, If[LessEqual[y, 1.9e-101], t$95$3, If[LessEqual[y, 520.0], t$95$1, If[LessEqual[y, 1.5e+47], t$95$3, 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 := c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
t_3 := 2 \cdot \left(z \cdot t\right)\\
\mathbf{if}\;y \leq -2.85 \cdot 10^{-142}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 7.2 \cdot 10^{-219}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.9 \cdot 10^{-101}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;y \leq 520:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 1.5 \cdot 10^{+47}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.84999999999999997e-142 or 1.5000000000000001e47 < y

    1. Initial program 83.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 38.0%

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

    if -2.84999999999999997e-142 < y < 7.19999999999999947e-219 or 1.90000000000000005e-101 < y < 520

    1. Initial program 97.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. Step-by-step derivation
      1. fma-define97.0%

        \[\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.4%

        \[\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.4%

      \[\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. Taylor expanded in a around inf 39.4%

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

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

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

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

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

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

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

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

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

    if 7.19999999999999947e-219 < y < 1.90000000000000005e-101 or 520 < y < 1.5000000000000001e47

    1. Initial program 92.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 34.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.85 \cdot 10^{-142}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;y \leq 7.2 \cdot 10^{-219}:\\ \;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\ \mathbf{elif}\;y \leq 1.9 \cdot 10^{-101}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;y \leq 520:\\ \;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\ \mathbf{elif}\;y \leq 1.5 \cdot 10^{+47}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 36.4% 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(a \cdot \left(c \cdot i\right)\right)\\ t_2 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;y \leq -8.5 \cdot 10^{-120}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-218}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-105}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;y \leq 1.28 \cdot 10^{+57}:\\ \;\;\;\;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 (* a (* c i)))) (t_2 (* (* x y) 2.0)))
   (if (<= y -8.5e-120)
     t_2
     (if (<= y 1.25e-218)
       t_1
       (if (<= y 3.1e-105) (* 2.0 (* z t)) (if (<= y 1.28e+57) 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 * (a * (c * i));
	double t_2 = (x * y) * 2.0;
	double tmp;
	if (y <= -8.5e-120) {
		tmp = t_2;
	} else if (y <= 1.25e-218) {
		tmp = t_1;
	} else if (y <= 3.1e-105) {
		tmp = 2.0 * (z * t);
	} else if (y <= 1.28e+57) {
		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) * (a * (c * i))
    t_2 = (x * y) * 2.0d0
    if (y <= (-8.5d-120)) then
        tmp = t_2
    else if (y <= 1.25d-218) then
        tmp = t_1
    else if (y <= 3.1d-105) then
        tmp = 2.0d0 * (z * t)
    else if (y <= 1.28d+57) 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 * (a * (c * i));
	double t_2 = (x * y) * 2.0;
	double tmp;
	if (y <= -8.5e-120) {
		tmp = t_2;
	} else if (y <= 1.25e-218) {
		tmp = t_1;
	} else if (y <= 3.1e-105) {
		tmp = 2.0 * (z * t);
	} else if (y <= 1.28e+57) {
		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 * (a * (c * i))
	t_2 = (x * y) * 2.0
	tmp = 0
	if y <= -8.5e-120:
		tmp = t_2
	elif y <= 1.25e-218:
		tmp = t_1
	elif y <= 3.1e-105:
		tmp = 2.0 * (z * t)
	elif y <= 1.28e+57:
		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(a * Float64(c * i)))
	t_2 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (y <= -8.5e-120)
		tmp = t_2;
	elseif (y <= 1.25e-218)
		tmp = t_1;
	elseif (y <= 3.1e-105)
		tmp = Float64(2.0 * Float64(z * t));
	elseif (y <= 1.28e+57)
		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 * (a * (c * i));
	t_2 = (x * y) * 2.0;
	tmp = 0.0;
	if (y <= -8.5e-120)
		tmp = t_2;
	elseif (y <= 1.25e-218)
		tmp = t_1;
	elseif (y <= 3.1e-105)
		tmp = 2.0 * (z * t);
	elseif (y <= 1.28e+57)
		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[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[y, -8.5e-120], t$95$2, If[LessEqual[y, 1.25e-218], t$95$1, If[LessEqual[y, 3.1e-105], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.28e+57], 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(a \cdot \left(c \cdot i\right)\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;y \leq -8.5 \cdot 10^{-120}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-218}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq 3.1 \cdot 10^{-105}:\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

\mathbf{elif}\;y \leq 1.28 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -8.50000000000000059e-120 or 1.28000000000000001e57 < y

    1. Initial program 82.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 x around inf 38.7%

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

    if -8.50000000000000059e-120 < y < 1.2500000000000001e-218 or 3.10000000000000014e-105 < y < 1.28000000000000001e57

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

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

      \[\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. Taylor expanded in a around inf 38.6%

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

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

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

    if 1.2500000000000001e-218 < y < 3.10000000000000014e-105

    1. Initial program 93.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 33.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -8.5 \cdot 10^{-120}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-218}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;y \leq 3.1 \cdot 10^{-105}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;y \leq 1.28 \cdot 10^{+57}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -9.0000000000000003e-20 or 1.05e88 < c

    1. Initial program 78.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. Step-by-step derivation
      1. fma-define78.0%

        \[\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*87.5%

        \[\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. Simplified87.5%

      \[\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. Taylor expanded in i around inf 81.3%

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

    if -9.0000000000000003e-20 < c < 1.05e88

    1. Initial program 97.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 a around inf 92.6%

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

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

Alternative 10: 66.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} t_1 := -2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{if}\;c \leq -2.15 \cdot 10^{+191}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq -3.3 \cdot 10^{+18}:\\ \;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq 6.7 \cdot 10^{+93}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* -2.0 (* c (* (* b c) i)))))
   (if (<= c -2.15e+191)
     t_1
     (if (<= c -3.3e+18)
       (* c (* i (* a -2.0)))
       (if (<= c 6.7e+93) (* (+ (* x y) (* z t)) 2.0) t_1)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -2.0 * (c * ((b * c) * i));
	double tmp;
	if (c <= -2.15e+191) {
		tmp = t_1;
	} else if (c <= -3.3e+18) {
		tmp = c * (i * (a * -2.0));
	} else if (c <= 6.7e+93) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (-2.0d0) * (c * ((b * c) * i))
    if (c <= (-2.15d+191)) then
        tmp = t_1
    else if (c <= (-3.3d+18)) then
        tmp = c * (i * (a * (-2.0d0)))
    else if (c <= 6.7d+93) then
        tmp = ((x * y) + (z * t)) * 2.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = -2.0 * (c * ((b * c) * i));
	double tmp;
	if (c <= -2.15e+191) {
		tmp = t_1;
	} else if (c <= -3.3e+18) {
		tmp = c * (i * (a * -2.0));
	} else if (c <= 6.7e+93) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i])
def code(x, y, z, t, a, b, c, i):
	t_1 = -2.0 * (c * ((b * c) * i))
	tmp = 0
	if c <= -2.15e+191:
		tmp = t_1
	elif c <= -3.3e+18:
		tmp = c * (i * (a * -2.0))
	elif c <= 6.7e+93:
		tmp = ((x * y) + (z * t)) * 2.0
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i)))
	tmp = 0.0
	if (c <= -2.15e+191)
		tmp = t_1;
	elseif (c <= -3.3e+18)
		tmp = Float64(c * Float64(i * Float64(a * -2.0)));
	elseif (c <= 6.7e+93)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = -2.0 * (c * ((b * c) * i));
	tmp = 0.0;
	if (c <= -2.15e+191)
		tmp = t_1;
	elseif (c <= -3.3e+18)
		tmp = c * (i * (a * -2.0));
	elseif (c <= 6.7e+93)
		tmp = ((x * y) + (z * t)) * 2.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.15e+191], t$95$1, If[LessEqual[c, -3.3e+18], N[(c * N[(i * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.7e+93], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := -2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -2.15 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq -3.3 \cdot 10^{+18}:\\
\;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -2.1499999999999999e191 or 6.69999999999999965e93 < c

    1. Initial program 79.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-define79.8%

        \[\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*87.9%

        \[\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. Simplified87.9%

      \[\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. Taylor expanded in i around inf 83.6%

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

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

        \[\leadsto -2 \cdot \left(c \cdot \left(i \cdot \color{blue}{\left(c \cdot b\right)}\right)\right) \]
    8. Simplified69.3%

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

    if -2.1499999999999999e191 < c < -3.3e18

    1. Initial program 64.3%

      \[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-define64.3%

        \[\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*81.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. Simplified81.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. Taylor expanded in a around inf 53.4%

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

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

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

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

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

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

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

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

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

    if -3.3e18 < c < 6.69999999999999965e93

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.15 \cdot 10^{+191}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -3.3 \cdot 10^{+18}:\\ \;\;\;\;c \cdot \left(i \cdot \left(a \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq 6.7 \cdot 10^{+93}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -5.9e-58 or 6.4000000000000001e87 < c

    1. Initial program 79.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. Step-by-step derivation
      1. fma-define79.7%

        \[\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*88.5%

        \[\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. Simplified88.5%

      \[\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. Taylor expanded in i around inf 80.5%

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

    if -5.9e-58 < c < 6.4000000000000001e87

    1. Initial program 97.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 c around 0 74.8%

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

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

Alternative 12: 43.2% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.00000000000000005e96 or 1.00000000000000005e26 < (*.f64 x y)

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

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

    if -1.00000000000000005e96 < (*.f64 x y) < 1.00000000000000005e26

    1. Initial program 89.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 z around inf 34.3%

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

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

Alternative 13: 43.2% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+96} \lor \neg \left(x \cdot y \leq 10^{+26}\right):\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot 2\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 (<= (* x y) -1e+96) (not (<= (* x y) 1e+26)))
   (* (* x y) 2.0)
   (* z (* t 2.0))))
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 (((x * y) <= -1e+96) || !((x * y) <= 1e+26)) {
		tmp = (x * y) * 2.0;
	} else {
		tmp = z * (t * 2.0);
	}
	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 (((x * y) <= (-1d+96)) .or. (.not. ((x * y) <= 1d+26))) then
        tmp = (x * y) * 2.0d0
    else
        tmp = z * (t * 2.0d0)
    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 (((x * y) <= -1e+96) || !((x * y) <= 1e+26)) {
		tmp = (x * y) * 2.0;
	} else {
		tmp = z * (t * 2.0);
	}
	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 ((x * y) <= -1e+96) or not ((x * y) <= 1e+26):
		tmp = (x * y) * 2.0
	else:
		tmp = z * (t * 2.0)
	return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(x * y) <= -1e+96) || !(Float64(x * y) <= 1e+26))
		tmp = Float64(Float64(x * y) * 2.0);
	else
		tmp = Float64(z * Float64(t * 2.0));
	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 (((x * y) <= -1e+96) || ~(((x * y) <= 1e+26)))
		tmp = (x * y) * 2.0;
	else
		tmp = z * (t * 2.0);
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e+96], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+26]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(z * N[(t * 2.0), $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}\;x \cdot y \leq -1 \cdot 10^{+96} \lor \neg \left(x \cdot y \leq 10^{+26}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.00000000000000005e96 or 1.00000000000000005e26 < (*.f64 x y)

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

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

    if -1.00000000000000005e96 < (*.f64 x y) < 1.00000000000000005e26

    1. Initial program 89.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 c around 0 41.0%

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
    5. Step-by-step derivation
      1. associate-*r*34.3%

        \[\leadsto \color{blue}{\left(2 \cdot t\right) \cdot z} \]
      2. *-commutative34.3%

        \[\leadsto \color{blue}{z \cdot \left(2 \cdot t\right)} \]
    6. Simplified34.3%

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

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

Alternative 14: 29.3% 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 88.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 25.7%

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

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

Developer target: 94.5% 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 2024071 
(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))))