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

Percentage Accurate: 89.8% → 92.2%
Time: 19.1s
Alternatives: 15
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 89.8% 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: 92.2% accurate, 0.2× speedup?

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

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

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

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


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

    1. Initial program 64.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+64.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. *-commutative64.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+64.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+64.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. *-commutative64.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+64.1%

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.0000000000000001e266

    1. Initial program 98.3%

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

    if 2.0000000000000001e266 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 73.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 i around inf 92.4%

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

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

Alternative 2: 93.9% accurate, 0.2× speedup?

\[\begin{array}{l} \\ 2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (fma 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 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + 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(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Derivation
  1. Initial program 90.6%

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

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

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

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

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

Alternative 3: 93.8% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (+.f64 a (*.f64 b c)) c) < -1.9999999999999999e298 or 2.0000000000000001e266 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 69.6%

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

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

    if -1.9999999999999999e298 < (*.f64 (+.f64 a (*.f64 b c)) c) < 2.0000000000000001e266

    1. Initial program 98.3%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification95.7%

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

Alternative 4: 83.3% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 77.8%

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

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

    if -1.12e11 < c < 4.7000000000000002e-79

    1. Initial program 96.9%

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

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

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

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

    if 4.7000000000000002e-79 < c

    1. Initial program 88.5%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r*98.5%

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

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

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

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(c \cdot i\right) \cdot \left(b \cdot c\right) + \left(c \cdot i\right) \cdot a\right)}\right) \]
    5. Step-by-step derivation
      1. add-sqr-sqrt49.9%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\color{blue}{\left(b \cdot c\right) \cdot \left(c \cdot i\right)} - a \cdot \left(c \cdot i\right)\right)\right) \]
      12. distribute-rgt-out--83.4%

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

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

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

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

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

Alternative 5: 38.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 2.5 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.09999999999999999e111 or 2.49999999999999991e-65 < z

    1. Initial program 87.8%

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

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

    if -1.09999999999999999e111 < z < -2.80000000000000001e-257 or 4.6999999999999998e-247 < z < 2.49999999999999991e-65

    1. Initial program 93.0%

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

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

    if -2.80000000000000001e-257 < z < 4.6999999999999998e-247

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 38.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -2.6 \cdot 10^{-257}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 4 \cdot 10^{-64}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.79999999999999987e112 or 3.99999999999999986e-64 < z

    1. Initial program 87.8%

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

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

    if -6.79999999999999987e112 < z < -2.6000000000000001e-257 or 4.6999999999999998e-247 < z < 3.99999999999999986e-64

    1. Initial program 93.0%

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

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

    if -2.6000000000000001e-257 < z < 4.6999999999999998e-247

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{+112}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -2.6 \cdot 10^{-257}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-247}:\\ \;\;\;\;\left(a \cdot c\right) \cdot \left(i \cdot -2\right)\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-64}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 38.0% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;z \leq -5.3 \cdot 10^{-128}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;z \leq 10^{-64}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.04999999999999997e111 or 9.99999999999999965e-65 < z

    1. Initial program 87.8%

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

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

    if -1.04999999999999997e111 < z < -5.2999999999999999e-128 or 4.9e-247 < z < 9.99999999999999965e-65

    1. Initial program 91.5%

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

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

    if -5.2999999999999999e-128 < z < 4.9e-247

    1. Initial program 95.1%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.05 \cdot 10^{+111}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -5.3 \cdot 10^{-128}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \leq 4.9 \cdot 10^{-247}:\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \cdot -2\right)\\ \mathbf{elif}\;z \leq 10^{-64}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 64.5% accurate, 0.8× speedup?

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

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

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


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

    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. Add Preprocessing
    3. Taylor expanded in c around 0 75.1%

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

    if -1850 < (*.f64 x y) < 1.15000000000000007e-11

    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. Add Preprocessing
    3. Taylor expanded in a around inf 67.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. *-commutative67.0%

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

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

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

