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

Percentage Accurate: 89.6% → 93.7%
Time: 27.6s
Alternatives: 16
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 16 alternatives:

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

Initial Program: 89.6% accurate, 1.0× speedup?

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

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

Alternative 1: 93.7% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -4 \cdot 10^{+70}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(z, t, x \cdot y - i \cdot \left(c \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(y, x, z \cdot t - c \cdot \left(i \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (<= i -4e+70)
   (* 2.0 (fma z t (- (* x y) (* i (* c (fma b c a))))))
   (* 2.0 (fma y x (- (* z t) (* c (* i (fma b c a))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if (i <= -4e+70) {
		tmp = 2.0 * fma(z, t, ((x * y) - (i * (c * fma(b, c, a)))));
	} else {
		tmp = 2.0 * fma(y, x, ((z * t) - (c * (i * fma(b, c, a)))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if (i <= -4e+70)
		tmp = Float64(2.0 * fma(z, t, Float64(Float64(x * y) - Float64(i * Float64(c * fma(b, c, a))))));
	else
		tmp = Float64(2.0 * fma(y, x, Float64(Float64(z * t) - Float64(c * Float64(i * fma(b, c, a))))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, -4e+70], N[(2.0 * N[(z * t + N[(N[(x * y), $MachinePrecision] - N[(i * N[(c * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(y * x + N[(N[(z * t), $MachinePrecision] - N[(c * N[(i * N[(b * c + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -4 \cdot 10^{+70}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, x \cdot y - i \cdot \left(c \cdot \mathsf{fma}\left(b, c, a\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -4.00000000000000029e70

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

        \[\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) \]
      3. associate-*r*96.2%

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000029e70 < i

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.5% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 93.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. associate--l+93.3%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in a around inf 50.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. *-commutative50.0%

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot a\right)} \cdot i\right) \]
    5. Simplified50.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 x around 0 43.3%

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

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

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

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

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

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

Alternative 3: 44.0% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := 2 \cdot \left(x \cdot y\right)\\ \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+80}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{-217}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+59}:\\ \;\;\;\;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 (* 2.0 (* x y))))
   (if (<= (* x y) -5e+80)
     t_2
     (if (<= (* x y) 0.0)
       t_1
       (if (<= (* x y) 5e-217)
         (* 2.0 (* i (* a (- c))))
         (if (<= (* x y) 4e+59) 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 = 2.0 * (x * y);
	double tmp;
	if ((x * y) <= -5e+80) {
		tmp = t_2;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 5e-217) {
		tmp = 2.0 * (i * (a * -c));
	} else if ((x * y) <= 4e+59) {
		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 = 2.0d0 * (x * y)
    if ((x * y) <= (-5d+80)) then
        tmp = t_2
    else if ((x * y) <= 0.0d0) then
        tmp = t_1
    else if ((x * y) <= 5d-217) then
        tmp = 2.0d0 * (i * (a * -c))
    else if ((x * y) <= 4d+59) 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 = 2.0 * (x * y);
	double tmp;
	if ((x * y) <= -5e+80) {
		tmp = t_2;
	} else if ((x * y) <= 0.0) {
		tmp = t_1;
	} else if ((x * y) <= 5e-217) {
		tmp = 2.0 * (i * (a * -c));
	} else if ((x * y) <= 4e+59) {
		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 = 2.0 * (x * y)
	tmp = 0
	if (x * y) <= -5e+80:
		tmp = t_2
	elif (x * y) <= 0.0:
		tmp = t_1
	elif (x * y) <= 5e-217:
		tmp = 2.0 * (i * (a * -c))
	elif (x * y) <= 4e+59:
		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(2.0 * Float64(x * y))
	tmp = 0.0
	if (Float64(x * y) <= -5e+80)
		tmp = t_2;
	elseif (Float64(x * y) <= 0.0)
		tmp = t_1;
	elseif (Float64(x * y) <= 5e-217)
		tmp = Float64(2.0 * Float64(i * Float64(a * Float64(-c))));
	elseif (Float64(x * y) <= 4e+59)
		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 = 2.0 * (x * y);
	tmp = 0.0;
	if ((x * y) <= -5e+80)
		tmp = t_2;
	elseif ((x * y) <= 0.0)
		tmp = t_1;
	elseif ((x * y) <= 5e-217)
		tmp = 2.0 * (i * (a * -c));
	elseif ((x * y) <= 4e+59)
		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[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -5e+80], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 0.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 5e-217], N[(2.0 * N[(i * N[(a * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 4e+59], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t\_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -4.99999999999999961e80 or 3.99999999999999989e59 < (*.f64 x y)

    1. Initial program 88.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. associate--l+88.8%

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

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

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

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

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

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

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

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

    if -4.99999999999999961e80 < (*.f64 x y) < 0.0 or 5.0000000000000002e-217 < (*.f64 x y) < 3.99999999999999989e59

    1. Initial program 89.2%

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

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

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

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

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

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

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

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

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

    if 0.0 < (*.f64 x y) < 5.0000000000000002e-217

    1. Initial program 88.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 63.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. *-commutative63.8%

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot a\right)} \cdot i\right) \]
    5. Simplified63.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 x around 0 52.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 72.6% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -5.19999999999999995e34 or 3.40000000000000017e185 < c

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.19999999999999995e34 < c < 2.3499999999999999e-77

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

    if 2.3499999999999999e-77 < c < 1.12e148

    1. Initial program 93.2%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y + \left(z \cdot t - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Add Preprocessing
    5. 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)} \]
    6. Step-by-step derivation
      1. associate-*r*84.5%

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

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

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

    if 1.12e148 < c < 3.40000000000000017e185

    1. Initial program 80.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. associate--l+80.5%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
      2. +-commutative90.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) \]
      3. associate-*r*80.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.2 \cdot 10^{+34}:\\ \;\;\;\;\left(c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right) \cdot -2\\ \mathbf{elif}\;c \leq 2.35 \cdot 10^{-77}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.12 \cdot 10^{+148}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(i \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 3.4 \cdot 10^{+185}:\\ \;\;\;\;2 \cdot \left(z \cdot t - \left(c \cdot b\right) \cdot \left(i \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right) \cdot -2\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 71.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot y + z \cdot t\right)\\ t_2 := \left(c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right) \cdot -2\\ \mathbf{if}\;c \leq -1.9 \cdot 10^{+29}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \leq 2.6 \cdot 10^{-77}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 5.4 \cdot 10^{+159}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(i \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 5.4 \cdot 10^{+183}:\\ \;\;\;\;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 (+ (* x y) (* z t))))
        (t_2 (* (* c (* i (+ a (* c b)))) -2.0)))
   (if (<= c -1.9e+29)
     t_2
     (if (<= c 2.6e-77)
       t_1
       (if (<= c 5.4e+159)
         (* 2.0 (- (* x y) (* a (* i c))))
         (if (<= c 5.4e+183) 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 * ((x * y) + (z * t));
	double t_2 = (c * (i * (a + (c * b)))) * -2.0;
	double tmp;
	if (c <= -1.9e+29) {
		tmp = t_2;
	} else if (c <= 2.6e-77) {
		tmp = t_1;
	} else if (c <= 5.4e+159) {
		tmp = 2.0 * ((x * y) - (a * (i * c)));
	} else if (c <= 5.4e+183) {
		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 * ((x * y) + (z * t))
    t_2 = (c * (i * (a + (c * b)))) * (-2.0d0)
    if (c <= (-1.9d+29)) then
        tmp = t_2
    else if (c <= 2.6d-77) then
        tmp = t_1
    else if (c <= 5.4d+159) then
        tmp = 2.0d0 * ((x * y) - (a * (i * c)))
    else if (c <= 5.4d+183) 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 * ((x * y) + (z * t));
	double t_2 = (c * (i * (a + (c * b)))) * -2.0;
	double tmp;
	if (c <= -1.9e+29) {
		tmp = t_2;
	} else if (c <= 2.6e-77) {
		tmp = t_1;
	} else if (c <= 5.4e+159) {
		tmp = 2.0 * ((x * y) - (a * (i * c)));
	} else if (c <= 5.4e+183) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * ((x * y) + (z * t))
	t_2 = (c * (i * (a + (c * b)))) * -2.0
	tmp = 0
	if c <= -1.9e+29:
		tmp = t_2
	elif c <= 2.6e-77:
		tmp = t_1
	elif c <= 5.4e+159:
		tmp = 2.0 * ((x * y) - (a * (i * c)))
	elif c <= 5.4e+183:
		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(x * y) + Float64(z * t)))
	t_2 = Float64(Float64(c * Float64(i * Float64(a + Float64(c * b)))) * -2.0)
	tmp = 0.0
	if (c <= -1.9e+29)
		tmp = t_2;
	elseif (c <= 2.6e-77)
		tmp = t_1;
	elseif (c <= 5.4e+159)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(a * Float64(i * c))));
	elseif (c <= 5.4e+183)
		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 * ((x * y) + (z * t));
	t_2 = (c * (i * (a + (c * b)))) * -2.0;
	tmp = 0.0;
	if (c <= -1.9e+29)
		tmp = t_2;
	elseif (c <= 2.6e-77)
		tmp = t_1;
	elseif (c <= 5.4e+159)
		tmp = 2.0 * ((x * y) - (a * (i * c)));
	elseif (c <= 5.4e+183)
		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[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(i * N[(a + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision]}, If[LessEqual[c, -1.9e+29], t$95$2, If[LessEqual[c, 2.6e-77], t$95$1, If[LessEqual[c, 5.4e+159], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(a * N[(i * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.4e+183], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq 2.6 \cdot 10^{-77}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;c \leq 5.4 \cdot 10^{+183}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.89999999999999985e29 or 5.39999999999999964e183 < c

    1. Initial program 73.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.89999999999999985e29 < c < 2.6000000000000001e-77 or 5.40000000000000016e159 < c < 5.39999999999999964e183

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    6. Step-by-step derivation
      1. +-commutative80.1%

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

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

    if 2.6000000000000001e-77 < c < 5.40000000000000016e159

    1. Initial program 93.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. associate--l+93.5%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.9 \cdot 10^{+29}:\\ \;\;\;\;\left(c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right) \cdot -2\\ \mathbf{elif}\;c \leq 2.6 \cdot 10^{-77}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;c \leq 5.4 \cdot 10^{+159}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(i \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 5.4 \cdot 10^{+183}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right) \cdot -2\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 84.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
t_1 := \left(a + c \cdot b\right) \cdot \left(i \cdot c\right)\\
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+80} \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+59}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.99999999999999961e80 or 3.99999999999999989e59 < (*.f64 x y)

    1. Initial program 88.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. associate--l+88.8%

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

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

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

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

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

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

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

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

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

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

    if -4.99999999999999961e80 < (*.f64 x y) < 3.99999999999999989e59

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
      2. +-commutative96.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) \]
      3. associate-*r*89.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 78.6% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e96 < (*.f64 x y) < 5.00000000000000008e115

    1. Initial program 89.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. associate--l+89.5%

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

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

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

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

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

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

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

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

    if 5.00000000000000008e115 < (*.f64 x y)

    1. Initial program 86.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. associate--l+86.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 81.0% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e96 < (*.f64 x y) < 5.00000000000000008e115

    1. Initial program 89.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. associate--l+89.5%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
      2. +-commutative96.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) \]
      3. associate-*r*89.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.00000000000000008e115 < (*.f64 x y)

    1. Initial program 86.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. associate--l+86.3%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 81.7% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

    if -2.0000000000000001e96 < (*.f64 x y) < 9.99999999999999944e71

    1. Initial program 88.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. Step-by-step derivation
      1. associate--l+88.9%

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

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

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

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

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

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

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

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

        \[\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) \]
      3. associate-*r*88.9%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(z, t, x \cdot y - c \cdot \left(\color{blue}{\mathsf{fma}\left(b, c, a\right)} \cdot i\right)\right) \]
    6. Applied egg-rr93.1%

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

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

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

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

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

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

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

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

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

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

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

    if 9.99999999999999944e71 < (*.f64 x y)

    1. Initial program 88.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. associate--l+88.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)}\right) \]
    8. Step-by-step derivation
      1. mul-1-neg93.3%

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, -\color{blue}{\left(c \cdot i\right) \cdot \left(a + b \cdot c\right)}\right) \]
      3. distribute-rgt-neg-in95.0%

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\left(c \cdot i\right) \cdot \left(-\left(a + c \cdot b\right)\right)}\right) \]
    10. Taylor expanded in y around 0 86.7%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right) + x \cdot y\right)} \]
    11. Step-by-step derivation
      1. +-commutative86.7%

        \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y + -1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
      2. mul-1-neg86.7%

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

        \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
      4. associate-*r*88.3%

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

        \[\leadsto 2 \cdot \left(x \cdot y - \color{blue}{\left(i \cdot c\right)} \cdot \left(a + b \cdot c\right)\right) \]
      6. associate-*l*86.7%

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

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

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

Alternative 10: 85.4% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq 4 \cdot 10^{+59}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\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 (*.f64 x y) < -5.0000000000000004e-19

    1. Initial program 89.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. +-commutative89.8%

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

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

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

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

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

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

    if -5.0000000000000004e-19 < (*.f64 x y) < 3.99999999999999989e59

    1. Initial program 89.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. associate--l+89.3%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
      2. +-commutative95.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) \]
      3. associate-*r*89.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.99999999999999989e59 < (*.f64 x y)

    1. Initial program 87.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. associate--l+87.3%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.0% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -4.00000000000000021e32 or 1.00000000000000002e198 < c

    1. Initial program 72.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. associate--l+72.4%

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

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

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

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

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

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

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

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

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

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

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

    if -4.00000000000000021e32 < c < 2.8999999999999998e-53

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    6. Step-by-step derivation
      1. +-commutative79.3%

        \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y + t \cdot z\right)} \]
    7. Simplified79.3%

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

    if 2.8999999999999998e-53 < c < 1.00000000000000002e198

    1. Initial program 91.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y + \left(z \cdot t - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\right)} \]
    4. Add Preprocessing
    5. 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)} \]
    6. Step-by-step derivation
      1. associate-*r*82.5%

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

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

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

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

Alternative 12: 85.7% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 73.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. Step-by-step derivation
      1. associate--l+73.9%

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

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

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

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

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

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

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

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

    if -4.19999999999999978e71 < c < 3.30000000000000004e-53

    1. Initial program 98.4%

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

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

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

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

    if 3.30000000000000004e-53 < c

    1. Initial program 83.0%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 74.6% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -2.15 \cdot 10^{+33} \lor \neg \left(c \leq 18.5\right):\\
\;\;\;\;\left(c \cdot \left(i \cdot \left(a + c \cdot b\right)\right)\right) \cdot -2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -2.15000000000000014e33 or 18.5 < 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. associate--l+78.4%

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

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

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

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

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

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

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

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

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

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

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

    if -2.15000000000000014e33 < c < 18.5

    1. Initial program 99.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 44.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+80} \lor \neg \left(x \cdot y \leq 4 \cdot 10^{+59}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.99999999999999961e80 or 3.99999999999999989e59 < (*.f64 x y)

    1. Initial program 88.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. associate--l+88.8%

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

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

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

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

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

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

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

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

    if -4.99999999999999961e80 < (*.f64 x y) < 3.99999999999999989e59

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

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

Alternative 15: 56.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -1.3 \cdot 10^{+154}:\\
\;\;\;\;a \cdot \left(\left(i \cdot c\right) \cdot -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.29999999999999994e154

    1. Initial program 94.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. associate--l+94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.29999999999999994e154 < i

    1. Initial program 88.1%

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + x \cdot y\right)} \]
    6. Step-by-step derivation
      1. +-commutative61.5%

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

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

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

Alternative 16: 28.8% 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 89.0%

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

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

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

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

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

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

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

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

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

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

Developer target: 93.6% 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 2024048 
(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))))