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

Percentage Accurate: 90.1% → 95.6%
Time: 22.9s
Alternatives: 19
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 19 alternatives:

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

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

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
\mathbf{if}\;\left(x \cdot y + z \cdot t\right) - \left(c \cdot t_1\right) \cdot i \leq \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(y, x, c \cdot \left(a \cdot \left(-i\right)\right)\right)\\


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

    1. Initial program 92.0%

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

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

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

      \[\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. Step-by-step derivation
      1. associate--l+0.0%

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

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

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

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

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

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

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

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

      \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{-1 \cdot \left(a \cdot \left(c \cdot i\right)\right)}\right) \]
    5. Step-by-step derivation
      1. *-commutative68.8%

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, -1 \cdot \color{blue}{\left(\left(c \cdot i\right) \cdot a\right)}\right) \]
      2. associate-*r*68.8%

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{\left(-1 \cdot \left(c \cdot i\right)\right) \cdot a}\right) \]
      3. neg-mul-168.8%

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

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

        \[\leadsto 2 \cdot \mathsf{fma}\left(y, x, \color{blue}{c \cdot \left(\left(-i\right) \cdot a\right)}\right) \]
    6. Simplified62.8%

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

    \[\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(y, x, c \cdot \left(a \cdot \left(-i\right)\right)\right)\\ \end{array} \]

