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

Percentage Accurate: 90.0% → 97.1%
Time: 16.6s
Alternatives: 15
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 90.0% accurate, 1.0× speedup?

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

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

Alternative 1: 97.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ t_2 := x \cdot y + z \cdot t\\ \mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\ \;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t \cdot \left(z - c \cdot \frac{i \cdot \mathsf{fma}\left(c, b, a\right)}{t}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
   (if (<= (- t_2 (* (* c t_1) i)) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 2.0 (* t (- z (* c (/ (* i (fma c b a)) t))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (t * (z - (c * ((i * fma(c, b, a)) / t))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(t * Float64(z - Float64(c * Float64(Float64(i * fma(c, b, a)) / t)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * N[(z - N[(c * N[(N[(i * N[(c * b + a), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\

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


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

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot \left(z + -1 \cdot \frac{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}{t}\right)\right)} \]
    5. Step-by-step derivation
      1. mul-1-neg66.7%

        \[\leadsto 2 \cdot \left(t \cdot \left(z + \color{blue}{\left(-\frac{c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)}{t}\right)}\right)\right) \]
      2. unsub-neg66.7%

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

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

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

        \[\leadsto 2 \cdot \left(t \cdot \left(z - c \cdot \frac{i \cdot \left(\color{blue}{c \cdot b} + a\right)}{t}\right)\right) \]
      6. fma-define76.2%

        \[\leadsto 2 \cdot \left(t \cdot \left(z - c \cdot \frac{i \cdot \color{blue}{\mathsf{fma}\left(c, b, a\right)}}{t}\right)\right) \]
    6. Simplified76.2%

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

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

Alternative 2: 82.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\ t_2 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\ t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\ \mathbf{if}\;x \cdot y \leq -\infty:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+38}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-5}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-29}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+91}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (* y (- x (/ (* c (* (* b c) i)) y)))))
        (t_2 (* c (* (+ a (* b c)) i)))
        (t_3 (* 2.0 (- (* x y) t_2))))
   (if (<= (* x y) (- INFINITY))
     t_1
     (if (<= (* x y) -1e+38)
       t_3
       (if (<= (* x y) -5e-5)
         (* (+ (* x y) (* z t)) 2.0)
         (if (<= (* x y) -1e-29)
           t_3
           (if (<= (* x y) 2e+91) (* 2.0 (- (* z t) t_2)) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
	double t_2 = c * ((a + (b * c)) * i);
	double t_3 = 2.0 * ((x * y) - t_2);
	double tmp;
	if ((x * y) <= -((double) INFINITY)) {
		tmp = t_1;
	} else if ((x * y) <= -1e+38) {
		tmp = t_3;
	} else if ((x * y) <= -5e-5) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if ((x * y) <= -1e-29) {
		tmp = t_3;
	} else if ((x * y) <= 2e+91) {
		tmp = 2.0 * ((z * t) - t_2);
	} else {
		tmp = t_1;
	}
	return tmp;
}
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 * (y * (x - ((c * ((b * c) * i)) / y)));
	double t_2 = c * ((a + (b * c)) * i);
	double t_3 = 2.0 * ((x * y) - t_2);
	double tmp;
	if ((x * y) <= -Double.POSITIVE_INFINITY) {
		tmp = t_1;
	} else if ((x * y) <= -1e+38) {
		tmp = t_3;
	} else if ((x * y) <= -5e-5) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if ((x * y) <= -1e-29) {
		tmp = t_3;
	} else if ((x * y) <= 2e+91) {
		tmp = 2.0 * ((z * t) - t_2);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)))
	t_2 = c * ((a + (b * c)) * i)
	t_3 = 2.0 * ((x * y) - t_2)
	tmp = 0
	if (x * y) <= -math.inf:
		tmp = t_1
	elif (x * y) <= -1e+38:
		tmp = t_3
	elif (x * y) <= -5e-5:
		tmp = ((x * y) + (z * t)) * 2.0
	elif (x * y) <= -1e-29:
		tmp = t_3
	elif (x * y) <= 2e+91:
		tmp = 2.0 * ((z * t) - t_2)
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(Float64(b * c) * i)) / y))))
	t_2 = Float64(c * Float64(Float64(a + Float64(b * c)) * i))
	t_3 = Float64(2.0 * Float64(Float64(x * y) - t_2))
	tmp = 0.0
	if (Float64(x * y) <= Float64(-Inf))
		tmp = t_1;
	elseif (Float64(x * y) <= -1e+38)
		tmp = t_3;
	elseif (Float64(x * y) <= -5e-5)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	elseif (Float64(x * y) <= -1e-29)
		tmp = t_3;
	elseif (Float64(x * y) <= 2e+91)
		tmp = Float64(2.0 * Float64(Float64(z * t) - t_2));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
	t_2 = c * ((a + (b * c)) * i);
	t_3 = 2.0 * ((x * y) - t_2);
	tmp = 0.0;
	if ((x * y) <= -Inf)
		tmp = t_1;
	elseif ((x * y) <= -1e+38)
		tmp = t_3;
	elseif ((x * y) <= -5e-5)
		tmp = ((x * y) + (z * t)) * 2.0;
	elseif ((x * y) <= -1e-29)
		tmp = t_3;
	elseif ((x * y) <= 2e+91)
		tmp = 2.0 * ((z * t) - t_2);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(y * N[(x - N[(N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], (-Infinity)], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e+38], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -5e-5], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-29], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], 2e+91], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\
t_2 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{if}\;x \cdot y \leq -\infty:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+38}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-29}:\\
\;\;\;\;t\_3\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -inf.0 or 2.00000000000000016e91 < (*.f64 x y)

    1. Initial program 77.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 y around inf 88.6%

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

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

      \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(b \cdot \left(c \cdot i\right)\right)}}{y}\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*84.6%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(\left(b \cdot c\right) \cdot i\right)}}{y}\right)\right) \]
      2. *-commutative84.6%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(i \cdot \left(b \cdot c\right)\right)}}{y}\right)\right) \]
      3. *-commutative84.6%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(i \cdot \color{blue}{\left(c \cdot b\right)}\right)}{y}\right)\right) \]
    7. Simplified84.6%

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

    if -inf.0 < (*.f64 x y) < -9.99999999999999977e37 or -5.00000000000000024e-5 < (*.f64 x y) < -9.99999999999999943e-30

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

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

    if -9.99999999999999977e37 < (*.f64 x y) < -5.00000000000000024e-5

    1. Initial program 75.3%

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

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

    if -9.99999999999999943e-30 < (*.f64 x y) < 2.00000000000000016e91

    1. Initial program 91.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 x around 0 85.4%

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

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

