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

Percentage Accurate: 89.9% → 95.7%
Time: 15.0s
Alternatives: 20
Speedup: 0.7×

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 20 alternatives:

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

Initial Program: 89.9% 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: 95.7% accurate, 0.1× 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 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\ \;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \mathsf{fma}\left(t, z, i \cdot \left(a \cdot \left(-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 (* i (* c t_1))) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 2.0 (fma t z (* i (* a (- 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 - (i * (c * t_1))) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * fma(t, z, (i * (a * -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(i * Float64(c * t_1))) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * fma(t, z, Float64(i * Float64(a * Float64(-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]}, Block[{t$95$2 = N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(t$95$2 - N[(i * N[(c * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(2.0 * N[(t$95$2 - N[(t$95$1 * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t * z + N[(i * N[(a * (-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 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, i \cdot \left(a \cdot \left(-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 97.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. fma-def97.2%

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

        \[\leadsto 2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \color{blue}{\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)}\right) \]
    3. Simplified99.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-def99.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. +-commutative99.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-rr99.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) \]

    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. Taylor expanded in a around inf 11.1%

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\sqrt[3]{{\left(a \cdot \left(c \cdot i\right)\right)}^{3}}}\right) \]
    7. Step-by-step derivation
      1. rem-cbrt-cube11.1%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, -\color{blue}{\left(c \cdot i\right) \cdot a}\right) \]
      6. associate-*r*55.6%

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(t, z, -\color{blue}{\left(c \cdot a\right) \cdot i}\right) \]
      9. distribute-lft-neg-in55.6%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(z \cdot t + x \cdot y\right) - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right) \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 \mathsf{fma}\left(t, z, i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \end{array} \]

Alternative 2: 94.6% accurate, 0.2× speedup?

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

\\
2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Derivation
  1. Initial program 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. Step-by-step derivation
    1. fma-def94.5%

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

      \[\leadsto 2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \color{blue}{\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)}\right) \]
  3. Simplified96.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. Final simplification96.4%

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

Alternative 3: 94.9% 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 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\ \;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\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
 (let* ((t_1 (+ a (* b c))) (t_2 (+ (* z t) (* x y))))
   (if (<= (- t_2 (* i (* c t_1))) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 2.0 (* z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (z * t) + (x * y);
	double tmp;
	if ((t_2 - (i * (c * t_1))) <= ((double) INFINITY)) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (z * t);
	}
	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 - (i * (c * t_1))) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * (z * t);
	}
	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 - (i * (c * t_1))) <= math.inf:
		tmp = 2.0 * (t_2 - (t_1 * (c * i)))
	else:
		tmp = 2.0 * (z * t)
	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(i * Float64(c * t_1))) <= Inf)
		tmp = Float64(2.0 * Float64(t_2 - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * Float64(z * t));
	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 - (i * (c * t_1))) <= Inf)
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	else
		tmp = 2.0 * (z * t);
	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[(i * N[(c * t$95$1), $MachinePrecision]), $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[(z * t), $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 - i \cdot \left(c \cdot t_1\right) \leq \infty:\\
\;\;\;\;2 \cdot \left(t_2 - t_1 \cdot \left(c \cdot i\right)\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t\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 97.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. fma-def97.2%

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

        \[\leadsto 2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \color{blue}{\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)}\right) \]
    3. Simplified99.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-def99.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. +-commutative99.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-rr99.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) \]

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(z \cdot t + x \cdot y\right) - i \cdot \left(c \cdot \left(a + b \cdot c\right)\right) \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(z \cdot t\right)\\ \end{array} \]

Alternative 4: 82.8% accurate, 0.7× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -4.99999999999999983e117

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

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

    if -4.99999999999999983e117 < (*.f64 z t) < -4.99999999999999997e-56 or 5.00000000000000041e-6 < (*.f64 z t)

    1. Initial program 94.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 a around 0 93.1%

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

    if -4.99999999999999997e-56 < (*.f64 z t) < 5.00000000000000041e-6

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

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

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

Alternative 5: 91.7% accurate, 0.7× speedup?

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

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

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


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

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

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

    1. Initial program 85.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 0 97.5%

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

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

Alternative 6: 73.1% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.05 \cdot 10^{-9}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\

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

\mathbf{elif}\;c \leq 8.2 \cdot 10^{+101}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\

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

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


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

    1. Initial program 93.2%

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

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

    if -1.0500000000000001e-9 < c < 3.8e20

    1. Initial program 95.5%

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

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

    if 3.8e20 < c < 8.1999999999999999e101

    1. Initial program 93.4%

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

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

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

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

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

    if 8.1999999999999999e101 < c < 3.7999999999999998e124

    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 a around inf 66.7%

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\sqrt[3]{{\left(a \cdot \left(c \cdot i\right)\right)}^{3}}}\right) \]
    7. Step-by-step derivation
      1. rem-cbrt-cube66.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.7999999999999998e124 < c

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
    3. Step-by-step derivation
      1. distribute-rgt-in82.8%

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

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

        \[\leadsto 2 \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot a + \color{blue}{\left(c \cdot b\right)} \cdot i\right)\right)\right) \]
    4. Applied egg-rr82.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.05 \cdot 10^{-9}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+20}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;c \leq 8.2 \cdot 10^{+101}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+124}:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t + c \cdot \left(a \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right) - \left(b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 7: 83.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;c \leq -5.2 \cdot 10^{-159} \lor \neg \left(c \leq 7.2 \cdot 10^{+95}\right):\\
\;\;\;\;2 \cdot \left(t_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -8.5e-9

    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 0 94.6%

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

    if -8.5e-9 < c < -5.1999999999999997e-159 or 7.19999999999999955e95 < c

    1. Initial program 89.6%

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

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

        \[\leadsto 2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \color{blue}{\left(a + b \cdot c\right) \cdot \left(c \cdot i\right)}\right) \]
    3. Simplified93.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.9%

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

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

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

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

    if -5.1999999999999997e-159 < c < 7.19999999999999955e95

    1. Initial program 97.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 a around inf 96.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.5 \cdot 10^{-9}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -5.2 \cdot 10^{-159} \lor \neg \left(c \leq 7.2 \cdot 10^{+95}\right):\\ \;\;\;\;2 \cdot \left(\left(z \cdot t + x \cdot y\right) - \left(b \cdot c\right) \cdot \left(c \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 8: 77.9% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 82.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 c around 0 94.1%

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

    if -7.19999999999999954e254 < (*.f64 x y) < 3.9e63

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

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

    if 3.9e63 < (*.f64 x y)

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

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

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

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

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

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

Alternative 9: 80.1% accurate, 0.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z t) < -1.00000000000000008e-5

    1. Initial program 92.4%

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

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

    if -1.00000000000000008e-5 < (*.f64 z t) < 5.0000000000000004e90

    1. Initial program 94.7%

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

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

    if 5.0000000000000004e90 < (*.f64 z t)

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

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

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

Alternative 10: 73.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq 3.9 \cdot 10^{+20}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 2.8 \cdot 10^{+60}:\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\

\mathbf{elif}\;c \leq 1.66 \cdot 10^{+92}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -6.99999999999999961e-10

    1. Initial program 93.2%

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

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

    if -6.99999999999999961e-10 < c < 3.9e20 or 2.8e60 < c < 1.65999999999999993e92

    1. Initial program 95.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 c around 0 78.5%

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

    if 3.9e20 < c < 2.8e60

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

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

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

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

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

    if 1.65999999999999993e92 < c

    1. Initial program 89.5%

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
    3. Step-by-step derivation
      1. distribute-rgt-in77.6%

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

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

        \[\leadsto 2 \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot a + \color{blue}{\left(c \cdot b\right)} \cdot i\right)\right)\right) \]
    4. Applied egg-rr77.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -7 \cdot 10^{-10}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq 3.9 \cdot 10^{+20}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{+60}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 1.66 \cdot 10^{+92}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right) - \left(b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 11: 69.2% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t + x \cdot y\right)\\ t_2 := 2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{if}\;c \leq -1.6 \cdot 10^{+92}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -4.9 \cdot 10^{-56}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 2.95 \cdot 10^{+20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 2.85 \cdot 10^{+103}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+124}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\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) (* x y))))
        (t_2 (* 2.0 (- (* z t) (* a (* c i))))))
   (if (<= c -1.6e+92)
     (* 2.0 (* c (* (* b c) (- i))))
     (if (<= c -4.9e-56)
       t_2
       (if (<= c 2.95e+20)
         t_1
         (if (<= c 2.85e+103)
           t_2
           (if (<= c 3.8e+124) t_1 (* 2.0 (* c (* b (* c (- i))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((z * t) + (x * y));
	double t_2 = 2.0 * ((z * t) - (a * (c * i)));
	double tmp;
	if (c <= -1.6e+92) {
		tmp = 2.0 * (c * ((b * c) * -i));
	} else if (c <= -4.9e-56) {
		tmp = t_2;
	} else if (c <= 2.95e+20) {
		tmp = t_1;
	} else if (c <= 2.85e+103) {
		tmp = t_2;
	} else if (c <= 3.8e+124) {
		tmp = t_1;
	} else {
		tmp = 2.0 * (c * (b * (c * -i)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = 2.0d0 * ((z * t) + (x * y))
    t_2 = 2.0d0 * ((z * t) - (a * (c * i)))
    if (c <= (-1.6d+92)) then
        tmp = 2.0d0 * (c * ((b * c) * -i))
    else if (c <= (-4.9d-56)) then
        tmp = t_2
    else if (c <= 2.95d+20) then
        tmp = t_1
    else if (c <= 2.85d+103) then
        tmp = t_2
    else if (c <= 3.8d+124) then
        tmp = t_1
    else
        tmp = 2.0d0 * (c * (b * (c * -i)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((z * t) + (x * y));
	double t_2 = 2.0 * ((z * t) - (a * (c * i)));
	double tmp;
	if (c <= -1.6e+92) {
		tmp = 2.0 * (c * ((b * c) * -i));
	} else if (c <= -4.9e-56) {
		tmp = t_2;
	} else if (c <= 2.95e+20) {
		tmp = t_1;
	} else if (c <= 2.85e+103) {
		tmp = t_2;
	} else if (c <= 3.8e+124) {
		tmp = t_1;
	} else {
		tmp = 2.0 * (c * (b * (c * -i)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * ((z * t) + (x * y))
	t_2 = 2.0 * ((z * t) - (a * (c * i)))
	tmp = 0
	if c <= -1.6e+92:
		tmp = 2.0 * (c * ((b * c) * -i))
	elif c <= -4.9e-56:
		tmp = t_2
	elif c <= 2.95e+20:
		tmp = t_1
	elif c <= 2.85e+103:
		tmp = t_2
	elif c <= 3.8e+124:
		tmp = t_1
	else:
		tmp = 2.0 * (c * (b * (c * -i)))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(z * t) + Float64(x * y)))
	t_2 = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i))))
	tmp = 0.0
	if (c <= -1.6e+92)
		tmp = Float64(2.0 * Float64(c * Float64(Float64(b * c) * Float64(-i))));
	elseif (c <= -4.9e-56)
		tmp = t_2;
	elseif (c <= 2.95e+20)
		tmp = t_1;
	elseif (c <= 2.85e+103)
		tmp = t_2;
	elseif (c <= 3.8e+124)
		tmp = t_1;
	else
		tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-i)))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * ((z * t) + (x * y));
	t_2 = 2.0 * ((z * t) - (a * (c * i)));
	tmp = 0.0;
	if (c <= -1.6e+92)
		tmp = 2.0 * (c * ((b * c) * -i));
	elseif (c <= -4.9e-56)
		tmp = t_2;
	elseif (c <= 2.95e+20)
		tmp = t_1;
	elseif (c <= 2.85e+103)
		tmp = t_2;
	elseif (c <= 3.8e+124)
		tmp = t_1;
	else
		tmp = 2.0 * (c * (b * (c * -i)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.6e+92], N[(2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -4.9e-56], t$95$2, If[LessEqual[c, 2.95e+20], t$95$1, If[LessEqual[c, 2.85e+103], t$95$2, If[LessEqual[c, 3.8e+124], t$95$1, N[(2.0 * N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -4.9 \cdot 10^{-56}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 2.95 \cdot 10^{+20}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 2.85 \cdot 10^{+103}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 3.8 \cdot 10^{+124}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -1.60000000000000013e92

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

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

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

    if -1.60000000000000013e92 < c < -4.9e-56 or 2.95e20 < c < 2.85000000000000016e103

    1. Initial program 90.9%

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

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

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

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

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

    if -4.9e-56 < c < 2.95e20 or 2.85000000000000016e103 < c < 3.7999999999999998e124

    1. Initial program 96.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 c around 0 79.3%

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

    if 3.7999999999999998e124 < c

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.6 \cdot 10^{+92}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -4.9 \cdot 10^{-56}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.95 \cdot 10^{+20}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;c \leq 2.85 \cdot 10^{+103}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+124}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]

Alternative 12: 74.3% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq 2.65 \cdot 10^{+20}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 2.1 \cdot 10^{+90}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -8.00000000000000029e-10 or 2.09999999999999981e90 < c

    1. Initial program 91.5%

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

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

    if -8.00000000000000029e-10 < c < 2.65e20 or 4.99999999999999986e58 < c < 2.09999999999999981e90

    1. Initial program 95.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 c around 0 78.5%

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

    if 2.65e20 < c < 4.99999999999999986e58

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8 \cdot 10^{-10}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.65 \cdot 10^{+20}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{elif}\;c \leq 5 \cdot 10^{+58}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.1 \cdot 10^{+90}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(i \cdot \left(\left(-a\right) - b \cdot c\right)\right)\right)\\ \end{array} \]

Alternative 13: 43.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := 2 \cdot \left(x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -1.3 \cdot 10^{+34}:\\
\;\;\;\;t_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1.29999999999999999e34 or 1.1499999999999999e67 < (*.f64 x y)

    1. Initial program 91.2%

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

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

    if -1.29999999999999999e34 < (*.f64 x y) < 2.80000000000000015e-96

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

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

    if 2.80000000000000015e-96 < (*.f64 x y) < 1.1499999999999999e67

    1. Initial program 93.3%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.3 \cdot 10^{+34}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;x \cdot y \leq 2.8 \cdot 10^{-96}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 1.15 \cdot 10^{+67}:\\ \;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \end{array} \]

Alternative 14: 86.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.25 \cdot 10^{-9} \lor \neg \left(c \leq 3 \cdot 10^{+64}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - 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 -1.25e-9) (not (<= c 3e+64)))
   (* 2.0 (- (* x y) (* 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 <= -1.25e-9) || !(c <= 3e+64)) {
		tmp = 2.0 * ((x * y) - (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 <= (-1.25d-9)) .or. (.not. (c <= 3d+64))) then
        tmp = 2.0d0 * ((x * y) - (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 <= -1.25e-9) || !(c <= 3e+64)) {
		tmp = 2.0 * ((x * y) - (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 <= -1.25e-9) or not (c <= 3e+64):
		tmp = 2.0 * ((x * y) - (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 <= -1.25e-9) || !(c <= 3e+64))
		tmp = Float64(2.0 * Float64(Float64(x * y) - 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 <= -1.25e-9) || ~((c <= 3e+64)))
		tmp = 2.0 * ((x * y) - (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, -1.25e-9], N[Not[LessEqual[c, 3e+64]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $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 -1.25 \cdot 10^{-9} \lor \neg \left(c \leq 3 \cdot 10^{+64}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - 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 < -1.25e-9 or 3.0000000000000002e64 < c

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

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

    if -1.25e-9 < c < 3.0000000000000002e64

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot a\right)} \cdot i\right) \]
    4. Simplified89.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 -1.25 \cdot 10^{-9} \lor \neg \left(c \leq 3 \cdot 10^{+64}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - 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 15: 66.7% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;c \leq -1.25 \cdot 10^{-9} \lor \neg \left(c \leq 3.8 \cdot 10^{+124}\right):\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -4.59999999999999982e91 or -2.79999999999999987e-6 < c < -1.25e-9 or 3.7999999999999998e124 < c

    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 i around inf 85.6%

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

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

    if -4.59999999999999982e91 < c < -2.79999999999999987e-6

    1. Initial program 93.0%

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

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

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

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

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

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

    if -1.25e-9 < c < 3.7999999999999998e124

    1. Initial program 95.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.6 \cdot 10^{+91}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -2.8 \cdot 10^{-6}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.25 \cdot 10^{-9} \lor \neg \left(c \leq 3.8 \cdot 10^{+124}\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \end{array} \]

Alternative 16: 66.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;c \leq -0.000105:\\
\;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\

\mathbf{elif}\;c \leq -7.5 \cdot 10^{-13}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -3.00000000000000013e92 or -1.05e-4 < c < -7.5000000000000004e-13

    1. Initial program 91.3%

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

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

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

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

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

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

    if -3.00000000000000013e92 < c < -1.05e-4

    1. Initial program 93.0%

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

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

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

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

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

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

    if -7.5000000000000004e-13 < c < 7.0000000000000002e124

    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 75.4%

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

    if 7.0000000000000002e124 < c

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3 \cdot 10^{+92}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -0.000105:\\ \;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -7.5 \cdot 10^{-13}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq 7 \cdot 10^{+124}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]

Alternative 17: 66.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;c \leq -0.000135:\\
\;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\

\mathbf{elif}\;c \leq -7.5 \cdot 10^{-13}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c < -2.19999999999999992e92

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

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

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

    if -2.19999999999999992e92 < c < -1.35000000000000002e-4

    1. Initial program 93.0%

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

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

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

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

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

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

    if -1.35000000000000002e-4 < c < -7.5000000000000004e-13

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

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

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

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

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

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

    if -7.5000000000000004e-13 < c < 3.99999999999999979e124

    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 75.4%

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

    if 3.99999999999999979e124 < c

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.2 \cdot 10^{+92}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -0.000135:\\ \;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -7.5 \cdot 10^{-13}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq 4 \cdot 10^{+124}:\\ \;\;\;\;2 \cdot \left(z \cdot t + x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]

Alternative 18: 44.3% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -4.8 \cdot 10^{+33} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+55}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -4.8e33 or 1.10000000000000005e55 < (*.f64 x y)

    1. Initial program 91.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 inf 59.5%

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

    if -4.8e33 < (*.f64 x y) < 1.10000000000000005e55

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -4.8 \cdot 10^{+33} \lor \neg \left(x \cdot y \leq 1.1 \cdot 10^{+55}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 19: 55.1% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.9 \cdot 10^{-10} \lor \neg \left(c \leq 6.5 \cdot 10^{+199}\right):\\
\;\;\;\;2 \cdot \left(a \cdot \left(c \cdot \left(-i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.9e-10 or 6.5000000000000003e199 < c

    1. Initial program 91.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 a around inf 37.0%

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

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

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

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

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

    if -3.9e-10 < c < 6.5000000000000003e199

    1. Initial program 94.7%

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

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

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

Alternative 20: 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 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 31.1%

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

    \[\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 2023310 
(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))))