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

Percentage Accurate: 90.2% → 93.8%
Time: 10.6s
Alternatives: 14
Speedup: 0.6×

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

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


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

    1. Initial program 96.4%

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \left(\left(t \cdot \left(-1 \cdot \frac{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}{t \cdot y} + \frac{z}{y}\right) + x\right) \cdot y\right) \]
    7. Step-by-step derivation
      1. Applied rewrites84.6%

        \[\leadsto 2 \cdot \left(\left(\mathsf{fma}\left(\frac{-c}{t}, \frac{\mathsf{fma}\left(b, c, a\right) \cdot i}{y}, \frac{z}{y}\right) \cdot t + x\right) \cdot y\right) \]
    8. Recombined 2 regimes into one program.
    9. Final simplification95.8%

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

    Alternative 2: 81.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 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+106}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-9}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\ \mathbf{elif}\;t\_1 \leq 10^{+234}:\\ \;\;\;\;\mathsf{fma}\left(\left(-a\right) \cdot c, i, t \cdot z\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\ \end{array} \end{array} \]
    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
    (FPCore (x y z t a b c i)
     :precision binary64
     (let* ((t_1 (* i (* (+ (* c b) a) c))))
       (if (<= t_1 -1e+106)
         (* (* (* (fma b c a) c) i) -2.0)
         (if (<= t_1 5e-9)
           (* (fma t z (* y x)) 2.0)
           (if (<= t_1 1e+234)
             (* (fma (* (- a) c) i (* t z)) 2.0)
             (* (* (* (fma c b a) i) -2.0) c))))))
    assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
    double code(double x, double y, double z, double t, double a, double b, double c, double i) {
    	double t_1 = i * (((c * b) + a) * c);
    	double tmp;
    	if (t_1 <= -1e+106) {
    		tmp = ((fma(b, c, a) * c) * i) * -2.0;
    	} else if (t_1 <= 5e-9) {
    		tmp = fma(t, z, (y * x)) * 2.0;
    	} else if (t_1 <= 1e+234) {
    		tmp = fma((-a * c), i, (t * z)) * 2.0;
    	} else {
    		tmp = ((fma(c, b, a) * i) * -2.0) * c;
    	}
    	return tmp;
    }
    
    x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
    function code(x, y, z, t, a, b, c, i)
    	t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
    	tmp = 0.0
    	if (t_1 <= -1e+106)
    		tmp = Float64(Float64(Float64(fma(b, c, a) * c) * i) * -2.0);
    	elseif (t_1 <= 5e-9)
    		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
    	elseif (t_1 <= 1e+234)
    		tmp = Float64(fma(Float64(Float64(-a) * c), i, Float64(t * z)) * 2.0);
    	else
    		tmp = Float64(Float64(Float64(fma(c, b, a) * i) * -2.0) * c);
    	end
    	return tmp
    end
    
    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+106], N[(N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 5e-9], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+234], N[(N[(N[((-a) * c), $MachinePrecision] * i + N[(t * z), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision]]]]]
    
    \begin{array}{l}
    [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
    \\
    \begin{array}{l}
    t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
    \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+106}:\\
    \;\;\;\;\left(\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right) \cdot -2\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-9}:\\
    \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
    
    \mathbf{elif}\;t\_1 \leq 10^{+234}:\\
    \;\;\;\;\mathsf{fma}\left(\left(-a\right) \cdot c, i, t \cdot z\right) \cdot 2\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 4 regimes
    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000009e106

      1. Initial program 86.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 i around inf

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

          \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
        2. associate-*r*N/A

          \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
        3. distribute-rgt-inN/A

          \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
        4. associate-*r*N/A

          \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
        5. distribute-lft-outN/A

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

          \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
        7. distribute-lft-outN/A

          \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
        8. associate-*r*N/A

          \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
        9. distribute-rgt-inN/A

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

          \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
        11. *-commutativeN/A

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

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

          \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
        14. *-commutativeN/A

          \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
        15. lower-fma.f6478.3

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

        \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
      6. Step-by-step derivation
        1. Applied rewrites81.7%

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

        if -1.00000000000000009e106 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000001e-9

        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. Taylor expanded in c around 0

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

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

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

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

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

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

        if 5.0000000000000001e-9 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000002e234

        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 b around 0

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

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

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

            \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(a \cdot c\right) \cdot i}\right)\right) + \left(t \cdot z + x \cdot y\right)\right) \]
          4. distribute-lft-neg-inN/A

            \[\leadsto 2 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(a \cdot c\right)\right) \cdot i} + \left(t \cdot z + x \cdot y\right)\right) \]
          5. mul-1-negN/A

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

            \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(-1 \cdot \left(a \cdot c\right), i, t \cdot z + x \cdot y\right)} \]
          7. associate-*r*N/A

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

            \[\leadsto 2 \cdot \mathsf{fma}\left(\color{blue}{\left(-1 \cdot a\right) \cdot c}, i, t \cdot z + x \cdot y\right) \]
          9. neg-mul-1N/A

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

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

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

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

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

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

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

            \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-a\right) \cdot c, i, z \cdot t\right) \]

          if 1.00000000000000002e234 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

          1. Initial program 79.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 i around inf

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

              \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
            2. associate-*r*N/A

              \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
            3. distribute-rgt-inN/A

              \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
            4. associate-*r*N/A

              \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
            5. distribute-lft-outN/A

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

              \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
            7. distribute-lft-outN/A

              \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
            8. associate-*r*N/A

              \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
            9. distribute-rgt-inN/A

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

              \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
            11. *-commutativeN/A

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

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

              \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
            14. *-commutativeN/A

              \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
            15. lower-fma.f6493.3

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

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

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

        Alternative 3: 87.3% 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 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+263}:\\ \;\;\;\;\left(\left(\frac{a}{c} + b\right) \cdot i\right) \cdot \left(\left(c \cdot c\right) \cdot -2\right)\\ \mathbf{elif}\;t\_1 \leq 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \left(\left(-a\right) \cdot c\right) \cdot i\right)\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\ \end{array} \end{array} \]
        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
        (FPCore (x y z t a b c i)
         :precision binary64
         (let* ((t_1 (* i (* (+ (* c b) a) c))))
           (if (<= t_1 -4e+263)
             (* (* (+ (/ a c) b) i) (* (* c c) -2.0))
             (if (<= t_1 1e+157)
               (* (fma z t (fma x y (* (* (- a) c) i))) 2.0)
               (* (* (* (fma c b a) i) -2.0) c)))))
        assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
        double code(double x, double y, double z, double t, double a, double b, double c, double i) {
        	double t_1 = i * (((c * b) + a) * c);
        	double tmp;
        	if (t_1 <= -4e+263) {
        		tmp = (((a / c) + b) * i) * ((c * c) * -2.0);
        	} else if (t_1 <= 1e+157) {
        		tmp = fma(z, t, fma(x, y, ((-a * c) * i))) * 2.0;
        	} else {
        		tmp = ((fma(c, b, a) * i) * -2.0) * c;
        	}
        	return tmp;
        }
        
        x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
        function code(x, y, z, t, a, b, c, i)
        	t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
        	tmp = 0.0
        	if (t_1 <= -4e+263)
        		tmp = Float64(Float64(Float64(Float64(a / c) + b) * i) * Float64(Float64(c * c) * -2.0));
        	elseif (t_1 <= 1e+157)
        		tmp = Float64(fma(z, t, fma(x, y, Float64(Float64(Float64(-a) * c) * i))) * 2.0);
        	else
        		tmp = Float64(Float64(Float64(fma(c, b, a) * i) * -2.0) * c);
        	end
        	return tmp
        end
        
        NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
        code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+263], N[(N[(N[(N[(a / c), $MachinePrecision] + b), $MachinePrecision] * i), $MachinePrecision] * N[(N[(c * c), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+157], N[(N[(z * t + N[(x * y + N[(N[((-a) * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision]]]]
        
        \begin{array}{l}
        [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
        \\
        \begin{array}{l}
        t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
        \mathbf{if}\;t\_1 \leq -4 \cdot 10^{+263}:\\
        \;\;\;\;\left(\left(\frac{a}{c} + b\right) \cdot i\right) \cdot \left(\left(c \cdot c\right) \cdot -2\right)\\
        
        \mathbf{elif}\;t\_1 \leq 10^{+157}:\\
        \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \left(\left(-a\right) \cdot c\right) \cdot i\right)\right) \cdot 2\\
        
        \mathbf{else}:\\
        \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -4.00000000000000006e263

          1. Initial program 81.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 c around inf

            \[\leadsto \color{blue}{{c}^{2} \cdot \left(-2 \cdot \left(b \cdot i\right) + -2 \cdot \frac{a \cdot i}{c}\right)} \]
          4. Step-by-step derivation
            1. distribute-lft-outN/A

              \[\leadsto {c}^{2} \cdot \color{blue}{\left(-2 \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right)\right)} \]
            2. associate-*r*N/A

              \[\leadsto \color{blue}{\left({c}^{2} \cdot -2\right) \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right)} \]
            3. *-commutativeN/A

              \[\leadsto \color{blue}{\left(-2 \cdot {c}^{2}\right)} \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right) \]
            4. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(-2 \cdot {c}^{2}\right) \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right)} \]
            5. *-commutativeN/A

              \[\leadsto \color{blue}{\left({c}^{2} \cdot -2\right)} \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right) \]
            6. lower-*.f64N/A

              \[\leadsto \color{blue}{\left({c}^{2} \cdot -2\right)} \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right) \]
            7. unpow2N/A

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

              \[\leadsto \left(\color{blue}{\left(c \cdot c\right)} \cdot -2\right) \cdot \left(b \cdot i + \frac{a \cdot i}{c}\right) \]
            9. *-commutativeN/A

              \[\leadsto \left(\left(c \cdot c\right) \cdot -2\right) \cdot \left(\color{blue}{i \cdot b} + \frac{a \cdot i}{c}\right) \]
            10. *-commutativeN/A

              \[\leadsto \left(\left(c \cdot c\right) \cdot -2\right) \cdot \left(i \cdot b + \frac{\color{blue}{i \cdot a}}{c}\right) \]
            11. associate-/l*N/A

              \[\leadsto \left(\left(c \cdot c\right) \cdot -2\right) \cdot \left(i \cdot b + \color{blue}{i \cdot \frac{a}{c}}\right) \]
            12. distribute-lft-outN/A

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

              \[\leadsto \left(\left(c \cdot c\right) \cdot -2\right) \cdot \color{blue}{\left(i \cdot \left(b + \frac{a}{c}\right)\right)} \]
            14. +-commutativeN/A

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

              \[\leadsto \left(\left(c \cdot c\right) \cdot -2\right) \cdot \left(i \cdot \color{blue}{\left(\frac{a}{c} + b\right)}\right) \]
            16. lower-/.f6490.7

              \[\leadsto \left(\left(c \cdot c\right) \cdot -2\right) \cdot \left(i \cdot \left(\color{blue}{\frac{a}{c}} + b\right)\right) \]
          5. Applied rewrites90.7%

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

          if -4.00000000000000006e263 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999983e156

          1. Initial program 99.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 b around 0

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

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

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

              \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(a \cdot c\right) \cdot i}\right)\right) + \left(t \cdot z + x \cdot y\right)\right) \]
            4. distribute-lft-neg-inN/A

              \[\leadsto 2 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(a \cdot c\right)\right) \cdot i} + \left(t \cdot z + x \cdot y\right)\right) \]
            5. mul-1-negN/A

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

              \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(-1 \cdot \left(a \cdot c\right), i, t \cdot z + x \cdot y\right)} \]
            7. associate-*r*N/A

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

              \[\leadsto 2 \cdot \mathsf{fma}\left(\color{blue}{\left(-1 \cdot a\right) \cdot c}, i, t \cdot z + x \cdot y\right) \]
            9. neg-mul-1N/A

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

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

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

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

              \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right) \]
          5. Applied rewrites94.7%

            \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites94.7%

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

            if 9.99999999999999983e156 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

            1. Initial program 80.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 i around inf

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

                \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
              3. distribute-rgt-inN/A

                \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
              4. associate-*r*N/A

                \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
              5. distribute-lft-outN/A

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

                \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
              7. distribute-lft-outN/A

                \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
              8. associate-*r*N/A

                \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
              9. distribute-rgt-inN/A

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

                \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
              11. *-commutativeN/A

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

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

                \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
              14. *-commutativeN/A

                \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
              15. lower-fma.f6488.3

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

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

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

          Alternative 4: 87.5% 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 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \left(\left(-a\right) \cdot c\right) \cdot i\right)\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\ \end{array} \end{array} \]
          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
          (FPCore (x y z t a b c i)
           :precision binary64
           (let* ((t_1 (* i (* (+ (* c b) a) c))))
             (if (<= t_1 -2e+304)
               (* (* (* (fma b c a) c) i) -2.0)
               (if (<= t_1 1e+157)
                 (* (fma z t (fma x y (* (* (- a) c) i))) 2.0)
                 (* (* (* (fma c b a) i) -2.0) c)))))
          assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
          double code(double x, double y, double z, double t, double a, double b, double c, double i) {
          	double t_1 = i * (((c * b) + a) * c);
          	double tmp;
          	if (t_1 <= -2e+304) {
          		tmp = ((fma(b, c, a) * c) * i) * -2.0;
          	} else if (t_1 <= 1e+157) {
          		tmp = fma(z, t, fma(x, y, ((-a * c) * i))) * 2.0;
          	} else {
          		tmp = ((fma(c, b, a) * i) * -2.0) * c;
          	}
          	return tmp;
          }
          
          x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
          function code(x, y, z, t, a, b, c, i)
          	t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
          	tmp = 0.0
          	if (t_1 <= -2e+304)
          		tmp = Float64(Float64(Float64(fma(b, c, a) * c) * i) * -2.0);
          	elseif (t_1 <= 1e+157)
          		tmp = Float64(fma(z, t, fma(x, y, Float64(Float64(Float64(-a) * c) * i))) * 2.0);
          	else
          		tmp = Float64(Float64(Float64(fma(c, b, a) * i) * -2.0) * c);
          	end
          	return tmp
          end
          
          NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
          code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+304], N[(N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+157], N[(N[(z * t + N[(x * y + N[(N[((-a) * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision]]]]
          
          \begin{array}{l}
          [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
          \\
          \begin{array}{l}
          t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
          \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+304}:\\
          \;\;\;\;\left(\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right) \cdot -2\\
          
          \mathbf{elif}\;t\_1 \leq 10^{+157}:\\
          \;\;\;\;\mathsf{fma}\left(z, t, \mathsf{fma}\left(x, y, \left(\left(-a\right) \cdot c\right) \cdot i\right)\right) \cdot 2\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e304

            1. Initial program 81.4%

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

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

                \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
              2. associate-*r*N/A

                \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
              3. distribute-rgt-inN/A

                \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
              4. associate-*r*N/A

                \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
              5. distribute-lft-outN/A

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

                \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
              7. distribute-lft-outN/A

                \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
              8. associate-*r*N/A

                \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
              9. distribute-rgt-inN/A

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

                \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
              11. *-commutativeN/A

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

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

                \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
              14. *-commutativeN/A

                \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
              15. lower-fma.f6486.0

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

              \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
            6. Step-by-step derivation
              1. Applied rewrites86.2%

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

              if -1.9999999999999999e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999983e156

              1. Initial program 99.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 b around 0

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

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

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

                  \[\leadsto 2 \cdot \left(\left(\mathsf{neg}\left(\color{blue}{\left(a \cdot c\right) \cdot i}\right)\right) + \left(t \cdot z + x \cdot y\right)\right) \]
                4. distribute-lft-neg-inN/A

                  \[\leadsto 2 \cdot \left(\color{blue}{\left(\mathsf{neg}\left(a \cdot c\right)\right) \cdot i} + \left(t \cdot z + x \cdot y\right)\right) \]
                5. mul-1-negN/A

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

                  \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(-1 \cdot \left(a \cdot c\right), i, t \cdot z + x \cdot y\right)} \]
                7. associate-*r*N/A

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

                  \[\leadsto 2 \cdot \mathsf{fma}\left(\color{blue}{\left(-1 \cdot a\right) \cdot c}, i, t \cdot z + x \cdot y\right) \]
                9. neg-mul-1N/A

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

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

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

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

                  \[\leadsto 2 \cdot \mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(t, z, \color{blue}{y \cdot x}\right)\right) \]
              5. Applied rewrites94.7%

                \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(\left(-a\right) \cdot c, i, \mathsf{fma}\left(t, z, y \cdot x\right)\right)} \]
              6. Step-by-step derivation
                1. Applied rewrites94.7%

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

                if 9.99999999999999983e156 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                1. Initial program 80.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 i around inf

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

                    \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
                  2. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
                  3. distribute-rgt-inN/A

                    \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
                  4. associate-*r*N/A

                    \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
                  5. distribute-lft-outN/A

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

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                  7. distribute-lft-outN/A

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
                  8. associate-*r*N/A

                    \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
                  9. distribute-rgt-inN/A

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

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
                  11. *-commutativeN/A

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

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

                    \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
                  14. *-commutativeN/A

                    \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
                  15. lower-fma.f6488.3

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

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

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

              Alternative 5: 81.3% accurate, 0.6× speedup?

              \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+106}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right) \cdot -2\\ \mathbf{elif}\;t\_1 \leq 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\ \end{array} \end{array} \]
              NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
              (FPCore (x y z t a b c i)
               :precision binary64
               (let* ((t_1 (* i (* (+ (* c b) a) c))))
                 (if (<= t_1 -1e+106)
                   (* (* (* (fma b c a) c) i) -2.0)
                   (if (<= t_1 1e+157)
                     (* (fma t z (* y x)) 2.0)
                     (* (* (* (fma c b a) i) -2.0) c)))))
              assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
              double code(double x, double y, double z, double t, double a, double b, double c, double i) {
              	double t_1 = i * (((c * b) + a) * c);
              	double tmp;
              	if (t_1 <= -1e+106) {
              		tmp = ((fma(b, c, a) * c) * i) * -2.0;
              	} else if (t_1 <= 1e+157) {
              		tmp = fma(t, z, (y * x)) * 2.0;
              	} else {
              		tmp = ((fma(c, b, a) * i) * -2.0) * c;
              	}
              	return tmp;
              }
              
              x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
              function code(x, y, z, t, a, b, c, i)
              	t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
              	tmp = 0.0
              	if (t_1 <= -1e+106)
              		tmp = Float64(Float64(Float64(fma(b, c, a) * c) * i) * -2.0);
              	elseif (t_1 <= 1e+157)
              		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
              	else
              		tmp = Float64(Float64(Float64(fma(c, b, a) * i) * -2.0) * c);
              	end
              	return tmp
              end
              
              NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
              code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+106], N[(N[(N[(N[(b * c + a), $MachinePrecision] * c), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[t$95$1, 1e+157], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision]]]]
              
              \begin{array}{l}
              [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
              \\
              \begin{array}{l}
              t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
              \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+106}:\\
              \;\;\;\;\left(\left(\mathsf{fma}\left(b, c, a\right) \cdot c\right) \cdot i\right) \cdot -2\\
              
              \mathbf{elif}\;t\_1 \leq 10^{+157}:\\
              \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000009e106

                1. Initial program 86.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 i around inf

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

                    \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
                  2. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
                  3. distribute-rgt-inN/A

                    \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
                  4. associate-*r*N/A

                    \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
                  5. distribute-lft-outN/A

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

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                  7. distribute-lft-outN/A

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
                  8. associate-*r*N/A

                    \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
                  9. distribute-rgt-inN/A

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

                    \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
                  11. *-commutativeN/A

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

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

                    \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
                  14. *-commutativeN/A

                    \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
                  15. lower-fma.f6478.3

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

                  \[\leadsto \color{blue}{\left(-2 \cdot \left(\mathsf{fma}\left(c, b, a\right) \cdot i\right)\right) \cdot c} \]
                6. Step-by-step derivation
                  1. Applied rewrites81.7%

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

                  if -1.00000000000000009e106 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999983e156

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

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

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

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

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

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

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

                  if 9.99999999999999983e156 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                  1. Initial program 80.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 i around inf

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

                      \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
                    2. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
                    3. distribute-rgt-inN/A

                      \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
                    4. associate-*r*N/A

                      \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
                    5. distribute-lft-outN/A

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

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                    7. distribute-lft-outN/A

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
                    8. associate-*r*N/A

                      \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
                    9. distribute-rgt-inN/A

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

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
                    11. *-commutativeN/A

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

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

                      \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
                    14. *-commutativeN/A

                      \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
                    15. lower-fma.f6488.3

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

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

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

                Alternative 6: 81.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(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\ t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+106}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 (* (* (* (fma c b a) i) -2.0) c)) (t_2 (* i (* (+ (* c b) a) c))))
                   (if (<= t_2 -1e+106)
                     t_1
                     (if (<= t_2 1e+157) (* (fma t z (* y x)) 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 = ((fma(c, b, a) * i) * -2.0) * c;
                	double t_2 = i * (((c * b) + a) * c);
                	double tmp;
                	if (t_2 <= -1e+106) {
                		tmp = t_1;
                	} else if (t_2 <= 1e+157) {
                		tmp = fma(t, z, (y * x)) * 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(Float64(Float64(fma(c, b, a) * i) * -2.0) * c)
                	t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
                	tmp = 0.0
                	if (t_2 <= -1e+106)
                		tmp = t_1;
                	elseif (t_2 <= 1e+157)
                		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+106], t$95$1, If[LessEqual[t$95$2, 1e+157], N[(N[(t * z + N[(y * x), $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 := \left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\
                t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+106}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;t\_2 \leq 10^{+157}:\\
                \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000009e106 or 9.99999999999999983e156 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                  1. Initial program 83.4%

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

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

                      \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
                    2. associate-*r*N/A

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
                    3. distribute-rgt-inN/A

                      \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
                    4. associate-*r*N/A

                      \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
                    5. distribute-lft-outN/A

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

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                    7. distribute-lft-outN/A

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
                    8. associate-*r*N/A

                      \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
                    9. distribute-rgt-inN/A

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

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
                    11. *-commutativeN/A

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

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

                      \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
                    14. *-commutativeN/A

                      \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
                    15. lower-fma.f6483.6

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

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

                  if -1.00000000000000009e106 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999983e156

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

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

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

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

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

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

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

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

                Alternative 7: 73.7% 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(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c\\ t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+304}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 (* (* (* (* i c) b) -2.0) c)) (t_2 (* i (* (+ (* c b) a) c))))
                   (if (<= t_2 -2e+304)
                     t_1
                     (if (<= t_2 1e+157) (* (fma t z (* y x)) 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 = (((i * c) * b) * -2.0) * c;
                	double t_2 = i * (((c * b) + a) * c);
                	double tmp;
                	if (t_2 <= -2e+304) {
                		tmp = t_1;
                	} else if (t_2 <= 1e+157) {
                		tmp = fma(t, z, (y * x)) * 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(Float64(Float64(Float64(i * c) * b) * -2.0) * c)
                	t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
                	tmp = 0.0
                	if (t_2 <= -2e+304)
                		tmp = t_1;
                	elseif (t_2 <= 1e+157)
                		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
                	else
                		tmp = t_1;
                	end
                	return tmp
                end
                
                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(i * c), $MachinePrecision] * b), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+304], t$95$1, If[LessEqual[t$95$2, 1e+157], N[(N[(t * z + N[(y * x), $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 := \left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c\\
                t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+304}:\\
                \;\;\;\;t\_1\\
                
                \mathbf{elif}\;t\_2 \leq 10^{+157}:\\
                \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_1\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 regimes
                2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e304 or 9.99999999999999983e156 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                  1. Initial program 81.0%

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

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

                      \[\leadsto -2 \cdot \left(b \cdot \color{blue}{\left(i \cdot {c}^{2}\right)}\right) \]
                    2. unpow2N/A

                      \[\leadsto -2 \cdot \left(b \cdot \left(i \cdot \color{blue}{\left(c \cdot c\right)}\right)\right) \]
                    3. associate-*r*N/A

                      \[\leadsto -2 \cdot \left(b \cdot \color{blue}{\left(\left(i \cdot c\right) \cdot c\right)}\right) \]
                    4. *-commutativeN/A

                      \[\leadsto -2 \cdot \left(b \cdot \left(\color{blue}{\left(c \cdot i\right)} \cdot c\right)\right) \]
                    5. associate-*l*N/A

                      \[\leadsto -2 \cdot \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot c\right)} \]
                    6. associate-*l*N/A

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                    7. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                    8. *-commutativeN/A

                      \[\leadsto \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right)} \cdot c \]
                    9. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right)} \cdot c \]
                    10. *-commutativeN/A

                      \[\leadsto \left(\color{blue}{\left(\left(c \cdot i\right) \cdot b\right)} \cdot -2\right) \cdot c \]
                    11. lower-*.f64N/A

                      \[\leadsto \left(\color{blue}{\left(\left(c \cdot i\right) \cdot b\right)} \cdot -2\right) \cdot c \]
                    12. *-commutativeN/A

                      \[\leadsto \left(\left(\color{blue}{\left(i \cdot c\right)} \cdot b\right) \cdot -2\right) \cdot c \]
                    13. lower-*.f6468.1

                      \[\leadsto \left(\left(\color{blue}{\left(i \cdot c\right)} \cdot b\right) \cdot -2\right) \cdot c \]
                  5. Applied rewrites68.1%

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

                  if -1.9999999999999999e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999983e156

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

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

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

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

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

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

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

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

                Alternative 8: 73.3% accurate, 0.6× speedup?

                \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+304}:\\ \;\;\;\;\left(\left(\left(i \cdot b\right) \cdot c\right) \cdot -2\right) \cdot c\\ \mathbf{elif}\;t\_1 \leq 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-2 \cdot b\right) \cdot c\right) \cdot \left(i \cdot c\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 (* i (* (+ (* c b) a) c))))
                   (if (<= t_1 -2e+304)
                     (* (* (* (* i b) c) -2.0) c)
                     (if (<= t_1 1e+157)
                       (* (fma t z (* y x)) 2.0)
                       (* (* (* -2.0 b) c) (* i c))))))
                assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                	double t_1 = i * (((c * b) + a) * c);
                	double tmp;
                	if (t_1 <= -2e+304) {
                		tmp = (((i * b) * c) * -2.0) * c;
                	} else if (t_1 <= 1e+157) {
                		tmp = fma(t, z, (y * x)) * 2.0;
                	} else {
                		tmp = ((-2.0 * b) * c) * (i * c);
                	}
                	return tmp;
                }
                
                x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                function code(x, y, z, t, a, b, c, i)
                	t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
                	tmp = 0.0
                	if (t_1 <= -2e+304)
                		tmp = Float64(Float64(Float64(Float64(i * b) * c) * -2.0) * c);
                	elseif (t_1 <= 1e+157)
                		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
                	else
                		tmp = Float64(Float64(Float64(-2.0 * b) * c) * Float64(i * c));
                	end
                	return tmp
                end
                
                NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+304], N[(N[(N[(N[(i * b), $MachinePrecision] * c), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[t$95$1, 1e+157], N[(N[(t * z + N[(y * x), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], N[(N[(N[(-2.0 * b), $MachinePrecision] * c), $MachinePrecision] * N[(i * c), $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 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                \mathbf{if}\;t\_1 \leq -2 \cdot 10^{+304}:\\
                \;\;\;\;\left(\left(\left(i \cdot b\right) \cdot c\right) \cdot -2\right) \cdot c\\
                
                \mathbf{elif}\;t\_1 \leq 10^{+157}:\\
                \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
                
                \mathbf{else}:\\
                \;\;\;\;\left(\left(-2 \cdot b\right) \cdot c\right) \cdot \left(i \cdot c\right)\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 3 regimes
                2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e304

                  1. Initial program 81.4%

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

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

                      \[\leadsto -2 \cdot \left(b \cdot \color{blue}{\left(i \cdot {c}^{2}\right)}\right) \]
                    2. unpow2N/A

                      \[\leadsto -2 \cdot \left(b \cdot \left(i \cdot \color{blue}{\left(c \cdot c\right)}\right)\right) \]
                    3. associate-*r*N/A

                      \[\leadsto -2 \cdot \left(b \cdot \color{blue}{\left(\left(i \cdot c\right) \cdot c\right)}\right) \]
                    4. *-commutativeN/A

                      \[\leadsto -2 \cdot \left(b \cdot \left(\color{blue}{\left(c \cdot i\right)} \cdot c\right)\right) \]
                    5. associate-*l*N/A

                      \[\leadsto -2 \cdot \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot c\right)} \]
                    6. associate-*l*N/A

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                    7. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                    8. *-commutativeN/A

                      \[\leadsto \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right)} \cdot c \]
                    9. lower-*.f64N/A

                      \[\leadsto \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right)} \cdot c \]
                    10. *-commutativeN/A

                      \[\leadsto \left(\color{blue}{\left(\left(c \cdot i\right) \cdot b\right)} \cdot -2\right) \cdot c \]
                    11. lower-*.f64N/A

                      \[\leadsto \left(\color{blue}{\left(\left(c \cdot i\right) \cdot b\right)} \cdot -2\right) \cdot c \]
                    12. *-commutativeN/A

                      \[\leadsto \left(\left(\color{blue}{\left(i \cdot c\right)} \cdot b\right) \cdot -2\right) \cdot c \]
                    13. lower-*.f6474.1

                      \[\leadsto \left(\left(\color{blue}{\left(i \cdot c\right)} \cdot b\right) \cdot -2\right) \cdot c \]
                  5. Applied rewrites74.1%

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

                      \[\leadsto \left(\left(\left(i \cdot b\right) \cdot c\right) \cdot -2\right) \cdot c \]

                    if -1.9999999999999999e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999983e156

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

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

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

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

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

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

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

                    if 9.99999999999999983e156 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                    1. Initial program 80.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 b around inf

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

                        \[\leadsto -2 \cdot \left(b \cdot \color{blue}{\left(i \cdot {c}^{2}\right)}\right) \]
                      2. unpow2N/A

                        \[\leadsto -2 \cdot \left(b \cdot \left(i \cdot \color{blue}{\left(c \cdot c\right)}\right)\right) \]
                      3. associate-*r*N/A

                        \[\leadsto -2 \cdot \left(b \cdot \color{blue}{\left(\left(i \cdot c\right) \cdot c\right)}\right) \]
                      4. *-commutativeN/A

                        \[\leadsto -2 \cdot \left(b \cdot \left(\color{blue}{\left(c \cdot i\right)} \cdot c\right)\right) \]
                      5. associate-*l*N/A

                        \[\leadsto -2 \cdot \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot c\right)} \]
                      6. associate-*l*N/A

                        \[\leadsto \color{blue}{\left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                      7. lower-*.f64N/A

                        \[\leadsto \color{blue}{\left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                      8. *-commutativeN/A

                        \[\leadsto \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right)} \cdot c \]
                      9. lower-*.f64N/A

                        \[\leadsto \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right)} \cdot c \]
                      10. *-commutativeN/A

                        \[\leadsto \left(\color{blue}{\left(\left(c \cdot i\right) \cdot b\right)} \cdot -2\right) \cdot c \]
                      11. lower-*.f64N/A

                        \[\leadsto \left(\color{blue}{\left(\left(c \cdot i\right) \cdot b\right)} \cdot -2\right) \cdot c \]
                      12. *-commutativeN/A

                        \[\leadsto \left(\left(\color{blue}{\left(i \cdot c\right)} \cdot b\right) \cdot -2\right) \cdot c \]
                      13. lower-*.f6464.3

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

                      \[\leadsto \color{blue}{\left(\left(\left(i \cdot c\right) \cdot b\right) \cdot -2\right) \cdot c} \]
                    6. Step-by-step derivation
                      1. Applied rewrites63.0%

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

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

                    Alternative 9: 73.3% accurate, 0.6× speedup?

                    \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := \left(\left(-2 \cdot b\right) \cdot c\right) \cdot \left(i \cdot c\right)\\ t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+304}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 10^{+157}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 b) c) (* i c))) (t_2 (* i (* (+ (* c b) a) c))))
                       (if (<= t_2 -2e+304)
                         t_1
                         (if (<= t_2 1e+157) (* (fma t z (* y x)) 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 * b) * c) * (i * c);
                    	double t_2 = i * (((c * b) + a) * c);
                    	double tmp;
                    	if (t_2 <= -2e+304) {
                    		tmp = t_1;
                    	} else if (t_2 <= 1e+157) {
                    		tmp = fma(t, z, (y * x)) * 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(Float64(Float64(-2.0 * b) * c) * Float64(i * c))
                    	t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
                    	tmp = 0.0
                    	if (t_2 <= -2e+304)
                    		tmp = t_1;
                    	elseif (t_2 <= 1e+157)
                    		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
                    	else
                    		tmp = t_1;
                    	end
                    	return tmp
                    end
                    
                    NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                    code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(-2.0 * b), $MachinePrecision] * c), $MachinePrecision] * N[(i * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+304], t$95$1, If[LessEqual[t$95$2, 1e+157], N[(N[(t * z + N[(y * x), $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 := \left(\left(-2 \cdot b\right) \cdot c\right) \cdot \left(i \cdot c\right)\\
                    t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                    \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+304}:\\
                    \;\;\;\;t\_1\\
                    
                    \mathbf{elif}\;t\_2 \leq 10^{+157}:\\
                    \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_1\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.9999999999999999e304 or 9.99999999999999983e156 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                      1. Initial program 81.0%

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

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

                          \[\leadsto -2 \cdot \left(b \cdot \color{blue}{\left(i \cdot {c}^{2}\right)}\right) \]
                        2. unpow2N/A

                          \[\leadsto -2 \cdot \left(b \cdot \left(i \cdot \color{blue}{\left(c \cdot c\right)}\right)\right) \]
                        3. associate-*r*N/A

                          \[\leadsto -2 \cdot \left(b \cdot \color{blue}{\left(\left(i \cdot c\right) \cdot c\right)}\right) \]
                        4. *-commutativeN/A

                          \[\leadsto -2 \cdot \left(b \cdot \left(\color{blue}{\left(c \cdot i\right)} \cdot c\right)\right) \]
                        5. associate-*l*N/A

                          \[\leadsto -2 \cdot \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot c\right)} \]
                        6. associate-*l*N/A

                          \[\leadsto \color{blue}{\left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                        7. lower-*.f64N/A

                          \[\leadsto \color{blue}{\left(-2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                        8. *-commutativeN/A

                          \[\leadsto \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right)} \cdot c \]
                        9. lower-*.f64N/A

                          \[\leadsto \color{blue}{\left(\left(b \cdot \left(c \cdot i\right)\right) \cdot -2\right)} \cdot c \]
                        10. *-commutativeN/A

                          \[\leadsto \left(\color{blue}{\left(\left(c \cdot i\right) \cdot b\right)} \cdot -2\right) \cdot c \]
                        11. lower-*.f64N/A

                          \[\leadsto \left(\color{blue}{\left(\left(c \cdot i\right) \cdot b\right)} \cdot -2\right) \cdot c \]
                        12. *-commutativeN/A

                          \[\leadsto \left(\left(\color{blue}{\left(i \cdot c\right)} \cdot b\right) \cdot -2\right) \cdot c \]
                        13. lower-*.f6468.1

                          \[\leadsto \left(\left(\color{blue}{\left(i \cdot c\right)} \cdot b\right) \cdot -2\right) \cdot c \]
                      5. Applied rewrites68.1%

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

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

                        if -1.9999999999999999e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999983e156

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

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

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

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

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

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

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

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

                      Alternative 10: 62.4% 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(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+106}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+214}:\\ \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\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 (* (* (* i c) a) -2.0)) (t_2 (* i (* (+ (* c b) a) c))))
                         (if (<= t_2 -1e+106)
                           t_1
                           (if (<= t_2 2e+214) (* (fma t z (* y x)) 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 = ((i * c) * a) * -2.0;
                      	double t_2 = i * (((c * b) + a) * c);
                      	double tmp;
                      	if (t_2 <= -1e+106) {
                      		tmp = t_1;
                      	} else if (t_2 <= 2e+214) {
                      		tmp = fma(t, z, (y * x)) * 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(Float64(Float64(i * c) * a) * -2.0)
                      	t_2 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
                      	tmp = 0.0
                      	if (t_2 <= -1e+106)
                      		tmp = t_1;
                      	elseif (t_2 <= 2e+214)
                      		tmp = Float64(fma(t, z, Float64(y * x)) * 2.0);
                      	else
                      		tmp = t_1;
                      	end
                      	return tmp
                      end
                      
                      NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * c), $MachinePrecision] * a), $MachinePrecision] * -2.0), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+106], t$95$1, If[LessEqual[t$95$2, 2e+214], N[(N[(t * z + N[(y * x), $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 := \left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
                      t_2 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                      \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+106}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+214}:\\
                      \;\;\;\;\mathsf{fma}\left(t, z, y \cdot x\right) \cdot 2\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.00000000000000009e106 or 1.9999999999999999e214 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                        1. Initial program 83.4%

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

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

                            \[\leadsto \color{blue}{\left(a \cdot \left(c \cdot i\right)\right) \cdot -2} \]
                          2. lower-*.f64N/A

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

                            \[\leadsto \color{blue}{\left(\left(c \cdot i\right) \cdot a\right)} \cdot -2 \]
                          4. lower-*.f64N/A

                            \[\leadsto \color{blue}{\left(\left(c \cdot i\right) \cdot a\right)} \cdot -2 \]
                          5. *-commutativeN/A

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

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

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

                        if -1.00000000000000009e106 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.9999999999999999e214

                        1. Initial program 98.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 c around 0

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

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

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

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

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

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

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

                      Alternative 11: 92.9% accurate, 0.6× speedup?

                      \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\ \mathbf{if}\;t\_1 \leq 2 \cdot 10^{+296}:\\ \;\;\;\;2 \cdot \left(\left(y \cdot x + t \cdot z\right) - t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\ \end{array} \end{array} \]
                      NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                      (FPCore (x y z t a b c i)
                       :precision binary64
                       (let* ((t_1 (* i (* (+ (* c b) a) c))))
                         (if (<= t_1 2e+296)
                           (* 2.0 (- (+ (* y x) (* t z)) t_1))
                           (* (* (* (fma c b a) i) -2.0) c))))
                      assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	double t_1 = i * (((c * b) + a) * c);
                      	double tmp;
                      	if (t_1 <= 2e+296) {
                      		tmp = 2.0 * (((y * x) + (t * z)) - t_1);
                      	} else {
                      		tmp = ((fma(c, b, a) * i) * -2.0) * c;
                      	}
                      	return tmp;
                      }
                      
                      x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i])
                      function code(x, y, z, t, a, b, c, i)
                      	t_1 = Float64(i * Float64(Float64(Float64(c * b) + a) * c))
                      	tmp = 0.0
                      	if (t_1 <= 2e+296)
                      		tmp = Float64(2.0 * Float64(Float64(Float64(y * x) + Float64(t * z)) - t_1));
                      	else
                      		tmp = Float64(Float64(Float64(fma(c, b, a) * i) * -2.0) * c);
                      	end
                      	return tmp
                      end
                      
                      NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
                      code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(i * N[(N[(N[(c * b), $MachinePrecision] + a), $MachinePrecision] * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+296], N[(2.0 * N[(N[(N[(y * x), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(c * b + a), $MachinePrecision] * i), $MachinePrecision] * -2.0), $MachinePrecision] * c), $MachinePrecision]]]
                      
                      \begin{array}{l}
                      [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                      \\
                      \begin{array}{l}
                      t_1 := i \cdot \left(\left(c \cdot b + a\right) \cdot c\right)\\
                      \mathbf{if}\;t\_1 \leq 2 \cdot 10^{+296}:\\
                      \;\;\;\;2 \cdot \left(\left(y \cdot x + t \cdot z\right) - t\_1\right)\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;\left(\left(\mathsf{fma}\left(c, b, a\right) \cdot i\right) \cdot -2\right) \cdot c\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.99999999999999996e296

                        1. Initial program 95.0%

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

                        if 1.99999999999999996e296 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

                        1. Initial program 78.4%

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

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

                            \[\leadsto -2 \cdot \color{blue}{\left(\left(i \cdot \left(a + b \cdot c\right)\right) \cdot c\right)} \]
                          2. associate-*r*N/A

                            \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) \cdot c} \]
                          3. distribute-rgt-inN/A

                            \[\leadsto \left(-2 \cdot \color{blue}{\left(a \cdot i + \left(b \cdot c\right) \cdot i\right)}\right) \cdot c \]
                          4. associate-*r*N/A

                            \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right) \cdot c \]
                          5. distribute-lft-outN/A

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

                            \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i\right) + -2 \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot c} \]
                          7. distribute-lft-outN/A

                            \[\leadsto \color{blue}{\left(-2 \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)} \cdot c \]
                          8. associate-*r*N/A

                            \[\leadsto \left(-2 \cdot \left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right)\right) \cdot c \]
                          9. distribute-rgt-inN/A

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

                            \[\leadsto \color{blue}{\left(-2 \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \cdot c \]
                          11. *-commutativeN/A

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

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

                            \[\leadsto \left(-2 \cdot \left(\color{blue}{\left(b \cdot c + a\right)} \cdot i\right)\right) \cdot c \]
                          14. *-commutativeN/A

                            \[\leadsto \left(-2 \cdot \left(\left(\color{blue}{c \cdot b} + a\right) \cdot i\right)\right) \cdot c \]
                          15. lower-fma.f6494.5

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

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

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

                      Alternative 12: 42.2% accurate, 0.8× speedup?

                      \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := 2 \cdot \left(t \cdot z\right)\\ \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 10^{-319}:\\ \;\;\;\;\left(y \cdot x\right) \cdot 2\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+214}:\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\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 (* t z))))
                         (if (<= (* t z) -1e+25)
                           t_1
                           (if (<= (* t z) 1e-319)
                             (* (* y x) 2.0)
                             (if (<= (* t z) 2e+214) (* (* (* i c) a) -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 * (t * z);
                      	double tmp;
                      	if ((t * z) <= -1e+25) {
                      		tmp = t_1;
                      	} else if ((t * z) <= 1e-319) {
                      		tmp = (y * x) * 2.0;
                      	} else if ((t * z) <= 2e+214) {
                      		tmp = ((i * c) * a) * -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 * (t * z)
                          if ((t * z) <= (-1d+25)) then
                              tmp = t_1
                          else if ((t * z) <= 1d-319) then
                              tmp = (y * x) * 2.0d0
                          else if ((t * z) <= 2d+214) then
                              tmp = ((i * c) * a) * (-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 * (t * z);
                      	double tmp;
                      	if ((t * z) <= -1e+25) {
                      		tmp = t_1;
                      	} else if ((t * z) <= 1e-319) {
                      		tmp = (y * x) * 2.0;
                      	} else if ((t * z) <= 2e+214) {
                      		tmp = ((i * c) * a) * -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 * (t * z)
                      	tmp = 0
                      	if (t * z) <= -1e+25:
                      		tmp = t_1
                      	elif (t * z) <= 1e-319:
                      		tmp = (y * x) * 2.0
                      	elif (t * z) <= 2e+214:
                      		tmp = ((i * c) * a) * -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(t * z))
                      	tmp = 0.0
                      	if (Float64(t * z) <= -1e+25)
                      		tmp = t_1;
                      	elseif (Float64(t * z) <= 1e-319)
                      		tmp = Float64(Float64(y * x) * 2.0);
                      	elseif (Float64(t * z) <= 2e+214)
                      		tmp = Float64(Float64(Float64(i * c) * a) * -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 * (t * z);
                      	tmp = 0.0;
                      	if ((t * z) <= -1e+25)
                      		tmp = t_1;
                      	elseif ((t * z) <= 1e-319)
                      		tmp = (y * x) * 2.0;
                      	elseif ((t * z) <= 2e+214)
                      		tmp = ((i * c) * a) * -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[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -1e+25], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 1e-319], N[(N[(y * x), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(t * z), $MachinePrecision], 2e+214], N[(N[(N[(i * c), $MachinePrecision] * a), $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(t \cdot z\right)\\
                      \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+25}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;t \cdot z \leq 10^{-319}:\\
                      \;\;\;\;\left(y \cdot x\right) \cdot 2\\
                      
                      \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+214}:\\
                      \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 3 regimes
                      2. if (*.f64 z t) < -1.00000000000000009e25 or 1.9999999999999999e214 < (*.f64 z t)

                        1. Initial program 89.2%

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

                          \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
                        4. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
                          2. lower-*.f6467.4

                            \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
                        5. Applied rewrites67.4%

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

                        if -1.00000000000000009e25 < (*.f64 z t) < 9.99989e-320

                        1. Initial program 93.4%

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

                          \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
                        4. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
                          2. *-commutativeN/A

                            \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
                          3. lower-*.f6446.5

                            \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
                        5. Applied rewrites46.5%

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

                        if 9.99989e-320 < (*.f64 z t) < 1.9999999999999999e214

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

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

                            \[\leadsto \color{blue}{\left(a \cdot \left(c \cdot i\right)\right) \cdot -2} \]
                          2. lower-*.f64N/A

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

                            \[\leadsto \color{blue}{\left(\left(c \cdot i\right) \cdot a\right)} \cdot -2 \]
                          4. lower-*.f64N/A

                            \[\leadsto \color{blue}{\left(\left(c \cdot i\right) \cdot a\right)} \cdot -2 \]
                          5. *-commutativeN/A

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+25}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \mathbf{elif}\;t \cdot z \leq 10^{-319}:\\ \;\;\;\;\left(y \cdot x\right) \cdot 2\\ \mathbf{elif}\;t \cdot z \leq 2 \cdot 10^{+214}:\\ \;\;\;\;\left(\left(i \cdot c\right) \cdot a\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot z\right)\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 13: 44.6% accurate, 1.2× speedup?

                      \[\begin{array}{l} [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\ \\ \begin{array}{l} t_1 := 2 \cdot \left(t \cdot z\right)\\ \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+25}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+67}:\\ \;\;\;\;\left(y \cdot x\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 (* t z))))
                         (if (<= (* t z) -1e+25) t_1 (if (<= (* t z) 5e+67) (* (* y x) 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 * (t * z);
                      	double tmp;
                      	if ((t * z) <= -1e+25) {
                      		tmp = t_1;
                      	} else if ((t * z) <= 5e+67) {
                      		tmp = (y * x) * 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 * (t * z)
                          if ((t * z) <= (-1d+25)) then
                              tmp = t_1
                          else if ((t * z) <= 5d+67) then
                              tmp = (y * x) * 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 * (t * z);
                      	double tmp;
                      	if ((t * z) <= -1e+25) {
                      		tmp = t_1;
                      	} else if ((t * z) <= 5e+67) {
                      		tmp = (y * x) * 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 * (t * z)
                      	tmp = 0
                      	if (t * z) <= -1e+25:
                      		tmp = t_1
                      	elif (t * z) <= 5e+67:
                      		tmp = (y * x) * 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(t * z))
                      	tmp = 0.0
                      	if (Float64(t * z) <= -1e+25)
                      		tmp = t_1;
                      	elseif (Float64(t * z) <= 5e+67)
                      		tmp = Float64(Float64(y * x) * 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 * (t * z);
                      	tmp = 0.0;
                      	if ((t * z) <= -1e+25)
                      		tmp = t_1;
                      	elseif ((t * z) <= 5e+67)
                      		tmp = (y * x) * 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[(t * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t * z), $MachinePrecision], -1e+25], t$95$1, If[LessEqual[N[(t * z), $MachinePrecision], 5e+67], N[(N[(y * x), $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(t \cdot z\right)\\
                      \mathbf{if}\;t \cdot z \leq -1 \cdot 10^{+25}:\\
                      \;\;\;\;t\_1\\
                      
                      \mathbf{elif}\;t \cdot z \leq 5 \cdot 10^{+67}:\\
                      \;\;\;\;\left(y \cdot x\right) \cdot 2\\
                      
                      \mathbf{else}:\\
                      \;\;\;\;t\_1\\
                      
                      
                      \end{array}
                      \end{array}
                      
                      Derivation
                      1. Split input into 2 regimes
                      2. if (*.f64 z t) < -1.00000000000000009e25 or 4.99999999999999976e67 < (*.f64 z t)

                        1. Initial program 89.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

                          \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
                        4. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
                          2. lower-*.f6462.9

                            \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
                        5. Applied rewrites62.9%

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

                        if -1.00000000000000009e25 < (*.f64 z t) < 4.99999999999999976e67

                        1. Initial program 93.1%

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

                          \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
                        4. Step-by-step derivation
                          1. lower-*.f64N/A

                            \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
                          2. *-commutativeN/A

                            \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
                          3. lower-*.f6437.6

                            \[\leadsto 2 \cdot \color{blue}{\left(y \cdot x\right)} \]
                        5. Applied rewrites37.6%

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

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

                      Alternative 14: 29.2% accurate, 3.6× 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(t \cdot z\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 (* t z)))
                      assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
                      double code(double x, double y, double z, double t, double a, double b, double c, double i) {
                      	return 2.0 * (t * z);
                      }
                      
                      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 * (t * z)
                      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 * (t * z);
                      }
                      
                      [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 * (t * z)
                      
                      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(t * z))
                      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 * (t * z);
                      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[(t * z), $MachinePrecision]), $MachinePrecision]
                      
                      \begin{array}{l}
                      [x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
                      \\
                      2 \cdot \left(t \cdot z\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 91.5%

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

                        \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
                      4. Step-by-step derivation
                        1. lower-*.f64N/A

                          \[\leadsto \color{blue}{2 \cdot \left(t \cdot z\right)} \]
                        2. lower-*.f6432.4

                          \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
                      5. Applied rewrites32.4%

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

                      Developer Target 1: 94.3% 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 2024327 
                      (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
                        (! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))
                      
                        (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))