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

Percentage Accurate: 89.6% → 95.2%
Time: 14.2s
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.6% accurate, 1.0× speedup?

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

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

Alternative 1: 95.2% accurate, 0.1× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(z, t, \mathsf{fma}\left(c, i \cdot \left(-\mathsf{fma}\left(b, c, a\right)\right), x \cdot y\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)) < 9.99999999999999955e282

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

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

    1. Initial program 75.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 96.0% accurate, 0.1× speedup?

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

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

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


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

    1. Initial program 94.9%

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

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

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

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

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

Alternative 3: 92.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t_3 \leq 10^{+274}:\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(c \cdot \left(b \cdot c\right) + a \cdot c\right)\right)\\

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


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

    1. Initial program 71.7%

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

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

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

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

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

    if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.99999999999999921e273

    1. Initial program 98.3%

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

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

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

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

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

    if 9.99999999999999921e273 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 65.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 86.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \cdot \left(a + b \cdot c\right) \leq -\infty:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \cdot \left(a + b \cdot c\right) \leq 10^{+274}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(c \cdot \left(b \cdot c\right) + 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 4: 92.7% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t_3 \leq 10^{+274}:\\
\;\;\;\;\left(t_1 - t_3 \cdot i\right) \cdot 2\\

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


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

    1. Initial program 71.7%

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

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

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

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

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

    if -inf.0 < (*.f64 (+.f64 a (*.f64 b c)) c) < 9.99999999999999921e273

    1. Initial program 98.3%

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

    if 9.99999999999999921e273 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 65.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 86.8%

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

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

Alternative 5: 77.7% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.4 \cdot 10^{+18} \lor \neg \left(c \leq -6.4 \cdot 10^{-37} \lor \neg \left(c \leq -5.8 \cdot 10^{-160}\right) \land c \leq 3.8 \cdot 10^{-70}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -4.4e18 or -6.3999999999999998e-37 < c < -5.7999999999999998e-160 or 3.7999999999999998e-70 < c

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

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

    if -4.4e18 < c < -6.3999999999999998e-37 or -5.7999999999999998e-160 < c < 3.7999999999999998e-70

    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) \]
    2. Taylor expanded in c around 0 91.3%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.4 \cdot 10^{+18} \lor \neg \left(c \leq -6.4 \cdot 10^{-37} \lor \neg \left(c \leq -5.8 \cdot 10^{-160}\right) \land c \leq 3.8 \cdot 10^{-70}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]

