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

Percentage Accurate: 90.1% → 96.1%
Time: 12.6s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 90.1% 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: 96.1% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 94.9%

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

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

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

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

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

    1. Initial program 0.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate-*l*16.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. fma-def16.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 94.6% accurate, 0.5× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;-2 \cdot t_3\\


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

    1. Initial program 69.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. Taylor expanded in x around 0 84.8%

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

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

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

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

    1. Initial program 82.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. Taylor expanded in i around inf 95.6%

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

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

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

Alternative 3: 96.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate-*l*16.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. fma-def16.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 46.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
t_1 := 2 \cdot \left(z \cdot t\right)\\
t_2 := -2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\
t_3 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;c \leq -2.3 \cdot 10^{-67}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq -3.1 \cdot 10^{-168}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 9.2 \cdot 10^{-247}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 4.2 \cdot 10^{-146}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 5.5 \cdot 10^{-35}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 31000:\\
\;\;\;\;t_1\\

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

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -2.3e-67 or 4.20000000000000032e122 < c

    1. Initial program 82.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3e-67 < c < -3.1e-168 or 9.2000000000000001e-247 < c < 4.1999999999999998e-146 or 5.4999999999999997e-35 < c < 31000

    1. Initial program 99.9%

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

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

    if -3.1e-168 < c < 9.2000000000000001e-247 or 4.1999999999999998e-146 < c < 5.4999999999999997e-35

    1. Initial program 99.9%

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

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

    if 31000 < c < 4.20000000000000032e122

    1. Initial program 78.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.3 \cdot 10^{-67}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq -3.1 \cdot 10^{-168}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 9.2 \cdot 10^{-247}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{-146}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 5.5 \cdot 10^{-35}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 31000:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{+122}:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \left(a \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\ \end{array} \]