Alternative 3: 94.5% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ t_2 := \left(c \cdot t\_1\right) \cdot i\\ \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+268}:\\ \;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(t\_1 \cdot i\right)}{y}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
   (if (<= t_2 (- INFINITY))
     (* 2.0 (* c (* t_1 (- i))))
     (if (<= t_2 5e+268)
       (* (- (+ (* x y) (* z t)) t_2) 2.0)
       (* 2.0 (* y (- x (/ (* c (* t_1 i)) y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (c * t_1) * i;
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = 2.0 * (c * (t_1 * -i));
	} else if (t_2 <= 5e+268) {
		tmp = (((x * y) + (z * t)) - t_2) * 2.0;
	} else {
		tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (c * t_1) * i;
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (c * (t_1 * -i));
	} else if (t_2 <= 5e+268) {
		tmp = (((x * y) + (z * t)) - t_2) * 2.0;
	} else {
		tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = (c * t_1) * i
	tmp = 0
	if t_2 <= -math.inf:
		tmp = 2.0 * (c * (t_1 * -i))
	elif t_2 <= 5e+268:
		tmp = (((x * y) + (z * t)) - t_2) * 2.0
	else:
		tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(Float64(c * t_1) * i)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-i))));
	elseif (t_2 <= 5e+268)
		tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0);
	else
		tmp = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(t_1 * i)) / y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = (c * t_1) * i;
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = 2.0 * (c * (t_1 * -i));
	elseif (t_2 <= 5e+268)
		tmp = (((x * y) + (z * t)) - t_2) * 2.0;
	else
		tmp = 2.0 * (y * (x - ((c * (t_1 * i)) / y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+268], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(y * N[(x - N[(N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t\_1 \cdot \left(-i\right)\right)\right)\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+268}:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\

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


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

    1. Initial program 69.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 92.8%

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000002e268

    1. Initial program 98.0%

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

    if 5.0000000000000002e268 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 68.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 y around inf 80.7%

      \[\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. Taylor expanded in t around 0 80.9%

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

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

Alternative 4: 80.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ t_2 := 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\ \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+176}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+60}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -40000000000000:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i)))))
        (t_2 (* 2.0 (* y (- x (/ (* c (* (* b c) i)) y))))))
   (if (<= (* x y) -5e+176)
     t_2
     (if (<= (* x y) -2e+60)
       t_1
       (if (<= (* x y) -40000000000000.0)
         (* (+ (* x y) (* z t)) 2.0)
         (if (<= (* x y) 2e+91) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
	double t_2 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
	double tmp;
	if ((x * y) <= -5e+176) {
		tmp = t_2;
	} else if ((x * y) <= -2e+60) {
		tmp = t_1;
	} else if ((x * y) <= -40000000000000.0) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if ((x * y) <= 2e+91) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
    t_2 = 2.0d0 * (y * (x - ((c * ((b * c) * i)) / y)))
    if ((x * y) <= (-5d+176)) then
        tmp = t_2
    else if ((x * y) <= (-2d+60)) then
        tmp = t_1
    else if ((x * y) <= (-40000000000000.0d0)) then
        tmp = ((x * y) + (z * t)) * 2.0d0
    else if ((x * y) <= 2d+91) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
	double t_2 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
	double tmp;
	if ((x * y) <= -5e+176) {
		tmp = t_2;
	} else if ((x * y) <= -2e+60) {
		tmp = t_1;
	} else if ((x * y) <= -40000000000000.0) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if ((x * y) <= 2e+91) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)))
	t_2 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)))
	tmp = 0
	if (x * y) <= -5e+176:
		tmp = t_2
	elif (x * y) <= -2e+60:
		tmp = t_1
	elif (x * y) <= -40000000000000.0:
		tmp = ((x * y) + (z * t)) * 2.0
	elif (x * y) <= 2e+91:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i))))
	t_2 = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(Float64(b * c) * i)) / y))))
	tmp = 0.0
	if (Float64(x * y) <= -5e+176)
		tmp = t_2;
	elseif (Float64(x * y) <= -2e+60)
		tmp = t_1;
	elseif (Float64(x * y) <= -40000000000000.0)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	elseif (Float64(x * y) <= 2e+91)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
	t_2 = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
	tmp = 0.0;
	if ((x * y) <= -5e+176)
		tmp = t_2;
	elseif ((x * y) <= -2e+60)
		tmp = t_1;
	elseif ((x * y) <= -40000000000000.0)
		tmp = ((x * y) + (z * t)) * 2.0;
	elseif ((x * y) <= 2e+91)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(y * N[(x - N[(N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+176], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2e+60], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -40000000000000.0], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+91], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\
t_2 := 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+176}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -40000000000000:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5e176 or 2.00000000000000016e91 < (*.f64 x y)

    1. Initial program 78.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 y around inf 90.5%

      \[\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. Taylor expanded in t around 0 82.7%

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

      \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(b \cdot \left(c \cdot i\right)\right)}}{y}\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*82.9%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(\left(b \cdot c\right) \cdot i\right)}}{y}\right)\right) \]
      2. *-commutative82.9%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(i \cdot \left(b \cdot c\right)\right)}}{y}\right)\right) \]
      3. *-commutative82.9%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(i \cdot \color{blue}{\left(c \cdot b\right)}\right)}{y}\right)\right) \]
    7. Simplified82.9%

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

    if -5e176 < (*.f64 x y) < -1.9999999999999999e60 or -4e13 < (*.f64 x y) < 2.00000000000000016e91

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

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

    if -1.9999999999999999e60 < (*.f64 x y) < -4e13

    1. Initial program 75.3%

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

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

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