Alternative 2: 92.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -3.3 \cdot 10^{-107} \lor \neg \left(i \leq 6.2 \cdot 10^{-57}\right):\\ \;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= i -3.3e-107) (not (<= i 6.2e-57)))
   (* (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)) 2.0)
   (* 2.0 (- (fma x y (* z t)) (* c (* b (* c i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -3.3e-107) || !(i <= 6.2e-57)) {
		tmp = (((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) * 2.0;
	} else {
		tmp = 2.0 * (fma(x, y, (z * t)) - (c * (b * (c * i))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((i <= -3.3e-107) || !(i <= 6.2e-57))
		tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) * 2.0);
	else
		tmp = Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(c * Float64(b * Float64(c * i)))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -3.3e-107], N[Not[LessEqual[i, 6.2e-57]], $MachinePrecision]], N[(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] * 2.0), $MachinePrecision], N[(2.0 * N[(N[(x * y + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -3.3 \cdot 10^{-107} \lor \neg \left(i \leq 6.2 \cdot 10^{-57}\right):\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - \left(c \cdot \left(a + b \cdot c\right)\right) \cdot i\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -3.30000000000000004e-107 or 6.19999999999999952e-57 < i

    1. Initial program 91.9%

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

    if -3.30000000000000004e-107 < i < 6.19999999999999952e-57

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

Alternative 3: 92.4% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;i \leq -5.2 \cdot 10^{-104} \lor \neg \left(i \leq 8 \cdot 10^{-57}\right):\\ \;\;\;\;\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(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= i -5.2e-104) (not (<= i 8e-57)))
   (* (- (+ (* x y) (* z t)) (* (* c (+ a (* b c))) i)) 2.0)
   (* 2.0 (fma y x (- (* z t) (* c (* b (* c i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double tmp;
	if ((i <= -5.2e-104) || !(i <= 8e-57)) {
		tmp = (((x * y) + (z * t)) - ((c * (a + (b * c))) * i)) * 2.0;
	} else {
		tmp = 2.0 * fma(y, x, ((z * t) - (c * (b * (c * i)))));
	}
	return tmp;
}
function code(x, y, z, t, a, b, c, i)
	tmp = 0.0
	if ((i <= -5.2e-104) || !(i <= 8e-57))
		tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(Float64(c * Float64(a + Float64(b * c))) * i)) * 2.0);
	else
		tmp = Float64(2.0 * fma(y, x, Float64(Float64(z * t) - Float64(c * Float64(b * Float64(c * i))))));
	end
	return tmp
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -5.2e-104], N[Not[LessEqual[i, 8e-57]], $MachinePrecision]], N[(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] * 2.0), $MachinePrecision], N[(2.0 * N[(y * x + N[(N[(z * t), $MachinePrecision] - N[(c * N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;i \leq -5.2 \cdot 10^{-104} \lor \neg \left(i \leq 8 \cdot 10^{-57}\right):\\
\;\;\;\;\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(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -5.20000000000000005e-104 or 7.99999999999999964e-57 < i

    1. Initial program 91.9%

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

    if -5.20000000000000005e-104 < i < 7.99999999999999964e-57

    1. Initial program 78.6%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -5.2 \cdot 10^{-104} \lor \neg \left(i \leq 8 \cdot 10^{-57}\right):\\ \;\;\;\;\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(y, x, z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 4: 90.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t_2 \leq \infty:\\
\;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t_2 \cdot i\right) \cdot 2\\

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 90.7%

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

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

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

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

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

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

Alternative 5: 40.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\ t_2 := 2 \cdot \left(z \cdot t\right)\\ t_3 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+103}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq -20:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-103}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-319}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 10^{+25}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* -2.0 (* c (* a i))))
        (t_2 (* 2.0 (* z t)))
        (t_3 (* (* x y) 2.0)))
   (if (<= (* x y) -1e+103)
     t_3
     (if (<= (* x y) -20.0)
       t_1
       (if (<= (* x y) -5e-103)
         t_2
         (if (<= (* x y) -1e-319)
           t_1
           (if (<= (* x y) 3.2e-202) t_2 (if (<= (* x y) 1e+25) t_1 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 * (c * (a * i));
	double t_2 = 2.0 * (z * t);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -1e+103) {
		tmp = t_3;
	} else if ((x * y) <= -20.0) {
		tmp = t_1;
	} else if ((x * y) <= -5e-103) {
		tmp = t_2;
	} else if ((x * y) <= -1e-319) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e-202) {
		tmp = t_2;
	} else if ((x * y) <= 1e+25) {
		tmp = t_1;
	} 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) * (c * (a * i))
    t_2 = 2.0d0 * (z * t)
    t_3 = (x * y) * 2.0d0
    if ((x * y) <= (-1d+103)) then
        tmp = t_3
    else if ((x * y) <= (-20.0d0)) then
        tmp = t_1
    else if ((x * y) <= (-5d-103)) then
        tmp = t_2
    else if ((x * y) <= (-1d-319)) then
        tmp = t_1
    else if ((x * y) <= 3.2d-202) then
        tmp = t_2
    else if ((x * y) <= 1d+25) then
        tmp = t_1
    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 * (c * (a * i));
	double t_2 = 2.0 * (z * t);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -1e+103) {
		tmp = t_3;
	} else if ((x * y) <= -20.0) {
		tmp = t_1;
	} else if ((x * y) <= -5e-103) {
		tmp = t_2;
	} else if ((x * y) <= -1e-319) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e-202) {
		tmp = t_2;
	} else if ((x * y) <= 1e+25) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = -2.0 * (c * (a * i))
	t_2 = 2.0 * (z * t)
	t_3 = (x * y) * 2.0
	tmp = 0
	if (x * y) <= -1e+103:
		tmp = t_3
	elif (x * y) <= -20.0:
		tmp = t_1
	elif (x * y) <= -5e-103:
		tmp = t_2
	elif (x * y) <= -1e-319:
		tmp = t_1
	elif (x * y) <= 3.2e-202:
		tmp = t_2
	elif (x * y) <= 1e+25:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-2.0 * Float64(c * Float64(a * i)))
	t_2 = Float64(2.0 * Float64(z * t))
	t_3 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (Float64(x * y) <= -1e+103)
		tmp = t_3;
	elseif (Float64(x * y) <= -20.0)
		tmp = t_1;
	elseif (Float64(x * y) <= -5e-103)
		tmp = t_2;
	elseif (Float64(x * y) <= -1e-319)
		tmp = t_1;
	elseif (Float64(x * y) <= 3.2e-202)
		tmp = t_2;
	elseif (Float64(x * y) <= 1e+25)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = -2.0 * (c * (a * i));
	t_2 = 2.0 * (z * t);
	t_3 = (x * y) * 2.0;
	tmp = 0.0;
	if ((x * y) <= -1e+103)
		tmp = t_3;
	elseif ((x * y) <= -20.0)
		tmp = t_1;
	elseif ((x * y) <= -5e-103)
		tmp = t_2;
	elseif ((x * y) <= -1e-319)
		tmp = t_1;
	elseif ((x * y) <= 3.2e-202)
		tmp = t_2;
	elseif ((x * y) <= 1e+25)
		tmp = t_1;
	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[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+103], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -20.0], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -5e-103], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1e-319], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e-202], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 1e+25], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq -20:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-103}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-319}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-202}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 10^{+25}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -1e103 or 1.00000000000000009e25 < (*.f64 x y)

    1. Initial program 83.6%

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

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

    if -1e103 < (*.f64 x y) < -20 or -4.99999999999999966e-103 < (*.f64 x y) < -9.99989e-320 or 3.2000000000000001e-202 < (*.f64 x y) < 1.00000000000000009e25

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

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

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

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

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

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

    if -20 < (*.f64 x y) < -4.99999999999999966e-103 or -9.99989e-320 < (*.f64 x y) < 3.2000000000000001e-202

    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 inf 42.5%

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

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

Alternative 6: 40.9% accurate, 0.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := -2 \cdot \left(i \cdot \left(a \cdot c\right)\right)\\ t_2 := 2 \cdot \left(z \cdot t\right)\\ t_3 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -1 \cdot 10^{+103}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \cdot y \leq -20:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(a \cdot i\right)\right)\\ \mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-103}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-319}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-202}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+66}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* -2.0 (* i (* a c))))
        (t_2 (* 2.0 (* z t)))
        (t_3 (* (* x y) 2.0)))
   (if (<= (* x y) -1e+103)
     t_3
     (if (<= (* x y) -20.0)
       (* -2.0 (* c (* a i)))
       (if (<= (* x y) -5e-103)
         t_2
         (if (<= (* x y) -1e-319)
           t_1
           (if (<= (* x y) 3.2e-202) t_2 (if (<= (* x y) 5e+66) t_1 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 * (i * (a * c));
	double t_2 = 2.0 * (z * t);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -1e+103) {
		tmp = t_3;
	} else if ((x * y) <= -20.0) {
		tmp = -2.0 * (c * (a * i));
	} else if ((x * y) <= -5e-103) {
		tmp = t_2;
	} else if ((x * y) <= -1e-319) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e-202) {
		tmp = t_2;
	} else if ((x * y) <= 5e+66) {
		tmp = t_1;
	} 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) * (i * (a * c))
    t_2 = 2.0d0 * (z * t)
    t_3 = (x * y) * 2.0d0
    if ((x * y) <= (-1d+103)) then
        tmp = t_3
    else if ((x * y) <= (-20.0d0)) then
        tmp = (-2.0d0) * (c * (a * i))
    else if ((x * y) <= (-5d-103)) then
        tmp = t_2
    else if ((x * y) <= (-1d-319)) then
        tmp = t_1
    else if ((x * y) <= 3.2d-202) then
        tmp = t_2
    else if ((x * y) <= 5d+66) then
        tmp = t_1
    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 * (i * (a * c));
	double t_2 = 2.0 * (z * t);
	double t_3 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -1e+103) {
		tmp = t_3;
	} else if ((x * y) <= -20.0) {
		tmp = -2.0 * (c * (a * i));
	} else if ((x * y) <= -5e-103) {
		tmp = t_2;
	} else if ((x * y) <= -1e-319) {
		tmp = t_1;
	} else if ((x * y) <= 3.2e-202) {
		tmp = t_2;
	} else if ((x * y) <= 5e+66) {
		tmp = t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = -2.0 * (i * (a * c))
	t_2 = 2.0 * (z * t)
	t_3 = (x * y) * 2.0
	tmp = 0
	if (x * y) <= -1e+103:
		tmp = t_3
	elif (x * y) <= -20.0:
		tmp = -2.0 * (c * (a * i))
	elif (x * y) <= -5e-103:
		tmp = t_2
	elif (x * y) <= -1e-319:
		tmp = t_1
	elif (x * y) <= 3.2e-202:
		tmp = t_2
	elif (x * y) <= 5e+66:
		tmp = t_1
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(-2.0 * Float64(i * Float64(a * c)))
	t_2 = Float64(2.0 * Float64(z * t))
	t_3 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (Float64(x * y) <= -1e+103)
		tmp = t_3;
	elseif (Float64(x * y) <= -20.0)
		tmp = Float64(-2.0 * Float64(c * Float64(a * i)));
	elseif (Float64(x * y) <= -5e-103)
		tmp = t_2;
	elseif (Float64(x * y) <= -1e-319)
		tmp = t_1;
	elseif (Float64(x * y) <= 3.2e-202)
		tmp = t_2;
	elseif (Float64(x * y) <= 5e+66)
		tmp = t_1;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = -2.0 * (i * (a * c));
	t_2 = 2.0 * (z * t);
	t_3 = (x * y) * 2.0;
	tmp = 0.0;
	if ((x * y) <= -1e+103)
		tmp = t_3;
	elseif ((x * y) <= -20.0)
		tmp = -2.0 * (c * (a * i));
	elseif ((x * y) <= -5e-103)
		tmp = t_2;
	elseif ((x * y) <= -1e-319)
		tmp = t_1;
	elseif ((x * y) <= 3.2e-202)
		tmp = t_2;
	elseif ((x * y) <= 5e+66)
		tmp = t_1;
	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[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1e+103], t$95$3, If[LessEqual[N[(x * y), $MachinePrecision], -20.0], N[(-2.0 * N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], -5e-103], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -1e-319], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 3.2e-202], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 5e+66], t$95$1, t$95$3]]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{-103}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-319}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 3.2 \cdot 10^{-202}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+66}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1e103 or 4.99999999999999991e66 < (*.f64 x y)

    1. Initial program 82.5%

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

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

    if -1e103 < (*.f64 x y) < -20

    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 i around inf 49.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 c around 0 49.2%

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

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

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

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

    if -20 < (*.f64 x y) < -4.99999999999999966e-103 or -9.99989e-320 < (*.f64 x y) < 3.2000000000000001e-202

    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 inf 42.5%

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

    if -4.99999999999999966e-103 < (*.f64 x y) < -9.99989e-320 or 3.2000000000000001e-202 < (*.f64 x y) < 4.99999999999999991e66

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

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

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

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

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

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

