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

Percentage Accurate: 90.0% → 96.4%
Time: 18.2s
Alternatives: 13
Speedup: 0.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 90.0% accurate, 1.0× speedup?

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

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

Alternative 1: 96.4% 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 95.3%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. 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 63.8%

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

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

    \[\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 2: 93.5% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t_1\right) \cdot i\\
\mathbf{if}\;t_2 \leq -5 \cdot 10^{+231} \lor \neg \left(t_2 \leq 10^{+289}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t_1 \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000028e231 or 1.0000000000000001e289 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 77.5%

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

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

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

    if -5.00000000000000028e231 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.0000000000000001e289

    1. Initial program 98.8%

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

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

        \[\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. +-commutative99.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq -5 \cdot 10^{+231} \lor \neg \left(\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq 10^{+289}\right):\\ \;\;\;\;-2 \cdot \left(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) - \left(\left(c \cdot i\right) \cdot \left(b \cdot c\right) + a \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 3: 48.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := -2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ t_3 := 2 \cdot \left(x \cdot y\right)\\ \mathbf{if}\;c \leq -2.75 \cdot 10^{+48}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-147}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 1.9 \cdot 10^{-289}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 4.5 \cdot 10^{-261}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 2.55 \cdot 10^{-26}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{+42}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 8.5 \cdot 10^{+128} \lor \neg \left(c \leq 3.2 \cdot 10^{+148}\right):\\ \;\;\;\;t_2\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (* z t)))
        (t_2 (* -2.0 (* b (* c (* c i)))))
        (t_3 (* 2.0 (* x y))))
   (if (<= c -2.75e+48)
     t_2
     (if (<= c -2.1e-147)
       t_1
       (if (<= c 1.9e-289)
         t_3
         (if (<= c 4.5e-261)
           t_1
           (if (<= c 2.55e-26)
             t_3
             (if (<= c 2.8e+42)
               t_1
               (if (or (<= c 8.5e+128) (not (<= c 3.2e+148)))
                 t_2
                 (* c (* -2.0 (* a i))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (z * t);
	double t_2 = -2.0 * (b * (c * (c * i)));
	double t_3 = 2.0 * (x * y);
	double tmp;
	if (c <= -2.75e+48) {
		tmp = t_2;
	} else if (c <= -2.1e-147) {
		tmp = t_1;
	} else if (c <= 1.9e-289) {
		tmp = t_3;
	} else if (c <= 4.5e-261) {
		tmp = t_1;
	} else if (c <= 2.55e-26) {
		tmp = t_3;
	} else if (c <= 2.8e+42) {
		tmp = t_1;
	} else if ((c <= 8.5e+128) || !(c <= 3.2e+148)) {
		tmp = t_2;
	} else {
		tmp = c * (-2.0 * (a * i));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = 2.0d0 * (z * t)
    t_2 = (-2.0d0) * (b * (c * (c * i)))
    t_3 = 2.0d0 * (x * y)
    if (c <= (-2.75d+48)) then
        tmp = t_2
    else if (c <= (-2.1d-147)) then
        tmp = t_1
    else if (c <= 1.9d-289) then
        tmp = t_3
    else if (c <= 4.5d-261) then
        tmp = t_1
    else if (c <= 2.55d-26) then
        tmp = t_3
    else if (c <= 2.8d+42) then
        tmp = t_1
    else if ((c <= 8.5d+128) .or. (.not. (c <= 3.2d+148))) then
        tmp = t_2
    else
        tmp = c * ((-2.0d0) * (a * i))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = 2.0 * (z * t);
	double t_2 = -2.0 * (b * (c * (c * i)));
	double t_3 = 2.0 * (x * y);
	double tmp;
	if (c <= -2.75e+48) {
		tmp = t_2;
	} else if (c <= -2.1e-147) {
		tmp = t_1;
	} else if (c <= 1.9e-289) {
		tmp = t_3;
	} else if (c <= 4.5e-261) {
		tmp = t_1;
	} else if (c <= 2.55e-26) {
		tmp = t_3;
	} else if (c <= 2.8e+42) {
		tmp = t_1;
	} else if ((c <= 8.5e+128) || !(c <= 3.2e+148)) {
		tmp = t_2;
	} else {
		tmp = c * (-2.0 * (a * i));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (z * t)
	t_2 = -2.0 * (b * (c * (c * i)))
	t_3 = 2.0 * (x * y)
	tmp = 0
	if c <= -2.75e+48:
		tmp = t_2
	elif c <= -2.1e-147:
		tmp = t_1
	elif c <= 1.9e-289:
		tmp = t_3
	elif c <= 4.5e-261:
		tmp = t_1
	elif c <= 2.55e-26:
		tmp = t_3
	elif c <= 2.8e+42:
		tmp = t_1
	elif (c <= 8.5e+128) or not (c <= 3.2e+148):
		tmp = t_2
	else:
		tmp = c * (-2.0 * (a * i))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(2.0 * Float64(z * t))
	t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i))))
	t_3 = Float64(2.0 * Float64(x * y))
	tmp = 0.0
	if (c <= -2.75e+48)
		tmp = t_2;
	elseif (c <= -2.1e-147)
		tmp = t_1;
	elseif (c <= 1.9e-289)
		tmp = t_3;
	elseif (c <= 4.5e-261)
		tmp = t_1;
	elseif (c <= 2.55e-26)
		tmp = t_3;
	elseif (c <= 2.8e+42)
		tmp = t_1;
	elseif ((c <= 8.5e+128) || !(c <= 3.2e+148))
		tmp = t_2;
	else
		tmp = Float64(c * Float64(-2.0 * Float64(a * i)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * (z * t);
	t_2 = -2.0 * (b * (c * (c * i)));
	t_3 = 2.0 * (x * y);
	tmp = 0.0;
	if (c <= -2.75e+48)
		tmp = t_2;
	elseif (c <= -2.1e-147)
		tmp = t_1;
	elseif (c <= 1.9e-289)
		tmp = t_3;
	elseif (c <= 4.5e-261)
		tmp = t_1;
	elseif (c <= 2.55e-26)
		tmp = t_3;
	elseif (c <= 2.8e+42)
		tmp = t_1;
	elseif ((c <= 8.5e+128) || ~((c <= 3.2e+148)))
		tmp = t_2;
	else
		tmp = c * (-2.0 * (a * i));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.75e+48], t$95$2, If[LessEqual[c, -2.1e-147], t$95$1, If[LessEqual[c, 1.9e-289], t$95$3, If[LessEqual[c, 4.5e-261], t$95$1, If[LessEqual[c, 2.55e-26], t$95$3, If[LessEqual[c, 2.8e+42], t$95$1, If[Or[LessEqual[c, 8.5e+128], N[Not[LessEqual[c, 3.2e+148]], $MachinePrecision]], t$95$2, N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -2.1 \cdot 10^{-147}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 1.9 \cdot 10^{-289}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 4.5 \cdot 10^{-261}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 2.55 \cdot 10^{-26}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;c \leq 2.8 \cdot 10^{+42}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 8.5 \cdot 10^{+128} \lor \neg \left(c \leq 3.2 \cdot 10^{+148}\right):\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -2.7500000000000001e48 or 2.7999999999999999e42 < c < 8.50000000000000045e128 or 3.1999999999999999e148 < c

    1. Initial program 82.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7500000000000001e48 < c < -2.1e-147 or 1.90000000000000005e-289 < c < 4.5000000000000001e-261 or 2.54999999999999995e-26 < c < 2.7999999999999999e42

    1. Initial program 97.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 52.2%

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

    if -2.1e-147 < c < 1.90000000000000005e-289 or 4.5000000000000001e-261 < c < 2.54999999999999995e-26

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

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

    if 8.50000000000000045e128 < c < 3.1999999999999999e148

    1. Initial program 67.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.75 \cdot 10^{+48}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -2.1 \cdot 10^{-147}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 1.9 \cdot 10^{-289}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 4.5 \cdot 10^{-261}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 2.55 \cdot 10^{-26}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;c \leq 2.8 \cdot 10^{+42}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;c \leq 8.5 \cdot 10^{+128} \lor \neg \left(c \leq 3.2 \cdot 10^{+148}\right):\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\ \end{array} \]

Alternative 4: 90.5% accurate, 0.9× speedup?

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

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

\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 c < 2.40000000000000012e100

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

    if 2.40000000000000012e100 < c

    1. Initial program 71.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq 2.4 \cdot 10^{+100}:\\ \;\;\;\;\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(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 5: 68.1% 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(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{if}\;c \leq -6.8 \cdot 10^{+59}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 5.6 \cdot 10^{+59}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 3.6 \cdot 10^{+76}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\ \;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\ \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 (* b (* c (* c i))))))
   (if (<= c -6.8e+59)
     t_2
     (if (<= c 5.6e+59)
       t_1
       (if (<= c 3.6e+76)
         t_2
         (if (<= c 2.5e+100)
           t_1
           (if (<= c 3.2e+148) (* c (* -2.0 (* a i))) t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((x * y) + (z * t)) * 2.0;
	double t_2 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -6.8e+59) {
		tmp = t_2;
	} else if (c <= 5.6e+59) {
		tmp = t_1;
	} else if (c <= 3.6e+76) {
		tmp = t_2;
	} else if (c <= 2.5e+100) {
		tmp = t_1;
	} else if (c <= 3.2e+148) {
		tmp = c * (-2.0 * (a * i));
	} else {
		tmp = t_2;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((x * y) + (z * t)) * 2.0d0
    t_2 = (-2.0d0) * (b * (c * (c * i)))
    if (c <= (-6.8d+59)) then
        tmp = t_2
    else if (c <= 5.6d+59) then
        tmp = t_1
    else if (c <= 3.6d+76) then
        tmp = t_2
    else if (c <= 2.5d+100) then
        tmp = t_1
    else if (c <= 3.2d+148) then
        tmp = c * ((-2.0d0) * (a * i))
    else
        tmp = t_2
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((x * y) + (z * t)) * 2.0;
	double t_2 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -6.8e+59) {
		tmp = t_2;
	} else if (c <= 5.6e+59) {
		tmp = t_1;
	} else if (c <= 3.6e+76) {
		tmp = t_2;
	} else if (c <= 2.5e+100) {
		tmp = t_1;
	} else if (c <= 3.2e+148) {
		tmp = c * (-2.0 * (a * i));
	} 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 * (b * (c * (c * i)))
	tmp = 0
	if c <= -6.8e+59:
		tmp = t_2
	elif c <= 5.6e+59:
		tmp = t_1
	elif c <= 3.6e+76:
		tmp = t_2
	elif c <= 2.5e+100:
		tmp = t_1
	elif c <= 3.2e+148:
		tmp = c * (-2.0 * (a * i))
	else:
		tmp = t_2
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0)
	t_2 = Float64(-2.0 * Float64(b * Float64(c * Float64(c * i))))
	tmp = 0.0
	if (c <= -6.8e+59)
		tmp = t_2;
	elseif (c <= 5.6e+59)
		tmp = t_1;
	elseif (c <= 3.6e+76)
		tmp = t_2;
	elseif (c <= 2.5e+100)
		tmp = t_1;
	elseif (c <= 3.2e+148)
		tmp = Float64(c * Float64(-2.0 * Float64(a * i)));
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = ((x * y) + (z * t)) * 2.0;
	t_2 = -2.0 * (b * (c * (c * i)));
	tmp = 0.0;
	if (c <= -6.8e+59)
		tmp = t_2;
	elseif (c <= 5.6e+59)
		tmp = t_1;
	elseif (c <= 3.6e+76)
		tmp = t_2;
	elseif (c <= 2.5e+100)
		tmp = t_1;
	elseif (c <= 3.2e+148)
		tmp = c * (-2.0 * (a * i));
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -6.8e+59], t$95$2, If[LessEqual[c, 5.6e+59], t$95$1, If[LessEqual[c, 3.6e+76], t$95$2, If[LessEqual[c, 2.5e+100], t$95$1, If[LessEqual[c, 3.2e+148], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\
\mathbf{if}\;c \leq -6.8 \cdot 10^{+59}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 5.6 \cdot 10^{+59}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 3.6 \cdot 10^{+76}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 2.5 \cdot 10^{+100}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -6.80000000000000012e59 or 5.5999999999999996e59 < c < 3.6000000000000003e76 or 3.1999999999999999e148 < 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 i around inf 84.2%

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

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

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

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

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

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

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

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

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

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

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

    if -6.80000000000000012e59 < c < 5.5999999999999996e59 or 3.6000000000000003e76 < c < 2.4999999999999999e100

    1. Initial program 97.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 79.4%

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

    if 2.4999999999999999e100 < c < 3.1999999999999999e148

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -6.8 \cdot 10^{+59}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 5.6 \cdot 10^{+59}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 3.6 \cdot 10^{+76}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{+100}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\ \;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 6: 67.9% 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(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{if}\;c \leq -1.8 \cdot 10^{+59}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 2.2 \cdot 10^{+63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 2.2 \cdot 10^{+76}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 1.58 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\ \;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(c \cdot \left(i \cdot \left(b \cdot -2\right)\right)\right)\\ \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 (* b (* c (* c i))))))
   (if (<= c -1.8e+59)
     t_2
     (if (<= c 2.2e+63)
       t_1
       (if (<= c 2.2e+76)
         t_2
         (if (<= c 1.58e+100)
           t_1
           (if (<= c 3.2e+148)
             (* c (* -2.0 (* a i)))
             (* c (* c (* i (* b -2.0)))))))))))
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 * (b * (c * (c * i)));
	double tmp;
	if (c <= -1.8e+59) {
		tmp = t_2;
	} else if (c <= 2.2e+63) {
		tmp = t_1;
	} else if (c <= 2.2e+76) {
		tmp = t_2;
	} else if (c <= 1.58e+100) {
		tmp = t_1;
	} else if (c <= 3.2e+148) {
		tmp = c * (-2.0 * (a * i));
	} else {
		tmp = c * (c * (i * (b * -2.0)));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((x * y) + (z * t)) * 2.0d0
    t_2 = (-2.0d0) * (b * (c * (c * i)))
    if (c <= (-1.8d+59)) then
        tmp = t_2
    else if (c <= 2.2d+63) then
        tmp = t_1
    else if (c <= 2.2d+76) then
        tmp = t_2
    else if (c <= 1.58d+100) then
        tmp = t_1
    else if (c <= 3.2d+148) then
        tmp = c * ((-2.0d0) * (a * i))
    else
        tmp = c * (c * (i * (b * (-2.0d0))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((x * y) + (z * t)) * 2.0;
	double t_2 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -1.8e+59) {
		tmp = t_2;
	} else if (c <= 2.2e+63) {
		tmp = t_1;
	} else if (c <= 2.2e+76) {
		tmp = t_2;
	} else if (c <= 1.58e+100) {
		tmp = t_1;
	} else if (c <= 3.2e+148) {
		tmp = c * (-2.0 * (a * i));
	} else {
		tmp = c * (c * (i * (b * -2.0)));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((x * y) + (z * t)) * 2.0
	t_2 = -2.0 * (b * (c * (c * i)))
	tmp = 0
	if c <= -1.8e+59:
		tmp = t_2
	elif c <= 2.2e+63:
		tmp = t_1
	elif c <= 2.2e+76:
		tmp = t_2
	elif c <= 1.58e+100:
		tmp = t_1
	elif c <= 3.2e+148:
		tmp = c * (-2.0 * (a * i))
	else:
		tmp = c * (c * (i * (b * -2.0)))
	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(b * Float64(c * Float64(c * i))))
	tmp = 0.0
	if (c <= -1.8e+59)
		tmp = t_2;
	elseif (c <= 2.2e+63)
		tmp = t_1;
	elseif (c <= 2.2e+76)
		tmp = t_2;
	elseif (c <= 1.58e+100)
		tmp = t_1;
	elseif (c <= 3.2e+148)
		tmp = Float64(c * Float64(-2.0 * Float64(a * i)));
	else
		tmp = Float64(c * Float64(c * Float64(i * Float64(b * -2.0))));
	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 * (b * (c * (c * i)));
	tmp = 0.0;
	if (c <= -1.8e+59)
		tmp = t_2;
	elseif (c <= 2.2e+63)
		tmp = t_1;
	elseif (c <= 2.2e+76)
		tmp = t_2;
	elseif (c <= 1.58e+100)
		tmp = t_1;
	elseif (c <= 3.2e+148)
		tmp = c * (-2.0 * (a * i));
	else
		tmp = c * (c * (i * (b * -2.0)));
	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[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.8e+59], t$95$2, If[LessEqual[c, 2.2e+63], t$95$1, If[LessEqual[c, 2.2e+76], t$95$2, If[LessEqual[c, 1.58e+100], t$95$1, If[LessEqual[c, 3.2e+148], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(c * N[(i * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq 2.2 \cdot 10^{+63}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 2.2 \cdot 10^{+76}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 1.58 \cdot 10^{+100}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -1.7999999999999999e59 or 2.1999999999999999e63 < c < 2.2e76

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

    if -1.7999999999999999e59 < c < 2.1999999999999999e63 or 2.2e76 < c < 1.5800000000000001e100

    1. Initial program 97.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 79.4%

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

    if 1.5800000000000001e100 < c < 3.1999999999999999e148

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1999999999999999e148 < c

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.8 \cdot 10^{+59}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.2 \cdot 10^{+63}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 2.2 \cdot 10^{+76}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.58 \cdot 10^{+100}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\ \;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(c \cdot \left(i \cdot \left(b \cdot -2\right)\right)\right)\\ \end{array} \]

Alternative 7: 68.4% 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(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{if}\;c \leq -9.2 \cdot 10^{+61}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 1.95 \cdot 10^{+62}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 1.55 \cdot 10^{+76}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq 2.2 \cdot 10^{+100}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\ \;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\left(c \cdot i\right) \cdot \left(b \cdot -2\right)\right)\\ \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 (* b (* c (* c i))))))
   (if (<= c -9.2e+61)
     t_2
     (if (<= c 1.95e+62)
       t_1
       (if (<= c 1.55e+76)
         t_2
         (if (<= c 2.2e+100)
           t_1
           (if (<= c 3.2e+148)
             (* c (* -2.0 (* a i)))
             (* c (* (* c i) (* b -2.0))))))))))
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 * (b * (c * (c * i)));
	double tmp;
	if (c <= -9.2e+61) {
		tmp = t_2;
	} else if (c <= 1.95e+62) {
		tmp = t_1;
	} else if (c <= 1.55e+76) {
		tmp = t_2;
	} else if (c <= 2.2e+100) {
		tmp = t_1;
	} else if (c <= 3.2e+148) {
		tmp = c * (-2.0 * (a * i));
	} else {
		tmp = c * ((c * i) * (b * -2.0));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = ((x * y) + (z * t)) * 2.0d0
    t_2 = (-2.0d0) * (b * (c * (c * i)))
    if (c <= (-9.2d+61)) then
        tmp = t_2
    else if (c <= 1.95d+62) then
        tmp = t_1
    else if (c <= 1.55d+76) then
        tmp = t_2
    else if (c <= 2.2d+100) then
        tmp = t_1
    else if (c <= 3.2d+148) then
        tmp = c * ((-2.0d0) * (a * i))
    else
        tmp = c * ((c * i) * (b * (-2.0d0)))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((x * y) + (z * t)) * 2.0;
	double t_2 = -2.0 * (b * (c * (c * i)));
	double tmp;
	if (c <= -9.2e+61) {
		tmp = t_2;
	} else if (c <= 1.95e+62) {
		tmp = t_1;
	} else if (c <= 1.55e+76) {
		tmp = t_2;
	} else if (c <= 2.2e+100) {
		tmp = t_1;
	} else if (c <= 3.2e+148) {
		tmp = c * (-2.0 * (a * i));
	} else {
		tmp = c * ((c * i) * (b * -2.0));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((x * y) + (z * t)) * 2.0
	t_2 = -2.0 * (b * (c * (c * i)))
	tmp = 0
	if c <= -9.2e+61:
		tmp = t_2
	elif c <= 1.95e+62:
		tmp = t_1
	elif c <= 1.55e+76:
		tmp = t_2
	elif c <= 2.2e+100:
		tmp = t_1
	elif c <= 3.2e+148:
		tmp = c * (-2.0 * (a * i))
	else:
		tmp = c * ((c * i) * (b * -2.0))
	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(b * Float64(c * Float64(c * i))))
	tmp = 0.0
	if (c <= -9.2e+61)
		tmp = t_2;
	elseif (c <= 1.95e+62)
		tmp = t_1;
	elseif (c <= 1.55e+76)
		tmp = t_2;
	elseif (c <= 2.2e+100)
		tmp = t_1;
	elseif (c <= 3.2e+148)
		tmp = Float64(c * Float64(-2.0 * Float64(a * i)));
	else
		tmp = Float64(c * Float64(Float64(c * i) * Float64(b * -2.0)));
	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 * (b * (c * (c * i)));
	tmp = 0.0;
	if (c <= -9.2e+61)
		tmp = t_2;
	elseif (c <= 1.95e+62)
		tmp = t_1;
	elseif (c <= 1.55e+76)
		tmp = t_2;
	elseif (c <= 2.2e+100)
		tmp = t_1;
	elseif (c <= 3.2e+148)
		tmp = c * (-2.0 * (a * i));
	else
		tmp = c * ((c * i) * (b * -2.0));
	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[(b * N[(c * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -9.2e+61], t$95$2, If[LessEqual[c, 1.95e+62], t$95$1, If[LessEqual[c, 1.55e+76], t$95$2, If[LessEqual[c, 2.2e+100], t$95$1, If[LessEqual[c, 3.2e+148], N[(c * N[(-2.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(N[(c * i), $MachinePrecision] * N[(b * -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq 1.95 \cdot 10^{+62}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 1.55 \cdot 10^{+76}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 2.2 \cdot 10^{+100}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -9.1999999999999998e61 or 1.95e62 < c < 1.55000000000000006e76

    1. Initial program 87.1%

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

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

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

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

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

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

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

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

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

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

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

    if -9.1999999999999998e61 < c < 1.95e62 or 1.55000000000000006e76 < c < 2.2000000000000001e100

    1. Initial program 97.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 79.4%

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

    if 2.2000000000000001e100 < c < 3.1999999999999999e148

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.1999999999999999e148 < c

    1. Initial program 81.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -9.2 \cdot 10^{+61}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.95 \cdot 10^{+62}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 1.55 \cdot 10^{+76}:\\ \;\;\;\;-2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.2 \cdot 10^{+100}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+148}:\\ \;\;\;\;c \cdot \left(-2 \cdot \left(a \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;c \cdot \left(\left(c \cdot i\right) \cdot \left(b \cdot -2\right)\right)\\ \end{array} \]

Alternative 8: 78.6% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -2.15 \cdot 10^{+33} \lor \neg \left(c \leq 7.5 \cdot 10^{+40}\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 -2.15e+33) (not (<= c 7.5e+40)))
   (* 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 <= -2.15e+33) || !(c <= 7.5e+40)) {
		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 <= (-2.15d+33)) .or. (.not. (c <= 7.5d+40))) 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 <= -2.15e+33) || !(c <= 7.5e+40)) {
		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 <= -2.15e+33) or not (c <= 7.5e+40):
		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 <= -2.15e+33) || !(c <= 7.5e+40))
		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 <= -2.15e+33) || ~((c <= 7.5e+40)))
		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, -2.15e+33], N[Not[LessEqual[c, 7.5e+40]], $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 -2.15 \cdot 10^{+33} \lor \neg \left(c \leq 7.5 \cdot 10^{+40}\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 < -2.15000000000000014e33 or 7.4999999999999996e40 < c

    1. Initial program 82.4%

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

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

    if -2.15000000000000014e33 < c < 7.4999999999999996e40

    1. Initial program 97.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.15 \cdot 10^{+33} \lor \neg \left(c \leq 7.5 \cdot 10^{+40}\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 9: 87.5% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+36} \lor \neg \left(c \leq 6.2 \cdot 10^{+41}\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.7e+36) (not (<= c 6.2e+41)))
   (* 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.7e+36) || !(c <= 6.2e+41)) {
		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.7d+36)) .or. (.not. (c <= 6.2d+41))) 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.7e+36) || !(c <= 6.2e+41)) {
		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.7e+36) or not (c <= 6.2e+41):
		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.7e+36) || !(c <= 6.2e+41))
		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.7e+36) || ~((c <= 6.2e+41)))
		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.7e+36], N[Not[LessEqual[c, 6.2e+41]], $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.7 \cdot 10^{+36} \lor \neg \left(c \leq 6.2 \cdot 10^{+41}\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.6999999999999999e36 or 6.2e41 < c

    1. Initial program 82.4%

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

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

    if -1.6999999999999999e36 < c < 6.2e41

    1. Initial program 97.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.7 \cdot 10^{+36} \lor \neg \left(c \leq 6.2 \cdot 10^{+41}\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 10: 74.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -8.6 \cdot 10^{+103} \lor \neg \left(c \leq 5.2 \cdot 10^{+42}\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 -8.6e+103) (not (<= c 5.2e+42)))
   (* -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 <= -8.6e+103) || !(c <= 5.2e+42)) {
		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 <= (-8.6d+103)) .or. (.not. (c <= 5.2d+42))) 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 <= -8.6e+103) || !(c <= 5.2e+42)) {
		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 <= -8.6e+103) or not (c <= 5.2e+42):
		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 <= -8.6e+103) || !(c <= 5.2e+42))
		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 <= -8.6e+103) || ~((c <= 5.2e+42)))
		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, -8.6e+103], N[Not[LessEqual[c, 5.2e+42]], $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 -8.6 \cdot 10^{+103} \lor \neg \left(c \leq 5.2 \cdot 10^{+42}\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 < -8.59999999999999938e103 or 5.1999999999999998e42 < c

    1. Initial program 80.3%

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

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

    if -8.59999999999999938e103 < c < 5.1999999999999998e42

    1. Initial program 97.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 78.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -8.6 \cdot 10^{+103} \lor \neg \left(c \leq 5.2 \cdot 10^{+42}\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 11: 74.1% accurate, 1.3× speedup?

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

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

\mathbf{elif}\;c \leq 1.7 \cdot 10^{+40}:\\
\;\;\;\;\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}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -2.5499999999999999e48

    1. Initial program 86.4%

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

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

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

    if -2.5499999999999999e48 < c < 1.69999999999999994e40

    1. Initial program 97.4%

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

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

    if 1.69999999999999994e40 < c

    1. Initial program 77.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.55 \cdot 10^{+48}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(i \cdot \left(b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.7 \cdot 10^{+40}:\\ \;\;\;\;\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 12: 40.7% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -7.4 \cdot 10^{+27} \lor \neg \left(z \leq 4.2 \cdot 10^{-16}\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 -7.4e+27) (not (<= z 4.2e-16)))
   (* 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 <= -7.4e+27) || !(z <= 4.2e-16)) {
		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 <= (-7.4d+27)) .or. (.not. (z <= 4.2d-16))) 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 <= -7.4e+27) || !(z <= 4.2e-16)) {
		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 <= -7.4e+27) or not (z <= 4.2e-16):
		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 <= -7.4e+27) || !(z <= 4.2e-16))
		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 <= -7.4e+27) || ~((z <= 4.2e-16)))
		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, -7.4e+27], N[Not[LessEqual[z, 4.2e-16]], $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 -7.4 \cdot 10^{+27} \lor \neg \left(z \leq 4.2 \cdot 10^{-16}\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 < -7.40000000000000004e27 or 4.2000000000000002e-16 < z

    1. Initial program 88.9%

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

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

    if -7.40000000000000004e27 < z < 4.2000000000000002e-16

    1. Initial program 93.8%

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

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

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

Alternative 13: 30.1% accurate, 3.8× speedup?

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

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

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

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

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

Developer target: 94.3% 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 2023279 
(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))))