Alternative 5: 42.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+167}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq -3.3 \cdot 10^{+17}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{-35}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq -1.2 \cdot 10^{-287}:\\ \;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+91}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (* z t))) (t_2 (* (* x y) 2.0)))
   (if (<= (* x y) -5.8e+167)
     t_2
     (if (<= (* x y) -3.3e+17)
       t_1
       (if (<= (* x y) -2.5e-35)
         t_2
         (if (<= (* x y) -1.2e-287)
           (* (* i (* a c)) -2.0)
           (if (<= (* x y) 3.2e+91) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (z * t);
	double t_2 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -5.8e+167) {
		tmp = t_2;
	} else if ((x * y) <= -3.3e+17) {
		tmp = t_1;
	} else if ((x * y) <= -2.5e-35) {
		tmp = t_2;
	} else if ((x * y) <= -1.2e-287) {
		tmp = (i * (a * c)) * -2.0;
	} else if ((x * y) <= 3.2e+91) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * (z * t)
    t_2 = (x * y) * 2.0d0
    if ((x * y) <= (-5.8d+167)) then
        tmp = t_2
    else if ((x * y) <= (-3.3d+17)) then
        tmp = t_1
    else if ((x * y) <= (-2.5d-35)) then
        tmp = t_2
    else if ((x * y) <= (-1.2d-287)) then
        tmp = (i * (a * c)) * (-2.0d0)
    else if ((x * y) <= 3.2d+91) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (z * t);
	double t_2 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -5.8e+167) {
		tmp = t_2;
	} else if ((x * y) <= -3.3e+17) {
		tmp = t_1;
	} else if ((x * y) <= -2.5e-35) {
		tmp = t_2;
	} else if ((x * y) <= -1.2e-287) {
		tmp = (i * (a * c)) * -2.0;
	} else if ((x * y) <= 3.2e+91) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (z * t)
	t_2 = (x * y) * 2.0
	tmp = 0
	if (x * y) <= -5.8e+167:
		tmp = t_2
	elif (x * y) <= -3.3e+17:
		tmp = t_1
	elif (x * y) <= -2.5e-35:
		tmp = t_2
	elif (x * y) <= -1.2e-287:
		tmp = (i * (a * c)) * -2.0
	elif (x * y) <= 3.2e+91:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(z * t))
	t_2 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (Float64(x * y) <= -5.8e+167)
		tmp = t_2;
	elseif (Float64(x * y) <= -3.3e+17)
		tmp = t_1;
	elseif (Float64(x * y) <= -2.5e-35)
		tmp = t_2;
	elseif (Float64(x * y) <= -1.2e-287)
		tmp = Float64(Float64(i * Float64(a * c)) * -2.0);
	elseif (Float64(x * y) <= 3.2e+91)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * (z * t);
	t_2 = (x * y) * 2.0;
	tmp = 0.0;
	if ((x * y) <= -5.8e+167)
		tmp = t_2;
	elseif ((x * y) <= -3.3e+17)
		tmp = t_1;
	elseif ((x * y) <= -2.5e-35)
		tmp = t_2;
	elseif ((x * y) <= -1.2e-287)
		tmp = (i * (a * c)) * -2.0;
	elseif ((x * y) <= 3.2e+91)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5.8e+167], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -3.3e+17], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -2.5e-35], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1.2e-287], N[(N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 3.2e+91], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := \left(x \cdot y\right) \cdot 2\\
\mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+167}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \cdot y \leq -3.3 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{-35}:\\
\;\;\;\;t\_2\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -5.79999999999999949e167 or -3.3e17 < (*.f64 x y) < -2.49999999999999982e-35 or 3.19999999999999989e91 < (*.f64 x y)

    1. Initial program 81.3%

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

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

    if -5.79999999999999949e167 < (*.f64 x y) < -3.3e17 or -1.2e-287 < (*.f64 x y) < 3.19999999999999989e91

    1. Initial program 88.3%

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

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

    if -2.49999999999999982e-35 < (*.f64 x y) < -1.2e-287

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5.8 \cdot 10^{+167}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq -3.3 \cdot 10^{+17}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -2.5 \cdot 10^{-35}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq -1.2 \cdot 10^{-287}:\\ \;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{+91}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 96.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ t_2 := x \cdot y + z \cdot t\\ \mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\ \;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
   (if (<= (- t_2 (* (* c t_1) i)) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 2.0 (* y (- x (/ (* c (* (* b c) i)) y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - ((c * t_1) * i)) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = (x * y) + (z * t)
	tmp = 0
	if (t_2 - ((c * t_1) * i)) <= math.inf:
		tmp = 2.0 * (t_2 - (t_1 * (c * i)))
	else:
		tmp = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(Float64(x * y) + Float64(z * t))
	tmp = 0.0
	if (Float64(t_2 - Float64(Float64(c * t_1) * i)) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(y * Float64(x - Float64(Float64(c * Float64(Float64(b * c) * i)) / y))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = (x * y) + (z * t);
	tmp = 0.0;
	if ((t_2 - ((c * t_1) * i)) <= Inf)
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	else
		tmp = 2.0 * (y * (x - ((c * ((b * c) * i)) / y)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x - N[(N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := x \cdot y + z \cdot t\\
\mathbf{if}\;t\_2 - \left(c \cdot t\_1\right) \cdot i \leq \infty:\\
\;\;\;\;2 \cdot \left(t\_2 - t\_1 \cdot \left(c \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(\left(b \cdot c\right) \cdot i\right)}{y}\right)\right)\\


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

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

      \[\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. Taylor expanded in t around 0 47.6%

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

      \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(b \cdot \left(c \cdot i\right)\right)}}{y}\right)\right) \]
    6. Step-by-step derivation
      1. associate-*r*61.9%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(\left(b \cdot c\right) \cdot i\right)}}{y}\right)\right) \]
      2. *-commutative61.9%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \color{blue}{\left(i \cdot \left(b \cdot c\right)\right)}}{y}\right)\right) \]
      3. *-commutative61.9%

        \[\leadsto 2 \cdot \left(y \cdot \left(x - \frac{c \cdot \left(i \cdot \color{blue}{\left(c \cdot b\right)}\right)}{y}\right)\right) \]
    7. Simplified61.9%

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

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