Alternative 7: 76.7% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq -5 \cdot 10^{+99}:\\
\;\;\;\;t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -5.00000000000000022e244 or -9.9999999999999992e180 < (*.f64 x y) < -5.00000000000000008e99

    1. Initial program 87.4%

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

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

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

    if -5.00000000000000022e244 < (*.f64 x y) < -9.9999999999999992e180

    1. Initial program 68.3%

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

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

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

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

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

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

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

    if -5.00000000000000008e99 < (*.f64 x y) < 5.00000000000000027e31

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

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

    if 5.00000000000000027e31 < (*.f64 x y)

    1. Initial program 82.6%

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

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

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

Alternative 8: 44.2% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;x \cdot y \leq -4 \cdot 10^{-283}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+31}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -4.9999999999999997e104 or 5.00000000000000027e31 < (*.f64 x y)

    1. Initial program 83.3%

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

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

    if -4.9999999999999997e104 < (*.f64 x y) < -20

    1. Initial program 86.8%

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

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

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

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

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

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

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

    if -20 < (*.f64 x y) < -3.99999999999999979e-283 or 1e-209 < (*.f64 x y) < 5.00000000000000027e31

    1. Initial program 93.0%

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

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

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

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

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

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

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

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

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

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

    if -3.99999999999999979e-283 < (*.f64 x y) < 1e-209

    1. Initial program 80.6%

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

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

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