Alternative 9: 84.0% accurate, 0.8× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.12e11 or 2.7000000000000001e110 < c

    1. Initial program 79.0%

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

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

    if -1.12e11 < c < 2.7000000000000001e110

    1. Initial program 97.4%

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

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

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

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

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

Alternative 10: 73.9% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.4500000000000001e-23 or 8.5000000000000004e110 < c

    1. Initial program 79.6%

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

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

    if -1.4500000000000001e-23 < c < 8.5000000000000004e110

    1. Initial program 98.0%

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

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

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

Alternative 11: 66.7% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.12e11 or 8.2e154 < c

    1. Initial program 78.8%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. associate-*r*90.7%

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

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

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

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(\left(c \cdot i\right) \cdot \left(b \cdot c\right) + \left(c \cdot i\right) \cdot a\right)}\right) \]
    5. Step-by-step derivation
      1. add-sqr-sqrt41.3%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\color{blue}{\left(b \cdot c\right) \cdot \left(c \cdot i\right)} - a \cdot \left(c \cdot i\right)\right)\right) \]
      12. distribute-rgt-out--66.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(c \cdot \left(i \cdot \left(0 - \color{blue}{\left(\left(-a\right) + c \cdot b\right)}\right)\right)\right) \]
      10. associate--r+58.5%

        \[\leadsto 2 \cdot \left(c \cdot \left(i \cdot \color{blue}{\left(\left(0 - \left(-a\right)\right) - c \cdot b\right)}\right)\right) \]
      11. neg-sub058.5%

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

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

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

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

    if -1.12e11 < c < 8.2e154

    1. Initial program 96.5%

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

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

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

Alternative 12: 61.5% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1.04e6 or 1.59999999999999991e120 < i

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

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

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

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

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

    if -1.04e6 < i < 1.59999999999999991e120

    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. Add Preprocessing
    3. Taylor expanded in c around 0 71.4%

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

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

Alternative 13: 57.9% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -7 \cdot 10^{+53} \lor \neg \left(c \leq 1.3 \cdot 10^{+164}\right):\\ \;\;\;\;\left(c \cdot i\right) \cdot \left(a \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 (or (<= c -7e+53) (not (<= c 1.3e+164)))
   (* (* c i) (* a -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 <= -7e+53) || !(c <= 1.3e+164)) {
		tmp = (c * i) * (a * -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 <= (-7d+53)) .or. (.not. (c <= 1.3d+164))) then
        tmp = (c * i) * (a * (-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 <= -7e+53) || !(c <= 1.3e+164)) {
		tmp = (c * i) * (a * -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 <= -7e+53) or not (c <= 1.3e+164):
		tmp = (c * i) * (a * -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 <= -7e+53) || !(c <= 1.3e+164))
		tmp = Float64(Float64(c * i) * Float64(a * -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 <= -7e+53) || ~((c <= 1.3e+164)))
		tmp = (c * i) * (a * -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, -7e+53], N[Not[LessEqual[c, 1.3e+164]], $MachinePrecision]], N[(N[(c * i), $MachinePrecision] * N[(a * -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}\;c \leq -7 \cdot 10^{+53} \lor \neg \left(c \leq 1.3 \cdot 10^{+164}\right):\\
\;\;\;\;\left(c \cdot i\right) \cdot \left(a \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 c < -7.00000000000000038e53 or 1.3e164 < c

    1. Initial program 76.3%

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

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

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

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

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

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

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

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

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

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

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

    if -7.00000000000000038e53 < c < 1.3e164

    1. Initial program 96.2%

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

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

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

Alternative 14: 39.3% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.1 \cdot 10^{+111} \lor \neg \left(z \leq 9 \cdot 10^{-64}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.09999999999999999e111 or 9.00000000000000019e-64 < z

    1. Initial program 87.8%

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

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

    if -1.09999999999999999e111 < z < 9.00000000000000019e-64

    1. Initial program 93.0%

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

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

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

Alternative 15: 29.2% 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 90.6%

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

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

    \[\leadsto 2 \cdot \left(z \cdot t\right) \]
  5. 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 2024045 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

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

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