Alternative 7: 64.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+107}:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+38}:\\ \;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-29}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+163}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot \left(x + t \cdot \frac{z}{y}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* x y) -1e+107)
   (* 2.0 (* x (+ y (* t (/ z x)))))
   (if (<= (* x y) -1e+38)
     (* 2.0 (- (* x y) (* i (* a c))))
     (if (<= (* x y) -1e-29)
       (* (+ (* x y) (* z t)) 2.0)
       (if (<= (* x y) 4e+163)
         (* 2.0 (- (* z t) (* a (* c i))))
         (* 2.0 (* y (+ x (* t (/ z y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x * y) <= -1e+107) {
		tmp = 2.0 * (x * (y + (t * (z / x))));
	} else if ((x * y) <= -1e+38) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else if ((x * y) <= -1e-29) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if ((x * y) <= 4e+163) {
		tmp = 2.0 * ((z * t) - (a * (c * i)));
	} else {
		tmp = 2.0 * (y * (x + (t * (z / y))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((x * y) <= (-1d+107)) then
        tmp = 2.0d0 * (x * (y + (t * (z / x))))
    else if ((x * y) <= (-1d+38)) then
        tmp = 2.0d0 * ((x * y) - (i * (a * c)))
    else if ((x * y) <= (-1d-29)) then
        tmp = ((x * y) + (z * t)) * 2.0d0
    else if ((x * y) <= 4d+163) then
        tmp = 2.0d0 * ((z * t) - (a * (c * i)))
    else
        tmp = 2.0d0 * (y * (x + (t * (z / y))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x * y) <= -1e+107) {
		tmp = 2.0 * (x * (y + (t * (z / x))));
	} else if ((x * y) <= -1e+38) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else if ((x * y) <= -1e-29) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if ((x * y) <= 4e+163) {
		tmp = 2.0 * ((z * t) - (a * (c * i)));
	} else {
		tmp = 2.0 * (y * (x + (t * (z / y))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x * y) <= -1e+107:
		tmp = 2.0 * (x * (y + (t * (z / x))))
	elif (x * y) <= -1e+38:
		tmp = 2.0 * ((x * y) - (i * (a * c)))
	elif (x * y) <= -1e-29:
		tmp = ((x * y) + (z * t)) * 2.0
	elif (x * y) <= 4e+163:
		tmp = 2.0 * ((z * t) - (a * (c * i)))
	else:
		tmp = 2.0 * (y * (x + (t * (z / y))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(x * y) <= -1e+107)
		tmp = Float64(2.0 * Float64(x * Float64(y + Float64(t * Float64(z / x)))));
	elseif (Float64(x * y) <= -1e+38)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c))));
	elseif (Float64(x * y) <= -1e-29)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	elseif (Float64(x * y) <= 4e+163)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(y * Float64(x + Float64(t * Float64(z / y)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x * y) <= -1e+107)
		tmp = 2.0 * (x * (y + (t * (z / x))));
	elseif ((x * y) <= -1e+38)
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	elseif ((x * y) <= -1e-29)
		tmp = ((x * y) + (z * t)) * 2.0;
	elseif ((x * y) <= 4e+163)
		tmp = 2.0 * ((z * t) - (a * (c * i)));
	else
		tmp = 2.0 * (y * (x + (t * (z / y))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e+107], N[(2.0 * N[(x * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e+38], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -1e-29], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+163], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x + N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+107}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\

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

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

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+163}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if (*.f64 x y) < -9.9999999999999997e106

    1. Initial program 72.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 70.0%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(z \cdot \left(t + \frac{x \cdot y - \color{blue}{\left(a \cdot c\right) \cdot i}}{z}\right)\right) \]
      4. *-commutative57.0%

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

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

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

        \[\leadsto 2 \cdot \left(z \cdot \left(t + \color{blue}{x \cdot \frac{y}{z}}\right)\right) \]
    11. Simplified61.5%

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

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

        \[\leadsto 2 \cdot \left(x \cdot \left(y + \color{blue}{t \cdot \frac{z}{x}}\right)\right) \]
    14. Simplified77.0%

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

    if -9.9999999999999997e106 < (*.f64 x y) < -9.99999999999999977e37

    1. Initial program 90.9%

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

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

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

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

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

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

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

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

    if -9.99999999999999977e37 < (*.f64 x y) < -9.99999999999999943e-30

    1. Initial program 85.9%

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

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

    if -9.99999999999999943e-30 < (*.f64 x y) < 3.9999999999999998e163

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + -1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
      2. mul-1-neg67.0%

        \[\leadsto 2 \cdot \left(t \cdot z + \color{blue}{\left(-a \cdot \left(c \cdot i\right)\right)}\right) \]
      3. sub-neg67.0%

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

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

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

    if 3.9999999999999998e163 < (*.f64 x y)

    1. Initial program 80.3%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(z \cdot \left(t + \frac{x \cdot y - \color{blue}{\left(a \cdot c\right) \cdot i}}{z}\right)\right) \]
      4. *-commutative75.1%

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

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

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

        \[\leadsto 2 \cdot \left(z \cdot \left(t + \color{blue}{x \cdot \frac{y}{z}}\right)\right) \]
    11. Simplified77.9%

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

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

        \[\leadsto 2 \cdot \left(y \cdot \left(x + \color{blue}{t \cdot \frac{z}{y}}\right)\right) \]
    14. Simplified80.5%

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

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

Alternative 8: 36.5% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y\right) \cdot 2\\ t_2 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{if}\;c \leq -4.2 \cdot 10^{+30}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \leq -6.8 \cdot 10^{-267}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 2.45 \cdot 10^{-189}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{-49}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (* x y) 2.0)) (t_2 (* (* c i) (* a -2.0))))
   (if (<= c -4.2e+30)
     t_2
     (if (<= c -6.8e-267)
       t_1
       (if (<= c 2.45e-189) (* 2.0 (* z t)) (if (<= c 4.2e-49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) * 2.0;
	double t_2 = (c * i) * (a * -2.0);
	double tmp;
	if (c <= -4.2e+30) {
		tmp = t_2;
	} else if (c <= -6.8e-267) {
		tmp = t_1;
	} else if (c <= 2.45e-189) {
		tmp = 2.0 * (z * t);
	} else if (c <= 4.2e-49) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x * y) * 2.0d0
    t_2 = (c * i) * (a * (-2.0d0))
    if (c <= (-4.2d+30)) then
        tmp = t_2
    else if (c <= (-6.8d-267)) then
        tmp = t_1
    else if (c <= 2.45d-189) then
        tmp = 2.0d0 * (z * t)
    else if (c <= 4.2d-49) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) * 2.0;
	double t_2 = (c * i) * (a * -2.0);
	double tmp;
	if (c <= -4.2e+30) {
		tmp = t_2;
	} else if (c <= -6.8e-267) {
		tmp = t_1;
	} else if (c <= 2.45e-189) {
		tmp = 2.0 * (z * t);
	} else if (c <= 4.2e-49) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x * y) * 2.0
	t_2 = (c * i) * (a * -2.0)
	tmp = 0
	if c <= -4.2e+30:
		tmp = t_2
	elif c <= -6.8e-267:
		tmp = t_1
	elif c <= 2.45e-189:
		tmp = 2.0 * (z * t)
	elif c <= 4.2e-49:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(x * y) * 2.0)
	t_2 = Float64(Float64(c * i) * Float64(a * -2.0))
	tmp = 0.0
	if (c <= -4.2e+30)
		tmp = t_2;
	elseif (c <= -6.8e-267)
		tmp = t_1;
	elseif (c <= 2.45e-189)
		tmp = Float64(2.0 * Float64(z * t));
	elseif (c <= 4.2e-49)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = (x * y) * 2.0;
	t_2 = (c * i) * (a * -2.0);
	tmp = 0.0;
	if (c <= -4.2e+30)
		tmp = t_2;
	elseif (c <= -6.8e-267)
		tmp = t_1;
	elseif (c <= 2.45e-189)
		tmp = 2.0 * (z * t);
	elseif (c <= 4.2e-49)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.2e+30], t$95$2, If[LessEqual[c, -6.8e-267], t$95$1, If[LessEqual[c, 2.45e-189], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 4.2e-49], t$95$1, t$95$2]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(x \cdot y\right) \cdot 2\\
t_2 := \left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\
\mathbf{if}\;c \leq -4.2 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \leq -6.8 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;c \leq 4.2 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -4.2e30 or 4.1999999999999998e-49 < c

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2e30 < c < -6.80000000000000041e-267 or 2.4499999999999999e-189 < c < 4.1999999999999998e-49

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

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

    if -6.80000000000000041e-267 < c < 2.4499999999999999e-189

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.2 \cdot 10^{+30}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{elif}\;c \leq -6.8 \cdot 10^{-267}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;c \leq 2.45 \cdot 10^{-189}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{-49}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 73.7% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{if}\;c \leq -4.6 \cdot 10^{+27}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 2.15 \cdot 10^{-147}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 2.9 \cdot 10^{+57}:\\ \;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (* c (* (+ a (* b c)) (- i))))))
   (if (<= c -4.6e+27)
     t_1
     (if (<= c 2.15e-147)
       (* (+ (* x y) (* z t)) 2.0)
       (if (<= c 2.9e+57) (* 2.0 (- (* x y) (* i (* a c)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (c * ((a + (b * c)) * -i));
	double tmp;
	if (c <= -4.6e+27) {
		tmp = t_1;
	} else if (c <= 2.15e-147) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if (c <= 2.9e+57) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * (c * ((a + (b * c)) * -i))
    if (c <= (-4.6d+27)) then
        tmp = t_1
    else if (c <= 2.15d-147) then
        tmp = ((x * y) + (z * t)) * 2.0d0
    else if (c <= 2.9d+57) then
        tmp = 2.0d0 * ((x * y) - (i * (a * c)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (c * ((a + (b * c)) * -i));
	double tmp;
	if (c <= -4.6e+27) {
		tmp = t_1;
	} else if (c <= 2.15e-147) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if (c <= 2.9e+57) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (c * ((a + (b * c)) * -i))
	tmp = 0
	if c <= -4.6e+27:
		tmp = t_1
	elif c <= 2.15e-147:
		tmp = ((x * y) + (z * t)) * 2.0
	elif c <= 2.9e+57:
		tmp = 2.0 * ((x * y) - (i * (a * c)))
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i))))
	tmp = 0.0
	if (c <= -4.6e+27)
		tmp = t_1;
	elseif (c <= 2.15e-147)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	elseif (c <= 2.9e+57)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c))));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * (c * ((a + (b * c)) * -i));
	tmp = 0.0;
	if (c <= -4.6e+27)
		tmp = t_1;
	elseif (c <= 2.15e-147)
		tmp = ((x * y) + (z * t)) * 2.0;
	elseif (c <= 2.9e+57)
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.6e+27], t$95$1, If[LessEqual[c, 2.15e-147], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 2.9e+57], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\
\mathbf{if}\;c \leq -4.6 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -4.6000000000000001e27 or 2.9000000000000002e57 < c

    1. Initial program 74.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 80.9%

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

    if -4.6000000000000001e27 < c < 2.1500000000000001e-147

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

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

    if 2.1500000000000001e-147 < c < 2.9000000000000002e57

    1. Initial program 97.5%

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

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

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

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

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

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

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

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

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