Alternative 9: 83.8% accurate, 0.8× speedup?

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

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

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

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


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

    1. Initial program 85.1%

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

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

    if -1e3 < (*.f64 x y) < 9.9999999999999991e-97

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

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

    if 9.9999999999999991e-97 < (*.f64 x y)

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

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

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

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

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

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

Alternative 10: 43.1% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -20:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+66}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -4.9999999999999997e104 or 4.99999999999999991e66 < (*.f64 x y)

    1. Initial program 82.3%

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

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

    if -4.9999999999999997e104 < (*.f64 x y) < -20 or 3.2000000000000001e-202 < (*.f64 x y) < 4.99999999999999991e66

    1. Initial program 93.1%

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

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

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

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

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

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

    if -20 < (*.f64 x y) < 3.2000000000000001e-202

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

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

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

Alternative 11: 70.2% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;c \leq -1.08 \cdot 10^{-119}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\

\mathbf{elif}\;c \leq 2.55 \cdot 10^{-111}:\\
\;\;\;\;t_2\\

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

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


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

    1. Initial program 77.5%

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

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

    if -1.1e45 < c < -2.29999999999999989e-12 or -1.0799999999999999e-119 < c < 2.55000000000000016e-111

    1. Initial program 96.6%

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

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

    if -2.29999999999999989e-12 < c < -1.0799999999999999e-119

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

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

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

    if 2.55000000000000016e-111 < c < 8.5e123

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + -1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
      2. mul-1-neg63.8%

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

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

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

    if 8.5e123 < c

    1. Initial program 67.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 i around inf 75.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 80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.1 \cdot 10^{+45}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -2.3 \cdot 10^{-12}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq -1.08 \cdot 10^{-119}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.55 \cdot 10^{-111}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 8.5 \cdot 10^{+123}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]

