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

Percentage Accurate: 89.9% → 95.5%
Time: 13.9s
Alternatives: 17
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 17 alternatives:

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

Initial Program: 89.9% accurate, 1.0× speedup?

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

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

Alternative 1: 95.5% 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 \mathsf{fma}\left(t, z, x \cdot y\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 (fma t z (* x y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double tmp;
	if ((((x * y) + (z * t)) - ((c * t_1) * i)) <= ((double) INFINITY)) {
		tmp = 2.0 * (fma(x, y, (z * t)) - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * fma(t, z, (x * y));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	tmp = 0.0
	if (Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * t_1) * i)) <= Inf)
		tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(t_1 * Float64(c * i))));
	else
		tmp = Float64(2.0 * fma(t, z, Float64(x * y)));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision], 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[(t * z + N[(x * y), $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 \mathsf{fma}\left(t, z, x \cdot y\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 96.7%

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

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

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

      \[\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 c around 0 41.2%

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

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)} \]
    4. Simplified58.8%

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

    \[\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 \mathsf{fma}\left(t, z, x \cdot y\right)\\ \end{array} \]

Alternative 2: 92.1% accurate, 0.2× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \mathsf{fma}\left(t, z, x \cdot y\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 96.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) \]

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

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

        \[\leadsto 2 \cdot \color{blue}{\mathsf{fma}\left(t, z, x \cdot y\right)} \]
    4. Simplified58.8%

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

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

Alternative 3: 91.3% accurate, 0.5× speedup?

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

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

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


\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 96.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) \]

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

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

    \[\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:\\ \;\;\;\;\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}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 4: 77.7% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq -7.5 \cdot 10^{-57} \lor \neg \left(x \cdot y \leq 1.12 \cdot 10^{+98}\right):\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - 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 (*.f64 x y) < -2.1999999999999999e95 or -9.99999999999999972e58 < (*.f64 x y) < -7.49999999999999973e-57 or 1.12e98 < (*.f64 x y)

    1. Initial program 86.1%

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

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

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

    if -2.1999999999999999e95 < (*.f64 x y) < -9.99999999999999972e58

    1. Initial program 87.0%

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

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

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

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

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

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

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

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

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

    if -7.49999999999999973e-57 < (*.f64 x y) < 1.12e98

    1. Initial program 93.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.2 \cdot 10^{+95}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{+59}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;x \cdot y \leq -7.5 \cdot 10^{-57} \lor \neg \left(x \cdot y \leq 1.12 \cdot 10^{+98}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 5: 41.2% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-309}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{-141}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 9 \cdot 10^{-82}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 10^{+83}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -7.49999999999999973e-57 or 1.00000000000000003e83 < (*.f64 x y)

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

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

    if -7.49999999999999973e-57 < (*.f64 x y) < -1.9999999999999988e-309 or 1.49999999999999992e-141 < (*.f64 x y) < 8.9999999999999997e-82

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

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

    if -1.9999999999999988e-309 < (*.f64 x y) < 1.49999999999999992e-141 or 8.9999999999999997e-82 < (*.f64 x y) < 1.00000000000000003e83

    1. Initial program 94.3%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -7.5 \cdot 10^{-57}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq -2 \cdot 10^{-309}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 1.5 \cdot 10^{-141}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 9 \cdot 10^{-82}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 10^{+83}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 6: 81.9% accurate, 0.7× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -1.8 \cdot 10^{-56} \lor \neg \left(x \cdot y \leq 8.6 \cdot 10^{+17}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\

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


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

    1. Initial program 71.4%

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

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

    if -6.4999999999999999e292 < (*.f64 x y) < -1.79999999999999989e-56 or 8.6e17 < (*.f64 x y)

    1. Initial program 89.8%

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

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

    if -1.79999999999999989e-56 < (*.f64 x y) < 8.6e17

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

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

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

Alternative 7: 71.5% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{if}\;c \leq -1.5 \cdot 10^{+60}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{+16}:\\ \;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq -7.5 \cdot 10^{-107}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 4.3 \cdot 10^{-26} \lor \neg \left(c \leq 1.5 \cdot 10^{+84}\right) \land c \leq 1.35 \cdot 10^{+119}:\\ \;\;\;\;\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 \left(-i\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* 2.0 (- (* x y) (* c (* (* b c) i))))))
   (if (<= c -1.5e+60)
     t_1
     (if (<= c -9.5e+16)
       (* 2.0 (- (* z t) (* i (* c (* b c)))))
       (if (<= c -7.5e-107)
         t_1
         (if (or (<= c 4.3e-26) (and (not (<= c 1.5e+84)) (<= c 1.35e+119)))
           (* (+ (* 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 t_1 = 2.0 * ((x * y) - (c * ((b * c) * i)));
	double tmp;
	if (c <= -1.5e+60) {
		tmp = t_1;
	} else if (c <= -9.5e+16) {
		tmp = 2.0 * ((z * t) - (i * (c * (b * c))));
	} else if (c <= -7.5e-107) {
		tmp = t_1;
	} else if ((c <= 4.3e-26) || (!(c <= 1.5e+84) && (c <= 1.35e+119))) {
		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) :: t_1
    real(8) :: tmp
    t_1 = 2.0d0 * ((x * y) - (c * ((b * c) * i)))
    if (c <= (-1.5d+60)) then
        tmp = t_1
    else if (c <= (-9.5d+16)) then
        tmp = 2.0d0 * ((z * t) - (i * (c * (b * c))))
    else if (c <= (-7.5d-107)) then
        tmp = t_1
    else if ((c <= 4.3d-26) .or. (.not. (c <= 1.5d+84)) .and. (c <= 1.35d+119)) 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 t_1 = 2.0 * ((x * y) - (c * ((b * c) * i)));
	double tmp;
	if (c <= -1.5e+60) {
		tmp = t_1;
	} else if (c <= -9.5e+16) {
		tmp = 2.0 * ((z * t) - (i * (c * (b * c))));
	} else if (c <= -7.5e-107) {
		tmp = t_1;
	} else if ((c <= 4.3e-26) || (!(c <= 1.5e+84) && (c <= 1.35e+119))) {
		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):
	t_1 = 2.0 * ((x * y) - (c * ((b * c) * i)))
	tmp = 0
	if c <= -1.5e+60:
		tmp = t_1
	elif c <= -9.5e+16:
		tmp = 2.0 * ((z * t) - (i * (c * (b * c))))
	elif c <= -7.5e-107:
		tmp = t_1
	elif (c <= 4.3e-26) or (not (c <= 1.5e+84) and (c <= 1.35e+119)):
		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)
	t_1 = Float64(2.0 * Float64(Float64(x * y) - Float64(c * Float64(Float64(b * c) * i))))
	tmp = 0.0
	if (c <= -1.5e+60)
		tmp = t_1;
	elseif (c <= -9.5e+16)
		tmp = Float64(2.0 * Float64(Float64(z * t) - Float64(i * Float64(c * Float64(b * c)))));
	elseif (c <= -7.5e-107)
		tmp = t_1;
	elseif ((c <= 4.3e-26) || (!(c <= 1.5e+84) && (c <= 1.35e+119)))
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	else
		tmp = Float64(2.0 * Float64(c * Float64(Float64(a + Float64(b * c)) * Float64(-i))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = 2.0 * ((x * y) - (c * ((b * c) * i)));
	tmp = 0.0;
	if (c <= -1.5e+60)
		tmp = t_1;
	elseif (c <= -9.5e+16)
		tmp = 2.0 * ((z * t) - (i * (c * (b * c))));
	elseif (c <= -7.5e-107)
		tmp = t_1;
	elseif ((c <= 4.3e-26) || (~((c <= 1.5e+84)) && (c <= 1.35e+119)))
		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_] := Block[{t$95$1 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(N[(b * c), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.5e+60], t$95$1, If[LessEqual[c, -9.5e+16], N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -7.5e-107], t$95$1, If[Or[LessEqual[c, 4.3e-26], And[N[Not[LessEqual[c, 1.5e+84]], $MachinePrecision], LessEqual[c, 1.35e+119]]], 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}
t_1 := 2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\
\mathbf{if}\;c \leq -1.5 \cdot 10^{+60}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq -9.5 \cdot 10^{+16}:\\
\;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\

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

\mathbf{elif}\;c \leq 4.3 \cdot 10^{-26} \lor \neg \left(c \leq 1.5 \cdot 10^{+84}\right) \land c \leq 1.35 \cdot 10^{+119}:\\
\;\;\;\;\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 \left(-i\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -1.4999999999999999e60 or -9.5e16 < c < -7.50000000000000047e-107

    1. Initial program 88.2%

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

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

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

    if -1.4999999999999999e60 < c < -9.5e16

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

    if -7.50000000000000047e-107 < c < 4.29999999999999988e-26 or 1.49999999999999998e84 < c < 1.3499999999999999e119

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

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

    if 4.29999999999999988e-26 < c < 1.49999999999999998e84 or 1.3499999999999999e119 < c

    1. Initial program 84.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 76.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.5 \cdot 10^{+60}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -9.5 \cdot 10^{+16}:\\ \;\;\;\;2 \cdot \left(z \cdot t - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq -7.5 \cdot 10^{-107}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 4.3 \cdot 10^{-26} \lor \neg \left(c \leq 1.5 \cdot 10^{+84}\right) \land c \leq 1.35 \cdot 10^{+119}:\\ \;\;\;\;\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 \left(-i\right)\right)\right)\\ \end{array} \]

Alternative 8: 68.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq 2.5 \cdot 10^{-27}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;c \leq 3.5 \cdot 10^{+121}:\\
\;\;\;\;t_2\\

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

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


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

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.7999999999999999e37 < c < 2.5000000000000001e-27 or 8.5000000000000005e93 < c < 3.5e121

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

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

    if 2.5000000000000001e-27 < c < 8.5000000000000005e93

    1. Initial program 84.6%

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

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

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

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

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

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

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

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

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

    if 3.5e121 < c < 5.8000000000000001e128

    1. Initial program 68.0%

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

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

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

    if 5.8000000000000001e128 < c

    1. Initial program 86.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 b around inf 78.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.8 \cdot 10^{+37}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{-27}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 8.5 \cdot 10^{+93}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 3.5 \cdot 10^{+121}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 5.8 \cdot 10^{+128}:\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]

Alternative 9: 73.9% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.7 \cdot 10^{+29} \lor \neg \left(c \leq 1.65 \cdot 10^{-29} \lor \neg \left(c \leq 1.9 \cdot 10^{+84}\right) \land c \leq 1.35 \cdot 10^{+119}\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.69999999999999974e29 or 1.65000000000000014e-29 < c < 1.9e84 or 1.3499999999999999e119 < c

    1. Initial program 86.5%

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

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

    if -3.69999999999999974e29 < c < 1.65000000000000014e-29 or 1.9e84 < c < 1.3499999999999999e119

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

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

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

Alternative 10: 86.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -1.1 \cdot 10^{+38} \lor \neg \left(c \leq 2.3 \cdot 10^{-21}\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.1e+38) (not (<= c 2.3e-21)))
   (* 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.1e+38) || !(c <= 2.3e-21)) {
		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.1d+38)) .or. (.not. (c <= 2.3d-21))) 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.1e+38) || !(c <= 2.3e-21)) {
		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.1e+38) or not (c <= 2.3e-21):
		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.1e+38) || !(c <= 2.3e-21))
		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.1e+38) || ~((c <= 2.3e-21)))
		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.1e+38], N[Not[LessEqual[c, 2.3e-21]], $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.1 \cdot 10^{+38} \lor \neg \left(c \leq 2.3 \cdot 10^{-21}\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.10000000000000003e38 or 2.29999999999999999e-21 < c

    1. Initial program 84.6%

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

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

    if -1.10000000000000003e38 < c < 2.29999999999999999e-21

    1. Initial program 95.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.1 \cdot 10^{+38} \lor \neg \left(c \leq 2.3 \cdot 10^{-21}\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 11: 67.5% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;c \leq 9.2 \cdot 10^{-21}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;c \leq 6 \cdot 10^{+128}:\\
\;\;\;\;t_2\\

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


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

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.00000000000000043e37 < c < 9.19999999999999998e-21 or 4.9999999999999996e44 < c < 5.9999999999999997e128

    1. Initial program 91.7%

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

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

    if 9.19999999999999998e-21 < c < 4.9999999999999996e44

    1. Initial program 90.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 90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 5.9999999999999997e128 < c

    1. Initial program 86.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 b around inf 78.5%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -6 \cdot 10^{+37}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq 9.2 \cdot 10^{-21}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 5 \cdot 10^{+44}:\\ \;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq 6 \cdot 10^{+128}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(b \cdot \left(c \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]

Alternative 12: 67.0% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -2.8 \cdot 10^{+38} \lor \neg \left(c \leq 7 \cdot 10^{-21} \lor \neg \left(c \leq 6.6 \cdot 10^{+44}\right) \land c \leq 5.8 \cdot 10^{+128}\right):\\ \;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\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.8e+38)
         (not (or (<= c 7e-21) (and (not (<= c 6.6e+44)) (<= c 5.8e+128)))))
   (* c (* (* b c) (* i -2.0)))
   (* (+ (* 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.8e+38) || !((c <= 7e-21) || (!(c <= 6.6e+44) && (c <= 5.8e+128)))) {
		tmp = c * ((b * c) * (i * -2.0));
	} 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.8d+38)) .or. (.not. (c <= 7d-21) .or. (.not. (c <= 6.6d+44)) .and. (c <= 5.8d+128))) then
        tmp = c * ((b * c) * (i * (-2.0d0)))
    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.8e+38) || !((c <= 7e-21) || (!(c <= 6.6e+44) && (c <= 5.8e+128)))) {
		tmp = c * ((b * c) * (i * -2.0));
	} 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.8e+38) or not ((c <= 7e-21) or (not (c <= 6.6e+44) and (c <= 5.8e+128))):
		tmp = c * ((b * c) * (i * -2.0))
	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.8e+38) || !((c <= 7e-21) || (!(c <= 6.6e+44) && (c <= 5.8e+128))))
		tmp = Float64(c * Float64(Float64(b * c) * Float64(i * -2.0)));
	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.8e+38) || ~(((c <= 7e-21) || (~((c <= 6.6e+44)) && (c <= 5.8e+128)))))
		tmp = c * ((b * c) * (i * -2.0));
	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.8e+38], N[Not[Or[LessEqual[c, 7e-21], And[N[Not[LessEqual[c, 6.6e+44]], $MachinePrecision], LessEqual[c, 5.8e+128]]]], $MachinePrecision]], N[(c * N[(N[(b * c), $MachinePrecision] * N[(i * -2.0), $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.8 \cdot 10^{+38} \lor \neg \left(c \leq 7 \cdot 10^{-21} \lor \neg \left(c \leq 6.6 \cdot 10^{+44}\right) \land c \leq 5.8 \cdot 10^{+128}\right):\\
\;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\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.8e38 or 7.0000000000000007e-21 < c < 6.60000000000000027e44 or 5.8000000000000001e128 < c

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e38 < c < 7.0000000000000007e-21 or 6.60000000000000027e44 < c < 5.8000000000000001e128

    1. Initial program 91.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -2.8 \cdot 10^{+38} \lor \neg \left(c \leq 7 \cdot 10^{-21} \lor \neg \left(c \leq 6.6 \cdot 10^{+44}\right) \land c \leq 5.8 \cdot 10^{+128}\right):\\ \;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]

Alternative 13: 66.7% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;c \leq 8.5 \cdot 10^{-21}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;c \leq 7.6 \cdot 10^{+44}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;c \leq 5.8 \cdot 10^{+128}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.20000000000000014e37 or 8.4999999999999993e-21 < c < 7.6000000000000004e44

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.20000000000000014e37 < c < 8.4999999999999993e-21 or 7.6000000000000004e44 < c < 5.8000000000000001e128

    1. Initial program 91.7%

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

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

    if 5.8000000000000001e128 < c

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.2 \cdot 10^{+37}:\\ \;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq 8.5 \cdot 10^{-21}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 7.6 \cdot 10^{+44}:\\ \;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq 5.8 \cdot 10^{+128}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right)\\ \end{array} \]

Alternative 14: 66.9% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;c \leq 9.2 \cdot 10^{-21}:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 88.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1500000000000001e38 < c < 9.19999999999999998e-21 or 3.8000000000000002e44 < c < 1.04999999999999998e129

    1. Initial program 91.7%

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

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

    if 9.19999999999999998e-21 < c < 3.8000000000000002e44

    1. Initial program 90.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 90.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.04999999999999998e129 < c

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.15 \cdot 10^{+38}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq 9.2 \cdot 10^{-21}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 3.8 \cdot 10^{+44}:\\ \;\;\;\;c \cdot \left(\left(b \cdot c\right) \cdot \left(i \cdot -2\right)\right)\\ \mathbf{elif}\;c \leq 1.05 \cdot 10^{+129}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(i \cdot \left(b \cdot \left(c \cdot c\right)\right)\right)\\ \end{array} \]

Alternative 15: 43.7% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.02 \cdot 10^{-59} \lor \neg \left(x \cdot y \leq 1.92 \cdot 10^{+99}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.01999999999999996e-59 or 1.9199999999999999e99 < (*.f64 x y)

    1. Initial program 86.2%

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

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

    if -1.01999999999999996e-59 < (*.f64 x y) < 1.9199999999999999e99

    1. Initial program 93.7%

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

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

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

Alternative 16: 57.2% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -1.4 \cdot 10^{+176} \lor \neg \left(i \leq 5 \cdot 10^{+219}\right):\\ \;\;\;\;-2 \cdot \left(a \cdot \left(c \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 (<= i -1.4e+176) (not (<= i 5e+219)))
   (* -2.0 (* a (* 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 ((i <= -1.4e+176) || !(i <= 5e+219)) {
		tmp = -2.0 * (a * (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 ((i <= (-1.4d+176)) .or. (.not. (i <= 5d+219))) then
        tmp = (-2.0d0) * (a * (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 ((i <= -1.4e+176) || !(i <= 5e+219)) {
		tmp = -2.0 * (a * (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 (i <= -1.4e+176) or not (i <= 5e+219):
		tmp = -2.0 * (a * (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 ((i <= -1.4e+176) || !(i <= 5e+219))
		tmp = Float64(-2.0 * Float64(a * Float64(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 ((i <= -1.4e+176) || ~((i <= 5e+219)))
		tmp = -2.0 * (a * (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[i, -1.4e+176], N[Not[LessEqual[i, 5e+219]], $MachinePrecision]], N[(-2.0 * N[(a * N[(c * 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}\;i \leq -1.4 \cdot 10^{+176} \lor \neg \left(i \leq 5 \cdot 10^{+219}\right):\\
\;\;\;\;-2 \cdot \left(a \cdot \left(c \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 i < -1.4000000000000001e176 or 5e219 < i

    1. Initial program 94.5%

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

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

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

    if -1.4000000000000001e176 < i < 5e219

    1. Initial program 89.1%

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

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

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

Alternative 17: 29.1% accurate, 3.8× speedup?

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

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

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

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

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

Developer target: 94.0% 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 2023271 
(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))))