Alternative 10: 63.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-29} \lor \neg \left(x \cdot y \leq 10^{+113}\right):\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* x y) -1e-29) (not (<= (* x y) 1e+113)))
   (* 2.0 (* x (+ y (* t (/ z x)))))
   (* 2.0 (- (* z t) (* i (* a c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((x * y) <= -1e-29) || !((x * y) <= 1e+113)) {
		tmp = 2.0 * (x * (y + (t * (z / x))));
	} else {
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((x * y) <= (-1d-29)) .or. (.not. ((x * y) <= 1d+113))) then
        tmp = 2.0d0 * (x * (y + (t * (z / x))))
    else
        tmp = 2.0d0 * ((z * t) - (i * (a * c)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((x * y) <= -1e-29) || !((x * y) <= 1e+113)) {
		tmp = 2.0 * (x * (y + (t * (z / x))));
	} else {
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((x * y) <= -1e-29) or not ((x * y) <= 1e+113):
		tmp = 2.0 * (x * (y + (t * (z / x))))
	else:
		tmp = 2.0 * ((z * t) - (i * (a * c)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(x * y) <= -1e-29) || !(Float64(x * y) <= 1e+113))
		tmp = Float64(2.0 * Float64(x * Float64(y + Float64(t * Float64(z / x)))));
	else
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(a * c))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((x * y) <= -1e-29) || ~(((x * y) <= 1e+113)))
		tmp = 2.0 * (x * (y + (t * (z / x))));
	else
		tmp = 2.0 * ((z * t) - (i * (a * c)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1e-29], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1e+113]], $MachinePrecision]], N[(2.0 * N[(x * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-29} \lor \neg \left(x \cdot y \leq 10^{+113}\right):\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -9.99999999999999943e-30 or 1e113 < (*.f64 x y)

    1. Initial program 81.3%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(z \cdot \left(t + \color{blue}{x \cdot \frac{y}{z}}\right)\right) \]
    11. Simplified60.8%

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

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

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

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

    if -9.99999999999999943e-30 < (*.f64 x y) < 1e113

    1. Initial program 91.3%

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

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

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

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

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

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

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

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

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

Alternative 11: 86.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\ \mathbf{if}\;c \leq -1.66 \cdot 10^{+59}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\ \mathbf{elif}\;c \leq 5.8 \cdot 10^{+69}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* c (* (+ a (* b c)) i))))
   (if (<= c -1.66e+59)
     (* 2.0 (- (* z t) t_1))
     (if (<= c 5.8e+69)
       (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
       (* 2.0 (- (* x y) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = c * ((a + (b * c)) * i);
	double tmp;
	if (c <= -1.66e+59) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 5.8e+69) {
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
	} else {
		tmp = 2.0 * ((x * y) - t_1);
	}
	return tmp;
}
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 = c * ((a + (b * c)) * i)
    if (c <= (-1.66d+59)) then
        tmp = 2.0d0 * ((z * t) - t_1)
    else if (c <= 5.8d+69) then
        tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
    else
        tmp = 2.0d0 * ((x * y) - t_1)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = c * ((a + (b * c)) * i);
	double tmp;
	if (c <= -1.66e+59) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 5.8e+69) {
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
	} else {
		tmp = 2.0 * ((x * y) - t_1);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = c * ((a + (b * c)) * i)
	tmp = 0
	if c <= -1.66e+59:
		tmp = 2.0 * ((z * t) - t_1)
	elif c <= 5.8e+69:
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)))
	else:
		tmp = 2.0 * ((x * y) - t_1)
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(c * Float64(Float64(a + Float64(b * c)) * i))
	tmp = 0.0
	if (c <= -1.66e+59)
		tmp = Float64(2.0 * Float64(Float64(z * t) - t_1));
	elseif (c <= 5.8e+69)
		tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c))));
	else
		tmp = Float64(2.0 * Float64(Float64(x * y) - t_1));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = c * ((a + (b * c)) * i);
	tmp = 0.0;
	if (c <= -1.66e+59)
		tmp = 2.0 * ((z * t) - t_1);
	elseif (c <= 5.8e+69)
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
	else
		tmp = 2.0 * ((x * y) - t_1);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.66e+59], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.8e+69], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;c \leq -1.66 \cdot 10^{+59}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\