Alternative 12: 69.9% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;c \leq -8 \cdot 10^{-120}:\\
\;\;\;\;2 \cdot \left(x \cdot y - t_1\right)\\

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

\mathbf{elif}\;c \leq 8 \cdot 10^{+124}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if c < -6.5000000000000005e68

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

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

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

    if -6.5000000000000005e68 < c < -2.8499999999999999e-11

    1. Initial program 80.1%

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

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

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

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

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

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

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

    if -2.8499999999999999e-11 < c < -7.99999999999999983e-120

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

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

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

    if -7.99999999999999983e-120 < c < 2.4999999999999999e-113

    1. Initial program 97.4%

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

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

    if 2.4999999999999999e-113 < c < 7.99999999999999959e124

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + -1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
      2. mul-1-neg63.8%

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

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

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

    if 7.99999999999999959e124 < c

    1. Initial program 67.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 i around inf 75.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 80.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -6.5 \cdot 10^{+68}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -2.85 \cdot 10^{-11}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -8 \cdot 10^{-120}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.5 \cdot 10^{-113}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 8 \cdot 10^{+124}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \end{array} \]

Alternative 13: 69.0% accurate, 1.0× speedup?

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

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

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

\mathbf{elif}\;c \leq 6.6 \cdot 10^{+114}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;c \leq 2.15 \cdot 10^{+156}:\\
\;\;\;\;t_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -6.9999999999999995e88 or 7.59999999999999961e127 < c < 2.14999999999999993e156

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

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

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

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

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

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

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

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

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

    if -6.9999999999999995e88 < c < 2.8500000000000001e85 or 6.6000000000000001e114 < c < 7.59999999999999961e127

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

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

    if 2.8500000000000001e85 < c < 6.6000000000000001e114 or 2.14999999999999993e156 < c

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -7 \cdot 10^{+88}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.85 \cdot 10^{+85}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 6.6 \cdot 10^{+114}:\\ \;\;\;\;b \cdot \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot -2\right)\\ \mathbf{elif}\;c \leq 7.6 \cdot 10^{+127}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 2.15 \cdot 10^{+156}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(c \cdot \left(c \cdot i\right)\right) \cdot -2\right)\\ \end{array} \]