Alternative 5: 46.3% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;c \leq -1.12 \cdot 10^{-167}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 1.85 \cdot 10^{-247}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 1.3 \cdot 10^{-145}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 4.8 \cdot 10^{-35}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 1050000000000:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c < -2.44999999999999997e-67

    1. Initial program 90.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.44999999999999997e-67 < c < -1.1200000000000001e-167 or 1.85000000000000005e-247 < c < 1.3e-145 or 4.8000000000000003e-35 < c < 1.05e12

    1. Initial program 99.9%

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

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

    if -1.1200000000000001e-167 < c < 1.85000000000000005e-247 or 1.3e-145 < c < 4.8000000000000003e-35

    1. Initial program 99.9%

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

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

    if 1.05e12 < c < 3.7999999999999998e122

    1. Initial program 78.7%

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

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

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

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

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

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

    if 3.7999999999999998e122 < c

    1. Initial program 71.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. associate-*l*85.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. fma-def85.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(\color{blue}{\left(b \cdot \left(c \cdot i\right)\right)} \cdot c\right) \]
      9. *-commutative75.0%

        \[\leadsto -2 \cdot \color{blue}{\left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)} \]
      10. *-commutative75.0%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.45 \cdot 10^{-67}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.12 \cdot 10^{-167}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.85 \cdot 10^{-247}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 1.3 \cdot 10^{-145}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 4.8 \cdot 10^{-35}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 1050000000000:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+122}:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \left(a \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 6: 34.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := 2 \cdot \left(x \cdot y\right)\\ t_3 := \left(c \cdot -2\right) \cdot \left(a \cdot i\right)\\ \mathbf{if}\;x \leq -5 \cdot 10^{+231}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{+190}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -6.2 \cdot 10^{+128}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -3.15 \cdot 10^{+43}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{+31}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-304}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-170}:\\ \;\;\;\;t_3\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (* z t)))
        (t_2 (* 2.0 (* x y)))
        (t_3 (* (* c -2.0) (* a i))))
   (if (<= x -5e+231)
     t_2
     (if (<= x -1.55e+190)
       t_1
       (if (<= x -6.2e+128)
         t_2
         (if (<= x -3.15e+43)
           t_3
           (if (<= x -1.1e+31)
             t_2
             (if (<= x 2.8e-304) t_1 (if (<= x 6.6e-170) t_3 t_2)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (z * t);
	double t_2 = 2.0 * (x * y);
	double t_3 = (c * -2.0) * (a * i);
	double tmp;
	if (x <= -5e+231) {
		tmp = t_2;
	} else if (x <= -1.55e+190) {
		tmp = t_1;
	} else if (x <= -6.2e+128) {
		tmp = t_2;
	} else if (x <= -3.15e+43) {
		tmp = t_3;
	} else if (x <= -1.1e+31) {
		tmp = t_2;
	} else if (x <= 2.8e-304) {
		tmp = t_1;
	} else if (x <= 6.6e-170) {
		tmp = t_3;
	} 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) :: t_3
    real(8) :: tmp
    t_1 = 2.0d0 * (z * t)
    t_2 = 2.0d0 * (x * y)
    t_3 = (c * (-2.0d0)) * (a * i)
    if (x <= (-5d+231)) then
        tmp = t_2
    else if (x <= (-1.55d+190)) then
        tmp = t_1
    else if (x <= (-6.2d+128)) then
        tmp = t_2
    else if (x <= (-3.15d+43)) then
        tmp = t_3
    else if (x <= (-1.1d+31)) then
        tmp = t_2
    else if (x <= 2.8d-304) then
        tmp = t_1
    else if (x <= 6.6d-170) then
        tmp = t_3
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (z * t);
	double t_2 = 2.0 * (x * y);
	double t_3 = (c * -2.0) * (a * i);
	double tmp;
	if (x <= -5e+231) {
		tmp = t_2;
	} else if (x <= -1.55e+190) {
		tmp = t_1;
	} else if (x <= -6.2e+128) {
		tmp = t_2;
	} else if (x <= -3.15e+43) {
		tmp = t_3;
	} else if (x <= -1.1e+31) {
		tmp = t_2;
	} else if (x <= 2.8e-304) {
		tmp = t_1;
	} else if (x <= 6.6e-170) {
		tmp = t_3;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (z * t)
	t_2 = 2.0 * (x * y)
	t_3 = (c * -2.0) * (a * i)
	tmp = 0
	if x <= -5e+231:
		tmp = t_2
	elif x <= -1.55e+190:
		tmp = t_1
	elif x <= -6.2e+128:
		tmp = t_2
	elif x <= -3.15e+43:
		tmp = t_3
	elif x <= -1.1e+31:
		tmp = t_2
	elif x <= 2.8e-304:
		tmp = t_1
	elif x <= 6.6e-170:
		tmp = t_3
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(z * t))
	t_2 = Float64(2.0 * Float64(x * y))
	t_3 = Float64(Float64(c * -2.0) * Float64(a * i))
	tmp = 0.0
	if (x <= -5e+231)
		tmp = t_2;
	elseif (x <= -1.55e+190)
		tmp = t_1;
	elseif (x <= -6.2e+128)
		tmp = t_2;
	elseif (x <= -3.15e+43)
		tmp = t_3;
	elseif (x <= -1.1e+31)
		tmp = t_2;
	elseif (x <= 2.8e-304)
		tmp = t_1;
	elseif (x <= 6.6e-170)
		tmp = t_3;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * (z * t);
	t_2 = 2.0 * (x * y);
	t_3 = (c * -2.0) * (a * i);
	tmp = 0.0;
	if (x <= -5e+231)
		tmp = t_2;
	elseif (x <= -1.55e+190)
		tmp = t_1;
	elseif (x <= -6.2e+128)
		tmp = t_2;
	elseif (x <= -3.15e+43)
		tmp = t_3;
	elseif (x <= -1.1e+31)
		tmp = t_2;
	elseif (x <= 2.8e-304)
		tmp = t_1;
	elseif (x <= 6.6e-170)
		tmp = t_3;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(c * -2.0), $MachinePrecision] * N[(a * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e+231], t$95$2, If[LessEqual[x, -1.55e+190], t$95$1, If[LessEqual[x, -6.2e+128], t$95$2, If[LessEqual[x, -3.15e+43], t$95$3, If[LessEqual[x, -1.1e+31], t$95$2, If[LessEqual[x, 2.8e-304], t$95$1, If[LessEqual[x, 6.6e-170], t$95$3, t$95$2]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \leq -1.55 \cdot 10^{+190}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq -6.2 \cdot 10^{+128}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -3.15 \cdot 10^{+43}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq -1.1 \cdot 10^{+31}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 2.8 \cdot 10^{-304}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 6.6 \cdot 10^{-170}:\\
\;\;\;\;t_3\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.00000000000000028e231 or -1.5500000000000001e190 < x < -6.20000000000000008e128 or -3.1499999999999999e43 < x < -1.10000000000000005e31 or 6.60000000000000007e-170 < x

    1. Initial program 89.7%

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

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

    if -5.00000000000000028e231 < x < -1.5500000000000001e190 or -1.10000000000000005e31 < x < 2.7999999999999998e-304

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

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

    if -6.20000000000000008e128 < x < -3.1499999999999999e43 or 2.7999999999999998e-304 < x < 6.60000000000000007e-170

    1. Initial program 86.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. Taylor expanded in i around inf 70.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+231}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;x \leq -1.55 \cdot 10^{+190}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \leq -6.2 \cdot 10^{+128}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;x \leq -3.15 \cdot 10^{+43}:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \left(a \cdot i\right)\\ \mathbf{elif}\;x \leq -1.1 \cdot 10^{+31}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;x \leq 2.8 \cdot 10^{-304}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \leq 6.6 \cdot 10^{-170}:\\ \;\;\;\;\left(c \cdot -2\right) \cdot \left(a \cdot i\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \end{array} \]

Alternative 7: 79.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.65 \cdot 10^{-108} \lor \neg \left(c \leq 5.8 \cdot 10^{-56}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.6500000000000001e-108 or 5.79999999999999982e-56 < c

    1. Initial program 84.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. Taylor expanded in x around 0 82.7%

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

    if -1.6500000000000001e-108 < c < 5.79999999999999982e-56

    1. Initial program 100.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.65 \cdot 10^{-108} \lor \neg \left(c \leq 5.8 \cdot 10^{-56}\right):\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 8: 86.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3 \cdot 10^{+65} \lor \neg \left(c \leq 9.5 \cdot 10^{-48}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.0000000000000002e65 or 9.50000000000000036e-48 < c

    1. Initial program 80.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. Taylor expanded in x around 0 86.4%

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

    if -3.0000000000000002e65 < c < 9.50000000000000036e-48

    1. Initial program 99.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3 \cdot 10^{+65} \lor \neg \left(c \leq 9.5 \cdot 10^{-48}\right):\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - i \cdot \left(a \cdot c\right)\right)\\ \end{array} \]

Alternative 9: 68.2% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.02 \cdot 10^{+84} \lor \neg \left(c \leq 2.9 \cdot 10^{+23} \lor \neg \left(c \leq 2.05 \cdot 10^{+38}\right) \land c \leq 2.55 \cdot 10^{+135}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.0199999999999999e84 or 2.90000000000000013e23 < c < 2.0500000000000002e38 or 2.54999999999999991e135 < c

    1. Initial program 78.2%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. associate-*l*87.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. fma-def87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto -2 \cdot \left(\color{blue}{\left(b \cdot \left(c \cdot i\right)\right)} \cdot c\right) \]
      9. *-commutative73.0%

        \[\leadsto -2 \cdot \color{blue}{\left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)} \]
      10. *-commutative73.0%

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

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

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

    if -1.0199999999999999e84 < c < 2.90000000000000013e23 or 2.0500000000000002e38 < c < 2.54999999999999991e135

    1. Initial program 96.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.02 \cdot 10^{+84} \lor \neg \left(c \leq 2.9 \cdot 10^{+23} \lor \neg \left(c \leq 2.05 \cdot 10^{+38}\right) \land c \leq 2.55 \cdot 10^{+135}\right):\\ \;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 10: 68.4% accurate, 1.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -5.8 \cdot 10^{+84}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\

\mathbf{elif}\;c \leq 2.5 \cdot 10^{+22} \lor \neg \left(c \leq 4.5 \cdot 10^{+37}\right) \land c \leq 1.95 \cdot 10^{+135}:\\
\;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\

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


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

    1. Initial program 85.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(c \cdot \left(-i\right)\right) \cdot \left(c \cdot b\right)\right)} \]
      10. associate-*l*71.5%

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

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

    if -5.79999999999999977e84 < c < 2.4999999999999998e22 or 4.49999999999999962e37 < c < 1.95000000000000016e135

    1. Initial program 96.1%

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

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

    if 2.4999999999999998e22 < c < 4.49999999999999962e37 or 1.95000000000000016e135 < 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. Step-by-step derivation
      1. associate-*l*85.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.8 \cdot 10^{+84}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+22} \lor \neg \left(c \leq 4.5 \cdot 10^{+37}\right) \land c \leq 1.95 \cdot 10^{+135}:\\ \;\;\;\;\left(z \cdot t + x \cdot y\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 11: 71.8% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.6500000000000001e-108 or 112 < c

    1. Initial program 83.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. Taylor expanded in i around inf 71.8%

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

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

    if -1.6500000000000001e-108 < c < 112

    1. Initial program 99.9%

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

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

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

Alternative 12: 36.0% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \leq -5 \cdot 10^{+231} \lor \neg \left(x \leq -1.52 \cdot 10^{+190} \lor \neg \left(x \leq -9.5 \cdot 10^{+30}\right) \land x \leq 1.25 \cdot 10^{-242}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.00000000000000028e231 or -1.5199999999999999e190 < x < -9.5000000000000003e30 or 1.25e-242 < x

    1. Initial program 88.6%

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

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

    if -5.00000000000000028e231 < x < -1.5199999999999999e190 or -9.5000000000000003e30 < x < 1.25e-242

    1. Initial program 93.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5 \cdot 10^{+231} \lor \neg \left(x \leq -1.52 \cdot 10^{+190} \lor \neg \left(x \leq -9.5 \cdot 10^{+30}\right) \land x \leq 1.25 \cdot 10^{-242}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 13: 29.1% 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.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. Taylor expanded in z around inf 28.0%

    \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z\right)} \]
  3. Final simplification28.0%

    \[\leadsto 2 \cdot \left(z \cdot t\right) \]

Developer target: 94.2% 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 2023240 
(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))))