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

Percentage Accurate: 89.8% → 96.2%
Time: 14.8s
Alternatives: 17
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 89.8% accurate, 1.0× speedup?

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

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

Alternative 1: 96.2% accurate, 0.5× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(c \cdot \left(t_1 \cdot \left(-i\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 92.0%

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

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

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

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

Alternative 2: 94.7% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := a + b \cdot c\\ t_2 := \left(c \cdot t_1\right) \cdot i\\ \mathbf{if}\;t_2 \leq -\infty:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(t_1 \cdot i\right)\right)\\ \mathbf{elif}\;t_2 \leq 5 \cdot 10^{+296}:\\ \;\;\;\;\left(\left(z \cdot t + x \cdot y\right) - t_2\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(t_1 \cdot \left(-i\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
   (if (<= t_2 (- INFINITY))
     (* 2.0 (- (* z t) (* c (* t_1 i))))
     (if (<= t_2 5e+296)
       (* (- (+ (* z t) (* x y)) t_2) 2.0)
       (* 2.0 (* c (* t_1 (- i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (c * t_1) * i;
	double tmp;
	if (t_2 <= -((double) INFINITY)) {
		tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
	} else if (t_2 <= 5e+296) {
		tmp = (((z * t) + (x * y)) - t_2) * 2.0;
	} else {
		tmp = 2.0 * (c * (t_1 * -i));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (c * t_1) * i;
	double tmp;
	if (t_2 <= -Double.POSITIVE_INFINITY) {
		tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
	} else if (t_2 <= 5e+296) {
		tmp = (((z * t) + (x * y)) - t_2) * 2.0;
	} else {
		tmp = 2.0 * (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) * i
	tmp = 0
	if t_2 <= -math.inf:
		tmp = 2.0 * ((z * t) - (c * (t_1 * i)))
	elif t_2 <= 5e+296:
		tmp = (((z * t) + (x * y)) - t_2) * 2.0
	else:
		tmp = 2.0 * (c * (t_1 * -i))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(Float64(c * t_1) * i)
	tmp = 0.0
	if (t_2 <= Float64(-Inf))
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(t_1 * i))));
	elseif (t_2 <= 5e+296)
		tmp = Float64(Float64(Float64(Float64(z * t) + Float64(x * y)) - t_2) * 2.0);
	else
		tmp = Float64(2.0 * Float64(c * Float64(t_1 * Float64(-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) * i;
	tmp = 0.0;
	if (t_2 <= -Inf)
		tmp = 2.0 * ((z * t) - (c * (t_1 * i)));
	elseif (t_2 <= 5e+296)
		tmp = (((z * t) + (x * y)) - t_2) * 2.0;
	else
		tmp = 2.0 * (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[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+296], N[(N[(N[(N[(z * t), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(2.0 * N[(c * N[(t$95$1 * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 80.9%

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.0000000000000001e296

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

    if 5.0000000000000001e296 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 72.7%

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

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

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

Alternative 3: 62.4% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;c \leq -4.5 \cdot 10^{-69}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c \leq -1 \cdot 10^{-275}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 2.05 \cdot 10^{-220}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c \leq 4.6 \cdot 10^{-152}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 10^{-11}:\\
\;\;\;\;t_4\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -2e22 or 9.99999999999999939e-12 < c

    1. Initial program 81.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 78.3%

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

    if -2e22 < c < -4.50000000000000009e-69 or -9.99999999999999934e-276 < c < 2.04999999999999995e-220 or 4.6000000000000003e-152 < c < 9.99999999999999939e-12

    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. Taylor expanded in z around 0 69.4%

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

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

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

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

    if -4.50000000000000009e-69 < c < -9.99999999999999934e-276 or 2.04999999999999995e-220 < c < 4.6000000000000003e-152

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2 \cdot 10^{+22}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -4.5 \cdot 10^{-69}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -1 \cdot 10^{-275}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.05 \cdot 10^{-220}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 4.6 \cdot 10^{-152}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 10^{-11}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \end{array} \]

Alternative 4: 62.6% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(a \cdot i\right)\\ t_2 := 2 \cdot \left(z \cdot t - t_1\right)\\ t_3 := 2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ t_4 := 2 \cdot \left(x \cdot y - t_1\right)\\ \mathbf{if}\;c \leq -2.7 \cdot 10^{+72}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq -1.15 \cdot 10^{-68}:\\ \;\;\;\;2 \cdot \left(x \cdot y - \left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -5.4 \cdot 10^{-276}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{-220}:\\ \;\;\;\;t_4\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{-149}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 1.8 \cdot 10^{-11}:\\ \;\;\;\;t_4\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* c (* a i)))
        (t_2 (* 2.0 (- (* z t) t_1)))
        (t_3 (* 2.0 (* c (* (+ a (* b c)) (- i)))))
        (t_4 (* 2.0 (- (* x y) t_1))))
   (if (<= c -2.7e+72)
     t_3
     (if (<= c -1.15e-68)
       (* 2.0 (- (* x y) (* (* c c) (* b i))))
       (if (<= c -5.4e-276)
         t_2
         (if (<= c 2.5e-220)
           t_4
           (if (<= c 4.2e-149) t_2 (if (<= c 1.8e-11) t_4 t_3))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = c * (a * i);
	double t_2 = 2.0 * ((z * t) - t_1);
	double t_3 = 2.0 * (c * ((a + (b * c)) * -i));
	double t_4 = 2.0 * ((x * y) - t_1);
	double tmp;
	if (c <= -2.7e+72) {
		tmp = t_3;
	} else if (c <= -1.15e-68) {
		tmp = 2.0 * ((x * y) - ((c * c) * (b * i)));
	} else if (c <= -5.4e-276) {
		tmp = t_2;
	} else if (c <= 2.5e-220) {
		tmp = t_4;
	} else if (c <= 4.2e-149) {
		tmp = t_2;
	} else if (c <= 1.8e-11) {
		tmp = t_4;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: t_4
    real(8) :: tmp
    t_1 = c * (a * i)
    t_2 = 2.0d0 * ((z * t) - t_1)
    t_3 = 2.0d0 * (c * ((a + (b * c)) * -i))
    t_4 = 2.0d0 * ((x * y) - t_1)
    if (c <= (-2.7d+72)) then
        tmp = t_3
    else if (c <= (-1.15d-68)) then
        tmp = 2.0d0 * ((x * y) - ((c * c) * (b * i)))
    else if (c <= (-5.4d-276)) then
        tmp = t_2
    else if (c <= 2.5d-220) then
        tmp = t_4
    else if (c <= 4.2d-149) then
        tmp = t_2
    else if (c <= 1.8d-11) then
        tmp = t_4
    else
        tmp = t_3
    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 * i);
	double t_2 = 2.0 * ((z * t) - t_1);
	double t_3 = 2.0 * (c * ((a + (b * c)) * -i));
	double t_4 = 2.0 * ((x * y) - t_1);
	double tmp;
	if (c <= -2.7e+72) {
		tmp = t_3;
	} else if (c <= -1.15e-68) {
		tmp = 2.0 * ((x * y) - ((c * c) * (b * i)));
	} else if (c <= -5.4e-276) {
		tmp = t_2;
	} else if (c <= 2.5e-220) {
		tmp = t_4;
	} else if (c <= 4.2e-149) {
		tmp = t_2;
	} else if (c <= 1.8e-11) {
		tmp = t_4;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = c * (a * i)
	t_2 = 2.0 * ((z * t) - t_1)
	t_3 = 2.0 * (c * ((a + (b * c)) * -i))
	t_4 = 2.0 * ((x * y) - t_1)
	tmp = 0
	if c <= -2.7e+72:
		tmp = t_3
	elif c <= -1.15e-68:
		tmp = 2.0 * ((x * y) - ((c * c) * (b * i)))
	elif c <= -5.4e-276:
		tmp = t_2
	elif c <= 2.5e-220:
		tmp = t_4
	elif c <= 4.2e-149:
		tmp = t_2
	elif c <= 1.8e-11:
		tmp = t_4
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(c * Float64(a * i))
	t_2 = Float64(2.0 * Float64(Float64(z * t) - t_1))
	t_3 = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i))))
	t_4 = Float64(2.0 * Float64(Float64(x * y) - t_1))
	tmp = 0.0
	if (c <= -2.7e+72)
		tmp = t_3;
	elseif (c <= -1.15e-68)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(Float64(c * c) * Float64(b * i))));
	elseif (c <= -5.4e-276)
		tmp = t_2;
	elseif (c <= 2.5e-220)
		tmp = t_4;
	elseif (c <= 4.2e-149)
		tmp = t_2;
	elseif (c <= 1.8e-11)
		tmp = t_4;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = c * (a * i);
	t_2 = 2.0 * ((z * t) - t_1);
	t_3 = 2.0 * (c * ((a + (b * c)) * -i));
	t_4 = 2.0 * ((x * y) - t_1);
	tmp = 0.0;
	if (c <= -2.7e+72)
		tmp = t_3;
	elseif (c <= -1.15e-68)
		tmp = 2.0 * ((x * y) - ((c * c) * (b * i)));
	elseif (c <= -5.4e-276)
		tmp = t_2;
	elseif (c <= 2.5e-220)
		tmp = t_4;
	elseif (c <= 4.2e-149)
		tmp = t_2;
	elseif (c <= 1.8e-11)
		tmp = t_4;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.7e+72], t$95$3, If[LessEqual[c, -1.15e-68], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(N[(c * c), $MachinePrecision] * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -5.4e-276], t$95$2, If[LessEqual[c, 2.5e-220], t$95$4, If[LessEqual[c, 4.2e-149], t$95$2, If[LessEqual[c, 1.8e-11], t$95$4, t$95$3]]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;c \leq -5.4 \cdot 10^{-276}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 2.5 \cdot 10^{-220}:\\
\;\;\;\;t_4\\

\mathbf{elif}\;c \leq 4.2 \cdot 10^{-149}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 1.8 \cdot 10^{-11}:\\
\;\;\;\;t_4\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -2.7000000000000001e72 or 1.79999999999999992e-11 < c

    1. Initial program 80.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 79.6%

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

    if -2.7000000000000001e72 < c < -1.14999999999999998e-68

    1. Initial program 99.9%

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

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

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

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

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

    if -1.14999999999999998e-68 < c < -5.39999999999999971e-276 or 2.5000000000000001e-220 < c < 4.20000000000000022e-149

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

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

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

    if -5.39999999999999971e-276 < c < 2.5000000000000001e-220 or 4.20000000000000022e-149 < c < 1.79999999999999992e-11

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.7 \cdot 10^{+72}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.15 \cdot 10^{-68}:\\ \;\;\;\;2 \cdot \left(x \cdot y - \left(c \cdot c\right) \cdot \left(b \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -5.4 \cdot 10^{-276}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{-220}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 4.2 \cdot 10^{-149}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 1.8 \cdot 10^{-11}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \end{array} \]

Alternative 5: 54.2% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;c \leq -1.75 \cdot 10^{-17}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;c \leq -5.8 \cdot 10^{-276}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 10^{-267}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 7.5 \cdot 10^{-12}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 77.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 79.6%

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

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

    if -2.1000000000000001e117 < c < -1.7500000000000001e-17 or -7.5e-69 < c < -5.79999999999999975e-276 or 9.9999999999999998e-268 < c < 7.5e-12

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

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

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

    if -1.7500000000000001e-17 < c < -7.5e-69 or -5.79999999999999975e-276 < c < 9.9999999999999998e-268

    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 x around inf 71.7%

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

    if 7.5e-12 < c

    1. Initial program 81.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.1 \cdot 10^{+117}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.75 \cdot 10^{-17}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -7.5 \cdot 10^{-69}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq -5.8 \cdot 10^{-276}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 10^{-267}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 7.5 \cdot 10^{-12}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right) \cdot \left(-2\right)\\ \end{array} \]

Alternative 6: 49.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot y\right)\\ t_2 := \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right) \cdot \left(-2\right)\\ t_3 := 2 \cdot \left(z \cdot t\right)\\ \mathbf{if}\;c \leq -1.36 \cdot 10^{+22}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{-68}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -2.12 \cdot 10^{-277}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 3.1 \cdot 10^{-201}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 2.9 \cdot 10^{-149}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 590:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (* x y)))
        (t_2 (* (* c (* c (* b i))) (- 2.0)))
        (t_3 (* 2.0 (* z t))))
   (if (<= c -1.36e+22)
     t_2
     (if (<= c -1.1e-68)
       t_1
       (if (<= c -2.12e-277)
         t_3
         (if (<= c 3.1e-201)
           t_1
           (if (<= c 2.9e-149) t_3 (if (<= c 590.0) t_1 t_2))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (x * y);
	double t_2 = (c * (c * (b * i))) * -2.0;
	double t_3 = 2.0 * (z * t);
	double tmp;
	if (c <= -1.36e+22) {
		tmp = t_2;
	} else if (c <= -1.1e-68) {
		tmp = t_1;
	} else if (c <= -2.12e-277) {
		tmp = t_3;
	} else if (c <= 3.1e-201) {
		tmp = t_1;
	} else if (c <= 2.9e-149) {
		tmp = t_3;
	} else if (c <= 590.0) {
		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) :: t_3
    real(8) :: tmp
    t_1 = 2.0d0 * (x * y)
    t_2 = (c * (c * (b * i))) * -2.0d0
    t_3 = 2.0d0 * (z * t)
    if (c <= (-1.36d+22)) then
        tmp = t_2
    else if (c <= (-1.1d-68)) then
        tmp = t_1
    else if (c <= (-2.12d-277)) then
        tmp = t_3
    else if (c <= 3.1d-201) then
        tmp = t_1
    else if (c <= 2.9d-149) then
        tmp = t_3
    else if (c <= 590.0d0) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (x * y);
	double t_2 = (c * (c * (b * i))) * -2.0;
	double t_3 = 2.0 * (z * t);
	double tmp;
	if (c <= -1.36e+22) {
		tmp = t_2;
	} else if (c <= -1.1e-68) {
		tmp = t_1;
	} else if (c <= -2.12e-277) {
		tmp = t_3;
	} else if (c <= 3.1e-201) {
		tmp = t_1;
	} else if (c <= 2.9e-149) {
		tmp = t_3;
	} else if (c <= 590.0) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (x * y)
	t_2 = (c * (c * (b * i))) * -2.0
	t_3 = 2.0 * (z * t)
	tmp = 0
	if c <= -1.36e+22:
		tmp = t_2
	elif c <= -1.1e-68:
		tmp = t_1
	elif c <= -2.12e-277:
		tmp = t_3
	elif c <= 3.1e-201:
		tmp = t_1
	elif c <= 2.9e-149:
		tmp = t_3
	elif c <= 590.0:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(x * y))
	t_2 = Float64(Float64(c * Float64(c * Float64(b * i))) * Float64(-2.0))
	t_3 = Float64(2.0 * Float64(z * t))
	tmp = 0.0
	if (c <= -1.36e+22)
		tmp = t_2;
	elseif (c <= -1.1e-68)
		tmp = t_1;
	elseif (c <= -2.12e-277)
		tmp = t_3;
	elseif (c <= 3.1e-201)
		tmp = t_1;
	elseif (c <= 2.9e-149)
		tmp = t_3;
	elseif (c <= 590.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * (x * y);
	t_2 = (c * (c * (b * i))) * -2.0;
	t_3 = 2.0 * (z * t);
	tmp = 0.0;
	if (c <= -1.36e+22)
		tmp = t_2;
	elseif (c <= -1.1e-68)
		tmp = t_1;
	elseif (c <= -2.12e-277)
		tmp = t_3;
	elseif (c <= 3.1e-201)
		tmp = t_1;
	elseif (c <= 2.9e-149)
		tmp = t_3;
	elseif (c <= 590.0)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-2.0)), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.36e+22], t$95$2, If[LessEqual[c, -1.1e-68], t$95$1, If[LessEqual[c, -2.12e-277], t$95$3, If[LessEqual[c, 3.1e-201], t$95$1, If[LessEqual[c, 2.9e-149], t$95$3, If[LessEqual[c, 590.0], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -1.1 \cdot 10^{-68}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -2.12 \cdot 10^{-277}:\\
\;\;\;\;t_3\\

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

\mathbf{elif}\;c \leq 2.9 \cdot 10^{-149}:\\
\;\;\;\;t_3\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.36e22 or 590 < c

    1. Initial program 80.5%

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

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

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

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

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

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

      \[\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 80.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.36e22 < c < -1.10000000000000001e-68 or -2.12e-277 < c < 3.0999999999999999e-201 or 2.9e-149 < c < 590

    1. Initial program 96.5%

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

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

    if -1.10000000000000001e-68 < c < -2.12e-277 or 3.0999999999999999e-201 < c < 2.9e-149

    1. Initial program 97.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.36 \cdot 10^{+22}:\\ \;\;\;\;\left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right) \cdot \left(-2\right)\\ \mathbf{elif}\;c \leq -1.1 \cdot 10^{-68}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq -2.12 \cdot 10^{-277}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 3.1 \cdot 10^{-201}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 2.9 \cdot 10^{-149}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 590:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right) \cdot \left(-2\right)\\ \end{array} \]

Alternative 7: 49.5% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;c \leq -3.2 \cdot 10^{-277}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 4.8 \cdot 10^{-201}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 9.5 \cdot 10^{-153}:\\
\;\;\;\;t_2\\

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

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


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

    1. Initial program 80.3%

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

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

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

    if -1.3e22 < c < -4.1999999999999999e-69 or -3.1999999999999998e-277 < c < 4.80000000000000018e-201 or 9.50000000000000031e-153 < c < 1300

    1. Initial program 96.5%

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

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

    if -4.1999999999999999e-69 < c < -3.1999999999999998e-277 or 4.80000000000000018e-201 < c < 9.50000000000000031e-153

    1. Initial program 97.5%

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

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

    if 1300 < c

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.3 \cdot 10^{+22}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -4.2 \cdot 10^{-69}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq -3.2 \cdot 10^{-277}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 4.8 \cdot 10^{-201}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 9.5 \cdot 10^{-153}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 1300:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;\left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right) \cdot \left(-2\right)\\ \end{array} \]

Alternative 8: 49.3% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq -1.15 \cdot 10^{-68}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -7.5 \cdot 10^{-277}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 2.8 \cdot 10^{-201}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 8.5 \cdot 10^{-152}:\\
\;\;\;\;t_3\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3e22 or 6.80000000000000031e-13 < c

    1. Initial program 81.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3e22 < c < -1.14999999999999998e-68 or -7.49999999999999971e-277 < c < 2.7999999999999999e-201 or 8.5000000000000007e-152 < c < 6.80000000000000031e-13

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

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

    if -1.14999999999999998e-68 < c < -7.49999999999999971e-277 or 2.7999999999999999e-201 < c < 8.5000000000000007e-152

    1. Initial program 97.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3 \cdot 10^{+22}:\\ \;\;\;\;b \cdot \left(\left(i \cdot \left(c \cdot c\right)\right) \cdot -2\right)\\ \mathbf{elif}\;c \leq -1.15 \cdot 10^{-68}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq -7.5 \cdot 10^{-277}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{-201}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 8.5 \cdot 10^{-152}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 6.8 \cdot 10^{-13}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(i \cdot \left(c \cdot c\right)\right) \cdot -2\right)\\ \end{array} \]

Alternative 9: 55.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq -5.2 \cdot 10^{-276}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 2 \cdot 10^{-220}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 1.4 \cdot 10^{-151}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 2.16 \cdot 10^{+21}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 77.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 79.6%

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

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

    if -2.79999999999999997e117 < c < -5.19999999999999969e-276 or 1.99999999999999998e-220 < c < 1.4e-151

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

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

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

    if -5.19999999999999969e-276 < c < 1.99999999999999998e-220 or 1.4e-151 < c < 2.16e21

    1. Initial program 96.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 72.3%

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

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

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

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

    if 2.16e21 < c

    1. Initial program 80.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 36.6% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;z \leq -2.1 \cdot 10^{+135}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -7.4 \cdot 10^{+70}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;z \leq -1.76 \cdot 10^{-280}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.9e157 or -2.1000000000000001e135 < z < -7.39999999999999977e70 or 3.2000000000000002e-122 < z

    1. Initial program 87.8%

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

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

    if -1.9e157 < z < -2.1000000000000001e135 or -7.00000000000000038e-11 < z < -1.76000000000000003e-280

    1. Initial program 89.2%

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

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

    if -7.39999999999999977e70 < z < -7.00000000000000038e-11

    1. Initial program 86.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 51.3%

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

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

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

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

    if -1.76000000000000003e-280 < z < 3.2000000000000002e-122

    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. Step-by-step derivation
      1. associate-*l*96.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.9 \cdot 10^{+157}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{+135}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \leq -7.4 \cdot 10^{+70}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-11}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;z \leq -1.76 \cdot 10^{-280}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;z \leq 3.2 \cdot 10^{-122}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot \left(-2\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 11: 69.4% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{-14} \lor \neg \left(z \leq -1.06 \cdot 10^{-277}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.10000000000000004e-14 or -1.06e-277 < z

    1. Initial program 88.3%

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

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

    if -3.10000000000000004e-14 < z < -1.06e-277

    1. Initial program 89.1%

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

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

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

        \[\leadsto 2 \cdot \left(y \cdot x - \color{blue}{\left(c \cdot c\right)} \cdot \left(i \cdot b\right)\right) \]
    5. Simplified66.0%

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

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

Alternative 12: 76.2% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\
\mathbf{if}\;t \leq -2.9 \cdot 10^{-176} \lor \neg \left(t \leq 8.6 \cdot 10^{+129}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -2.90000000000000006e-176 or 8.60000000000000042e129 < t

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

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

    if -2.90000000000000006e-176 < t < 8.60000000000000042e129

    1. Initial program 88.8%

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

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

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

Alternative 13: 86.7% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 79.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 0 92.9%

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

    if -1.3e52 < c < 6.79999999999999946e-55

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

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

    if 6.79999999999999946e-55 < c

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

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

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

Alternative 14: 38.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 2.36 \cdot 10^{-209}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.75 \cdot 10^{-158}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 4000000000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 1.65 \cdot 10^{+128}:\\
\;\;\;\;t_2\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -2.10000000000000018e-40 or 1.65e128 < t

    1. Initial program 89.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 45.0%

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

    if -2.10000000000000018e-40 < t < 2.3599999999999999e-209 or 1.75000000000000006e-158 < t < 4e12

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

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

    if 2.3599999999999999e-209 < t < 1.75000000000000006e-158 or 4e12 < t < 1.65e128

    1. Initial program 89.9%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -2.1 \cdot 10^{-40}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;t \leq 2.36 \cdot 10^{-209}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;t \leq 1.75 \cdot 10^{-158}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;t \leq 4000000000000:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;t \leq 1.65 \cdot 10^{+128}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 15: 38.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;t \leq 1.68 \cdot 10^{-208}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;t \leq 14000000000000:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.20000000000000008e-39 or 2.80000000000000009e126 < t

    1. Initial program 89.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 45.0%

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

    if -1.20000000000000008e-39 < t < 1.67999999999999997e-208 or 1.1000000000000001e-158 < t < 1.4e13

    1. Initial program 87.1%

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

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

    if 1.67999999999999997e-208 < t < 1.1000000000000001e-158

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

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

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

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

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

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

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

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

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

    if 1.4e13 < t < 2.80000000000000009e126

    1. Initial program 87.3%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.2 \cdot 10^{-39}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;t \leq 1.68 \cdot 10^{-208}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;t \leq 1.1 \cdot 10^{-158}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;t \leq 14000000000000:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;t \leq 2.8 \cdot 10^{+126}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(a \cdot \left(-i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]

Alternative 16: 39.2% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{-39} \lor \neg \left(t \leq 8 \cdot 10^{+129}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.2e-39 or 8e129 < t

    1. Initial program 89.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 45.0%

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

    if -5.2e-39 < t < 8e129

    1. Initial program 87.7%

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

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

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

Alternative 17: 29.4% 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 88.5%

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

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

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