\mathbf{elif}\;c \leq 5.8 \cdot 10^{+69}:\\
\;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.6599999999999999e59

    1. Initial program 70.0%

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

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

    if -1.6599999999999999e59 < c < 5.7999999999999997e69

    1. Initial program 94.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 88.7%

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

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

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

    if 5.7999999999999997e69 < c

    1. Initial program 79.0%

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

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

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

Alternative 12: 64.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-29}:\\ \;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+163}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(y \cdot \left(x + t \cdot \frac{z}{y}\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= (* x y) -1e-29)
   (* 2.0 (* x (+ y (* t (/ z x)))))
   (if (<= (* x y) 4e+163)
     (* 2.0 (- (* z t) (* a (* c i))))
     (* 2.0 (* y (+ x (* t (/ z y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x * y) <= -1e-29) {
		tmp = 2.0 * (x * (y + (t * (z / x))));
	} else if ((x * y) <= 4e+163) {
		tmp = 2.0 * ((z * t) - (a * (c * i)));
	} else {
		tmp = 2.0 * (y * (x + (t * (z / y))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((x * y) <= (-1d-29)) then
        tmp = 2.0d0 * (x * (y + (t * (z / x))))
    else if ((x * y) <= 4d+163) then
        tmp = 2.0d0 * ((z * t) - (a * (c * i)))
    else
        tmp = 2.0d0 * (y * (x + (t * (z / y))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((x * y) <= -1e-29) {
		tmp = 2.0 * (x * (y + (t * (z / x))));
	} else if ((x * y) <= 4e+163) {
		tmp = 2.0 * ((z * t) - (a * (c * i)));
	} else {
		tmp = 2.0 * (y * (x + (t * (z / y))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (x * y) <= -1e-29:
		tmp = 2.0 * (x * (y + (t * (z / x))))
	elif (x * y) <= 4e+163:
		tmp = 2.0 * ((z * t) - (a * (c * i)))
	else:
		tmp = 2.0 * (y * (x + (t * (z / y))))
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (Float64(x * y) <= -1e-29)
		tmp = Float64(2.0 * Float64(x * Float64(y + Float64(t * Float64(z / x)))));
	elseif (Float64(x * y) <= 4e+163)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(y * Float64(x + Float64(t * Float64(z / y)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((x * y) <= -1e-29)
		tmp = 2.0 * (x * (y + (t * (z / x))));
	elseif ((x * y) <= 4e+163)
		tmp = 2.0 * ((z * t) - (a * (c * i)));
	else
		tmp = 2.0 * (y * (x + (t * (z / y))));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -1e-29], N[(2.0 * N[(x * N[(y + N[(t * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+163], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * N[(x + N[(t * N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1 \cdot 10^{-29}:\\
\;\;\;\;2 \cdot \left(x \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+163}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -9.99999999999999943e-30

    1. Initial program 79.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(x \cdot \left(y + \color{blue}{t \cdot \frac{z}{x}}\right)\right) \]
    14. Simplified67.4%

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

    if -9.99999999999999943e-30 < (*.f64 x y) < 3.9999999999999998e163

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + -1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
      2. mul-1-neg67.0%

        \[\leadsto 2 \cdot \left(t \cdot z + \color{blue}{\left(-a \cdot \left(c \cdot i\right)\right)}\right) \]
      3. sub-neg67.0%

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

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

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

    if 3.9999999999999998e163 < (*.f64 x y)

    1. Initial program 80.3%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(z \cdot \left(t + \frac{x \cdot y - \color{blue}{\left(a \cdot c\right) \cdot i}}{z}\right)\right) \]
      4. *-commutative75.1%

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

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

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

        \[\leadsto 2 \cdot \left(z \cdot \left(t + \color{blue}{x \cdot \frac{y}{z}}\right)\right) \]
    11. Simplified77.9%

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

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

        \[\leadsto 2 \cdot \left(y \cdot \left(x + \color{blue}{t \cdot \frac{z}{y}}\right)\right) \]
    14. Simplified80.5%

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

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

Alternative 13: 56.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -2.1 \cdot 10^{+28} \lor \neg \left(c \leq 1.26 \cdot 10^{+76}\right):\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -2.1e+28) (not (<= c 1.26e+76)))
   (* (* c i) (* a -2.0))
   (* (+ (* x y) (* z t)) 2.0)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -2.1e+28) || !(c <= 1.26e+76)) {
		tmp = (c * i) * (a * -2.0);
	} else {
		tmp = ((x * y) + (z * t)) * 2.0;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if ((c <= (-2.1d+28)) .or. (.not. (c <= 1.26d+76))) then
        tmp = (c * i) * (a * (-2.0d0))
    else
        tmp = ((x * y) + (z * t)) * 2.0d0
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((c <= -2.1e+28) || !(c <= 1.26e+76)) {
		tmp = (c * i) * (a * -2.0);
	} else {
		tmp = ((x * y) + (z * t)) * 2.0;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if (c <= -2.1e+28) or not (c <= 1.26e+76):
		tmp = (c * i) * (a * -2.0)
	else:
		tmp = ((x * y) + (z * t)) * 2.0
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((c <= -2.1e+28) || !(c <= 1.26e+76))
		tmp = Float64(Float64(c * i) * Float64(a * -2.0));
	else
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -2.1e+28) || ~((c <= 1.26e+76)))
		tmp = (c * i) * (a * -2.0);
	else
		tmp = ((x * y) + (z * t)) * 2.0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[c, -2.1e+28], N[Not[LessEqual[c, 1.26e+76]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] * N[(a * -2.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.1 \cdot 10^{+28} \lor \neg \left(c \leq 1.26 \cdot 10^{+76}\right):\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.09999999999999989e28 or 1.26000000000000007e76 < c

    1. Initial program 75.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. Step-by-step derivation
      1. fma-define75.5%

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(a \cdot c\right) \cdot i}\right) \]
      3. distribute-lft-neg-out35.9%

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

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

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

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

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

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

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

    if -2.09999999999999989e28 < c < 1.26000000000000007e76

    1. Initial program 94.6%

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

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

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

Alternative 14: 44.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+168} \lor \neg \left(x \cdot y \leq 1.6 \cdot 10^{+101}\right):\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= (* x y) -1.4e+168) (not (<= (* x y) 1.6e+101)))
   (* (* x y) 2.0)
   (* 2.0 (* z t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((x * y) <= -1.4e+168) || !((x * y) <= 1.6e+101)) {
		tmp = (x * y) * 2.0;
	} else {
		tmp = 2.0 * (z * t);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: tmp
    if (((x * y) <= (-1.4d+168)) .or. (.not. ((x * y) <= 1.6d+101))) then
        tmp = (x * y) * 2.0d0
    else
        tmp = 2.0d0 * (z * t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (((x * y) <= -1.4e+168) || !((x * y) <= 1.6e+101)) {
		tmp = (x * y) * 2.0;
	} else {
		tmp = 2.0 * (z * t);
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	tmp = 0
	if ((x * y) <= -1.4e+168) or not ((x * y) <= 1.6e+101):
		tmp = (x * y) * 2.0
	else:
		tmp = 2.0 * (z * t)
	return tmp
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((Float64(x * y) <= -1.4e+168) || !(Float64(x * y) <= 1.6e+101))
		tmp = Float64(Float64(x * y) * 2.0);
	else
		tmp = Float64(2.0 * Float64(z * t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if (((x * y) <= -1.4e+168) || ~(((x * y) <= 1.6e+101)))
		tmp = (x * y) * 2.0;
	else
		tmp = 2.0 * (z * t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(x * y), $MachinePrecision], -1.4e+168], N[Not[LessEqual[N[(x * y), $MachinePrecision], 1.6e+101]], $MachinePrecision]], N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.4 \cdot 10^{+168} \lor \neg \left(x \cdot y \leq 1.6 \cdot 10^{+101}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.39999999999999995e168 or 1.60000000000000003e101 < (*.f64 x y)

    1. Initial program 78.7%

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

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

    if -1.39999999999999995e168 < (*.f64 x y) < 1.60000000000000003e101

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

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

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

Alternative 15: 29.5% accurate, 3.8× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(z \cdot t\right) \end{array} \]
(FPCore (x y z t a b c i) :precision binary64 (* 2.0 (* z t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (z * t);
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    code = 2.0d0 * (z * t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	return 2.0 * (z * t);
}
def code(x, y, z, t, a, b, c, i):
	return 2.0 * (z * t)
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(z * t))
end
function tmp = code(x, y, z, t, a, b, c, i)
	tmp = 2.0 * (z * t);
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 86.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 26.9%

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

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

Developer target: 93.9% 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 2024083 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

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

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