Alternative 6: 75.7% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{if}\;c \leq -2.7 \cdot 10^{+63}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.85 \cdot 10^{-63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -5.4 \cdot 10^{-160}:\\ \;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 3 \cdot 10^{-50}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* z t) (* c (* (+ a (* b c)) i))))))
   (if (<= c -2.7e+63)
     (* 2.0 (- (* x y) (* c (* c (* b i)))))
     (if (<= c -1.85e-63)
       t_1
       (if (<= c -5.4e-160)
         (* 2.0 (- (* x y) (* i (* a c))))
         (if (<= c 3e-50) (* (+ (* x y) (* z t)) 2.0) 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 * ((z * t) - (c * ((a + (b * c)) * i)));
	double tmp;
	if (c <= -2.7e+63) {
		tmp = 2.0 * ((x * y) - (c * (c * (b * i))));
	} else if (c <= -1.85e-63) {
		tmp = t_1;
	} else if (c <= -5.4e-160) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else if (c <= 3e-50) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * ((z * t) - (c * ((a + (b * c)) * i)))
    if (c <= (-2.7d+63)) then
        tmp = 2.0d0 * ((x * y) - (c * (c * (b * i))))
    else if (c <= (-1.85d-63)) then
        tmp = t_1
    else if (c <= (-5.4d-160)) then
        tmp = 2.0d0 * ((x * y) - (i * (a * c)))
    else if (c <= 3d-50) then
        tmp = ((x * y) + (z * t)) * 2.0d0
    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 * ((z * t) - (c * ((a + (b * c)) * i)));
	double tmp;
	if (c <= -2.7e+63) {
		tmp = 2.0 * ((x * y) - (c * (c * (b * i))));
	} else if (c <= -1.85e-63) {
		tmp = t_1;
	} else if (c <= -5.4e-160) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else if (c <= 3e-50) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)))
	tmp = 0
	if c <= -2.7e+63:
		tmp = 2.0 * ((x * y) - (c * (c * (b * i))))
	elif c <= -1.85e-63:
		tmp = t_1
	elif c <= -5.4e-160:
		tmp = 2.0 * ((x * y) - (i * (a * c)))
	elif c <= 3e-50:
		tmp = ((x * y) + (z * t)) * 2.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(z * t) - Float64(c * Float64(Float64(a + Float64(b * c)) * i))))
	tmp = 0.0
	if (c <= -2.7e+63)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(c * Float64(b * i)))));
	elseif (c <= -1.85e-63)
		tmp = t_1;
	elseif (c <= -5.4e-160)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c))));
	elseif (c <= 3e-50)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * ((z * t) - (c * ((a + (b * c)) * i)));
	tmp = 0.0;
	if (c <= -2.7e+63)
		tmp = 2.0 * ((x * y) - (c * (c * (b * i))));
	elseif (c <= -1.85e-63)
		tmp = t_1;
	elseif (c <= -5.4e-160)
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	elseif (c <= 3e-50)
		tmp = ((x * y) + (z * t)) * 2.0;
	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[(N[(z * t), $MachinePrecision] - N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.7e+63], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.85e-63], t$95$1, If[LessEqual[c, -5.4e-160], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3e-50], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -1.85 \cdot 10^{-63}:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 73.7%

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

      \[\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 inf 81.3%

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

    if -2.70000000000000017e63 < c < -1.85000000000000006e-63 or 2.9999999999999999e-50 < c

    1. Initial program 87.4%

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

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

    if -1.85000000000000006e-63 < c < -5.40000000000000019e-160

    1. Initial program 99.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 85.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 82.1%

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

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

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

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

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

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

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

    if -5.40000000000000019e-160 < c < 2.9999999999999999e-50

    1. Initial program 97.7%

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

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

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

Alternative 7: 47.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq -4.1 \cdot 10^{-160}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -6.2 \cdot 10^{-220}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 6.2 \cdot 10^{-115}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 3.3 \cdot 10^{-84}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 1.05 \cdot 10^{+17}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.7e18 or 1.05e17 < c

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.7e18 < c < -4.10000000000000002e-160 or -6.20000000000000023e-220 < c < 6.20000000000000013e-115 or 3.29999999999999984e-84 < c < 1.05e17

    1. Initial program 99.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 53.2%

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

    if -4.10000000000000002e-160 < c < -6.20000000000000023e-220 or 6.20000000000000013e-115 < c < 3.29999999999999984e-84

    1. Initial program 94.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+18}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -4.1 \cdot 10^{-160}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq -6.2 \cdot 10^{-220}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 6.2 \cdot 10^{-115}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 3.3 \cdot 10^{-84}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.05 \cdot 10^{+17}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 8: 69.8% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ t_2 := i \cdot \left(a \cdot c\right)\\ \mathbf{if}\;c \leq -1.85 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -7.5 \cdot 10^{-40}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t_2\right)\\ \mathbf{elif}\;c \leq -5.8 \cdot 10^{-160}:\\ \;\;\;\;2 \cdot \left(x \cdot y - t_2\right)\\ \mathbf{elif}\;c \leq 2.05 \cdot 10^{+17}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* x y) (* c (* c (* b i)))))) (t_2 (* i (* a c))))
   (if (<= c -1.85e+27)
     t_1
     (if (<= c -7.5e-40)
       (* 2.0 (- (* z t) t_2))
       (if (<= c -5.8e-160)
         (* 2.0 (- (* x y) t_2))
         (if (<= c 2.05e+17) (* (+ (* x y) (* z t)) 2.0) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((x * y) - (c * (c * (b * i))));
	double t_2 = i * (a * c);
	double tmp;
	if (c <= -1.85e+27) {
		tmp = t_1;
	} else if (c <= -7.5e-40) {
		tmp = 2.0 * ((z * t) - t_2);
	} else if (c <= -5.8e-160) {
		tmp = 2.0 * ((x * y) - t_2);
	} else if (c <= 2.05e+17) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} 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) :: tmp
    t_1 = 2.0d0 * ((x * y) - (c * (c * (b * i))))
    t_2 = i * (a * c)
    if (c <= (-1.85d+27)) then
        tmp = t_1
    else if (c <= (-7.5d-40)) then
        tmp = 2.0d0 * ((z * t) - t_2)
    else if (c <= (-5.8d-160)) then
        tmp = 2.0d0 * ((x * y) - t_2)
    else if (c <= 2.05d+17) then
        tmp = ((x * y) + (z * t)) * 2.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * ((x * y) - (c * (c * (b * i))));
	double t_2 = i * (a * c);
	double tmp;
	if (c <= -1.85e+27) {
		tmp = t_1;
	} else if (c <= -7.5e-40) {
		tmp = 2.0 * ((z * t) - t_2);
	} else if (c <= -5.8e-160) {
		tmp = 2.0 * ((x * y) - t_2);
	} else if (c <= 2.05e+17) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * ((x * y) - (c * (c * (b * i))))
	t_2 = i * (a * c)
	tmp = 0
	if c <= -1.85e+27:
		tmp = t_1
	elif c <= -7.5e-40:
		tmp = 2.0 * ((z * t) - t_2)
	elif c <= -5.8e-160:
		tmp = 2.0 * ((x * y) - t_2)
	elif c <= 2.05e+17:
		tmp = ((x * y) + (z * t)) * 2.0
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(c * Float64(b * i)))))
	t_2 = Float64(i * Float64(a * c))
	tmp = 0.0
	if (c <= -1.85e+27)
		tmp = t_1;
	elseif (c <= -7.5e-40)
		tmp = Float64(2.0 * Float64(Float64(z * t) - t_2));
	elseif (c <= -5.8e-160)
		tmp = Float64(2.0 * Float64(Float64(x * y) - t_2));
	elseif (c <= 2.05e+17)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * ((x * y) - (c * (c * (b * i))));
	t_2 = i * (a * c);
	tmp = 0.0;
	if (c <= -1.85e+27)
		tmp = t_1;
	elseif (c <= -7.5e-40)
		tmp = 2.0 * ((z * t) - t_2);
	elseif (c <= -5.8e-160)
		tmp = 2.0 * ((x * y) - t_2);
	elseif (c <= 2.05e+17)
		tmp = ((x * y) + (z * t)) * 2.0;
	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[(N[(x * y), $MachinePrecision] - N[(c * N[(c * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.85e+27], t$95$1, If[LessEqual[c, -7.5e-40], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -5.8e-160], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.05e+17], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -7.5 \cdot 10^{-40}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_2\right)\\

\mathbf{elif}\;c \leq -5.8 \cdot 10^{-160}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_2\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -1.85000000000000001e27 or 2.05e17 < c

    1. Initial program 78.2%

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

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

    if -1.85000000000000001e27 < c < -7.50000000000000069e-40

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

    if -7.50000000000000069e-40 < c < -5.7999999999999998e-160

    1. Initial program 99.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 85.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 c around 0 76.3%

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

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

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

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

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

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

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

    if -5.7999999999999998e-160 < c < 2.05e17

    1. Initial program 98.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.85 \cdot 10^{+27}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -7.5 \cdot 10^{-40}:\\ \;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq -5.8 \cdot 10^{-160}:\\ \;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 2.05 \cdot 10^{+17}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 9: 73.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\ t_2 := -2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{if}\;c \leq -8 \cdot 10^{+18}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -3.2 \cdot 10^{-63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -5.8 \cdot 10^{-160}:\\ \;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 3.6 \cdot 10^{+33}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
        (t_2 (* -2.0 (* c (* (+ a (* b c)) i)))))
   (if (<= c -8e+18)
     t_2
     (if (<= c -3.2e-63)
       t_1
       (if (<= c -5.8e-160)
         (* 2.0 (- (* x y) (* i (* a c))))
         (if (<= c 3.6e+33) 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 = ((x * y) + (z * t)) * 2.0;
	double t_2 = -2.0 * (c * ((a + (b * c)) * i));
	double tmp;
	if (c <= -8e+18) {
		tmp = t_2;
	} else if (c <= -3.2e-63) {
		tmp = t_1;
	} else if (c <= -5.8e-160) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else if (c <= 3.6e+33) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((x * y) + (z * t)) * 2.0d0
    t_2 = (-2.0d0) * (c * ((a + (b * c)) * i))
    if (c <= (-8d+18)) then
        tmp = t_2
    else if (c <= (-3.2d-63)) then
        tmp = t_1
    else if (c <= (-5.8d-160)) then
        tmp = 2.0d0 * ((x * y) - (i * (a * c)))
    else if (c <= 3.6d+33) 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 = ((x * y) + (z * t)) * 2.0;
	double t_2 = -2.0 * (c * ((a + (b * c)) * i));
	double tmp;
	if (c <= -8e+18) {
		tmp = t_2;
	} else if (c <= -3.2e-63) {
		tmp = t_1;
	} else if (c <= -5.8e-160) {
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	} else if (c <= 3.6e+33) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((x * y) + (z * t)) * 2.0
	t_2 = -2.0 * (c * ((a + (b * c)) * i))
	tmp = 0
	if c <= -8e+18:
		tmp = t_2
	elif c <= -3.2e-63:
		tmp = t_1
	elif c <= -5.8e-160:
		tmp = 2.0 * ((x * y) - (i * (a * c)))
	elif c <= 3.6e+33:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0)
	t_2 = Float64(-2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * i)))
	tmp = 0.0
	if (c <= -8e+18)
		tmp = t_2;
	elseif (c <= -3.2e-63)
		tmp = t_1;
	elseif (c <= -5.8e-160)
		tmp = Float64(2.0 * Float64(Float64(x * y) - Float64(i * Float64(a * c))));
	elseif (c <= 3.6e+33)
		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 = ((x * y) + (z * t)) * 2.0;
	t_2 = -2.0 * (c * ((a + (b * c)) * i));
	tmp = 0.0;
	if (c <= -8e+18)
		tmp = t_2;
	elseif (c <= -3.2e-63)
		tmp = t_1;
	elseif (c <= -5.8e-160)
		tmp = 2.0 * ((x * y) - (i * (a * c)));
	elseif (c <= 3.6e+33)
		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[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -8e+18], t$95$2, If[LessEqual[c, -3.2e-63], t$95$1, If[LessEqual[c, -5.8e-160], N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.6e+33], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -3.2 \cdot 10^{-63}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 3.6 \cdot 10^{+33}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -8e18 or 3.6000000000000003e33 < c

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

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

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

    if -8e18 < c < -3.19999999999999989e-63 or -5.7999999999999998e-160 < c < 3.6000000000000003e33

    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 c around 0 84.5%

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

    if -3.19999999999999989e-63 < c < -5.7999999999999998e-160

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8 \cdot 10^{+18}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -3.2 \cdot 10^{-63}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq -5.8 \cdot 10^{-160}:\\ \;\;\;\;2 \cdot \left(x \cdot y - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{elif}\;c \leq 3.6 \cdot 10^{+33}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 10: 86.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.45 \cdot 10^{+27} \lor \neg \left(c \leq 1.3 \cdot 10^{+17}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.4500000000000001e27 or 1.3e17 < c

    1. Initial program 78.4%

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

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

    if -1.4500000000000001e27 < c < 1.3e17

    1. Initial program 98.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 88.8%

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

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

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

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

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

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

Alternative 11: 86.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.2 \cdot 10^{+27} \lor \neg \left(c \leq 5.8 \cdot 10^{+17}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.19999999999999999e27 or 5.8e17 < c

    1. Initial program 78.4%

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

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

    if -1.19999999999999999e27 < c < 5.8e17

    1. Initial program 98.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 94.5%

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

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

Alternative 12: 75.1% accurate, 1.3× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.8e21 or 1.09999999999999997e33 < c

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

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

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

    if -3.8e21 < c < 1.09999999999999997e33

    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) \]
    2. Taylor expanded in c around 0 80.9%

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

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

Alternative 13: 67.9% accurate, 1.4× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -7.5000000000000001e84 or 2.74999999999999996e181 < c

    1. Initial program 75.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5000000000000001e84 < c < 2.74999999999999996e181

    1. Initial program 94.5%

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

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

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

Alternative 14: 68.9% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.2000000000000003e109 < c < 1.52e116

    1. Initial program 95.7%

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

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

    if 1.52e116 < c

    1. Initial program 81.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-*r*86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 69.3% accurate, 1.4× speedup?

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

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

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

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


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

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(-c \cdot \left(i \cdot b\right)\right)\right)} \]
    7. Taylor expanded in c around 0 68.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-neg68.4%

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

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

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

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

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

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

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

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

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

    if -3.1999999999999999e102 < c < 4.20000000000000007e115

    1. Initial program 95.7%

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

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

    if 4.20000000000000007e115 < c

    1. Initial program 81.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-*r*86.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 16: 40.6% accurate, 2.1× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.95 \cdot 10^{+54} \lor \neg \left(z \leq 9.6 \cdot 10^{-20}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9499999999999999e54 or 9.59999999999999971e-20 < z

    1. Initial program 89.3%

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

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

    if -2.9499999999999999e54 < z < 9.59999999999999971e-20

    1. Initial program 90.6%

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

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

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

Alternative 17: 30.3% accurate, 3.8× speedup?

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

\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 90.1%

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

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

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

Developer target: 93.7% 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 2023195 
(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))))