Alternative 14: 74.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.65 \cdot 10^{+45} \lor \neg \left(c \leq 6.2 \cdot 10^{-60} \lor \neg \left(c \leq 0.0062\right) \land c \leq 9.4 \cdot 10^{+42}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.65e45 or 6.19999999999999976e-60 < c < 0.00619999999999999978 or 9.39999999999999971e42 < c

    1. Initial program 77.4%

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

      \[\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 i around 0 75.1%

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

    if -1.65e45 < c < 6.19999999999999976e-60 or 0.00619999999999999978 < c < 9.39999999999999971e42

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.65 \cdot 10^{+45} \lor \neg \left(c \leq 6.2 \cdot 10^{-60} \lor \neg \left(c \leq 0.0062\right) \land c \leq 9.4 \cdot 10^{+42}\right):\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]

Alternative 15: 83.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 79.9%

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

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

    if -2.00000000000000012e-9 < c < 3.0000000000000002e127

    1. Initial program 93.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 86.0%

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

    if 3.0000000000000002e127 < c

    1. Initial program 67.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 i around inf 75.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 80.6%

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

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

Alternative 16: 71.0% accurate, 1.1× speedup?

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

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

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

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

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


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

    1. Initial program 77.5%

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

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

    if -8.0000000000000007e44 < c < 7.9999999999999996e-112

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

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

    if 7.9999999999999996e-112 < c < 9.4999999999999994e119

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

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(t \cdot z + -1 \cdot \left(a \cdot \left(c \cdot i\right)\right)\right)} \]
      2. mul-1-neg63.8%

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

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

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

    if 9.4999999999999994e119 < c

    1. Initial program 67.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 i around inf 75.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 80.6%

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

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

Alternative 17: 44.3% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -5 \cdot 10^{+112} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+66}\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) -5e+112) (not (<= (* x y) 5e+66)))
   (* (* 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) <= -5e+112) || !((x * y) <= 5e+66)) {
		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) <= (-5d+112)) .or. (.not. ((x * y) <= 5d+66))) 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) <= -5e+112) || !((x * y) <= 5e+66)) {
		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) <= -5e+112) or not ((x * y) <= 5e+66):
		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) <= -5e+112) || !(Float64(x * y) <= 5e+66))
		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) <= -5e+112) || ~(((x * y) <= 5e+66)))
		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], -5e+112], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+66]], $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 -5 \cdot 10^{+112} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+66}\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) < -5e112 or 4.99999999999999991e66 < (*.f64 x y)

    1. Initial program 82.1%

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

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

    if -5e112 < (*.f64 x y) < 4.99999999999999991e66

    1. Initial program 88.9%

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

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

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

Alternative 18: 68.6% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -7.2 \cdot 10^{+83} \lor \neg \left(c \leq 7.2 \cdot 10^{+119}\right):\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (if (or (<= c -7.2e+83) (not (<= c 7.2e+119)))
   (* -2.0 (* c (* (* 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 <= -7.2e+83) || !(c <= 7.2e+119)) {
		tmp = -2.0 * (c * ((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 <= (-7.2d+83)) .or. (.not. (c <= 7.2d+119))) then
        tmp = (-2.0d0) * (c * ((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 <= -7.2e+83) || !(c <= 7.2e+119)) {
		tmp = -2.0 * (c * ((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 <= -7.2e+83) or not (c <= 7.2e+119):
		tmp = -2.0 * (c * ((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 <= -7.2e+83) || !(c <= 7.2e+119))
		tmp = Float64(-2.0 * Float64(c * Float64(Float64(b * c) * i)));
	else
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	tmp = 0.0;
	if ((c <= -7.2e+83) || ~((c <= 7.2e+119)))
		tmp = -2.0 * (c * ((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, -7.2e+83], N[Not[LessEqual[c, 7.2e+119]], $MachinePrecision]], N[(-2.0 * N[(c * N[(N[(b * c), $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 -7.2 \cdot 10^{+83} \lor \neg \left(c \leq 7.2 \cdot 10^{+119}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -7.1999999999999995e83 or 7.20000000000000003e119 < c

    1. Initial program 74.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 83.3%

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

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

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

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

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

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

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

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

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

    if -7.1999999999999995e83 < c < 7.20000000000000003e119

    1. Initial program 92.1%

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

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

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

Alternative 19: 29.2% 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 86.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 26.4%

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

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

Developer target: 94.1% 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 2023282 
(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))))