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

Percentage Accurate: 89.5% → 96.1%
Time: 13.6s
Alternatives: 18
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 18 alternatives:

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

Initial Program: 89.5% accurate, 1.0× speedup?

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

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

Alternative 1: 96.1% accurate, 0.1× speedup?

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

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

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

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

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

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

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

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

    1. Initial program 0.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in i around inf 50.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. Recombined 2 regimes into one program.
  4. Final simplification96.8%

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

Alternative 2: 92.4% accurate, 0.5× speedup?

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

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

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


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

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

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

    1. Initial program 0.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Taylor expanded in i around inf 50.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. Recombined 2 regimes into one program.
  4. Final simplification92.7%

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

Alternative 3: 66.7% accurate, 0.6× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.84999999999999992e105 or 6.19999999999999985e49 < (*.f64 x y) < 1.02000000000000001e96

    1. Initial program 86.5%

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

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

    if -1.84999999999999992e105 < (*.f64 x y) < -1.04999999999999989e-53

    1. Initial program 99.9%

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

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

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

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

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

    if -1.04999999999999989e-53 < (*.f64 x y) < 6.19999999999999985e49

    1. Initial program 91.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 73.3%

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

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

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

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

    if 1.02000000000000001e96 < (*.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 z around 0 82.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.85 \cdot 10^{+105}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq -1.05 \cdot 10^{-53}:\\ \;\;\;\;2 \cdot \left(x \cdot y - b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 6.2 \cdot 10^{+49}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 1.02 \cdot 10^{+96}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]

Alternative 4: 41.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{-24}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq -2.3 \cdot 10^{-180}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-207}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 0.47:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{+198}:\\ \;\;\;\;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 (* z t))) (t_2 (* (* x y) 2.0)))
   (if (<= (* x y) -1.8e-24)
     t_2
     (if (<= (* x y) -2.3e-180)
       (* 2.0 (* i (* a (- c))))
       (if (<= (* x y) 2.2e-207)
         t_1
         (if (<= (* x y) 0.47)
           (* (* a (* c i)) -2.0)
           (if (<= (* x y) 8e+198) 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 * (z * t);
	double t_2 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -1.8e-24) {
		tmp = t_2;
	} else if ((x * y) <= -2.3e-180) {
		tmp = 2.0 * (i * (a * -c));
	} else if ((x * y) <= 2.2e-207) {
		tmp = t_1;
	} else if ((x * y) <= 0.47) {
		tmp = (a * (c * i)) * -2.0;
	} else if ((x * y) <= 8e+198) {
		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 * (z * t)
    t_2 = (x * y) * 2.0d0
    if ((x * y) <= (-1.8d-24)) then
        tmp = t_2
    else if ((x * y) <= (-2.3d-180)) then
        tmp = 2.0d0 * (i * (a * -c))
    else if ((x * y) <= 2.2d-207) then
        tmp = t_1
    else if ((x * y) <= 0.47d0) then
        tmp = (a * (c * i)) * (-2.0d0)
    else if ((x * y) <= 8d+198) 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 * (z * t);
	double t_2 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -1.8e-24) {
		tmp = t_2;
	} else if ((x * y) <= -2.3e-180) {
		tmp = 2.0 * (i * (a * -c));
	} else if ((x * y) <= 2.2e-207) {
		tmp = t_1;
	} else if ((x * y) <= 0.47) {
		tmp = (a * (c * i)) * -2.0;
	} else if ((x * y) <= 8e+198) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (z * t)
	t_2 = (x * y) * 2.0
	tmp = 0
	if (x * y) <= -1.8e-24:
		tmp = t_2
	elif (x * y) <= -2.3e-180:
		tmp = 2.0 * (i * (a * -c))
	elif (x * y) <= 2.2e-207:
		tmp = t_1
	elif (x * y) <= 0.47:
		tmp = (a * (c * i)) * -2.0
	elif (x * y) <= 8e+198:
		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(z * t))
	t_2 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (Float64(x * y) <= -1.8e-24)
		tmp = t_2;
	elseif (Float64(x * y) <= -2.3e-180)
		tmp = Float64(2.0 * Float64(i * Float64(a * Float64(-c))));
	elseif (Float64(x * y) <= 2.2e-207)
		tmp = t_1;
	elseif (Float64(x * y) <= 0.47)
		tmp = Float64(Float64(a * Float64(c * i)) * -2.0);
	elseif (Float64(x * y) <= 8e+198)
		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 * (z * t);
	t_2 = (x * y) * 2.0;
	tmp = 0.0;
	if ((x * y) <= -1.8e-24)
		tmp = t_2;
	elseif ((x * y) <= -2.3e-180)
		tmp = 2.0 * (i * (a * -c));
	elseif ((x * y) <= 2.2e-207)
		tmp = t_1;
	elseif ((x * y) <= 0.47)
		tmp = (a * (c * i)) * -2.0;
	elseif ((x * y) <= 8e+198)
		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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -1.8e-24], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], -2.3e-180], N[(2.0 * N[(i * N[(a * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2.2e-207], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 0.47], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 8e+198], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-207}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -1.8e-24 or 8.00000000000000014e198 < (*.f64 x y)

    1. Initial program 88.5%

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

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

    if -1.8e-24 < (*.f64 x y) < -2.29999999999999996e-180

    1. Initial program 89.1%

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

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

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

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

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

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

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

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

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

    if -2.29999999999999996e-180 < (*.f64 x y) < 2.1999999999999999e-207 or 0.46999999999999997 < (*.f64 x y) < 8.00000000000000014e198

    1. Initial program 89.8%

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

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

    if 2.1999999999999999e-207 < (*.f64 x y) < 0.46999999999999997

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -1.8 \cdot 10^{-24}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq -2.3 \cdot 10^{-180}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 2.2 \cdot 10^{-207}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 0.47:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 8 \cdot 10^{+198}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 5: 73.9% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;c \leq -7 \cdot 10^{+29}:\\
\;\;\;\;t_1\\

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

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

\mathbf{elif}\;c \leq 4.5 \cdot 10^{+46}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -1.5499999999999999e69 or 4.5000000000000001e46 < c

    1. Initial program 80.4%

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

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

    if -1.5499999999999999e69 < c < -6.99999999999999958e29 or -1.16000000000000008e-83 < c < 4.5000000000000001e46

    1. Initial program 96.8%

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

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

    if -6.99999999999999958e29 < c < -2.00000000000000007e-10

    1. Initial program 100.0%

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

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

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

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

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

    if -2.00000000000000007e-10 < c < -1.16000000000000008e-83

    1. Initial program 99.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.55 \cdot 10^{+69}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -7 \cdot 10^{+29}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq -2 \cdot 10^{-10}:\\ \;\;\;\;2 \cdot \left(x \cdot y - b \cdot \left(i \cdot \left(c \cdot c\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.16 \cdot 10^{-83}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 4.5 \cdot 10^{+46}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \end{array} \]

Alternative 6: 40.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t\right)\\ t_2 := \left(x \cdot y\right) \cdot 2\\ \mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{+264}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{-210}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \cdot y \leq 1:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+198}:\\ \;\;\;\;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 (* z t))) (t_2 (* (* x y) 2.0)))
   (if (<= (* x y) -2.9e+264)
     t_2
     (if (<= (* x y) 4.6e-210)
       t_1
       (if (<= (* x y) 1.0)
         (* (* a (* c i)) -2.0)
         (if (<= (* x y) 9.5e+198) 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 * (z * t);
	double t_2 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -2.9e+264) {
		tmp = t_2;
	} else if ((x * y) <= 4.6e-210) {
		tmp = t_1;
	} else if ((x * y) <= 1.0) {
		tmp = (a * (c * i)) * -2.0;
	} else if ((x * y) <= 9.5e+198) {
		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 * (z * t)
    t_2 = (x * y) * 2.0d0
    if ((x * y) <= (-2.9d+264)) then
        tmp = t_2
    else if ((x * y) <= 4.6d-210) then
        tmp = t_1
    else if ((x * y) <= 1.0d0) then
        tmp = (a * (c * i)) * (-2.0d0)
    else if ((x * y) <= 9.5d+198) 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 * (z * t);
	double t_2 = (x * y) * 2.0;
	double tmp;
	if ((x * y) <= -2.9e+264) {
		tmp = t_2;
	} else if ((x * y) <= 4.6e-210) {
		tmp = t_1;
	} else if ((x * y) <= 1.0) {
		tmp = (a * (c * i)) * -2.0;
	} else if ((x * y) <= 9.5e+198) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (z * t)
	t_2 = (x * y) * 2.0
	tmp = 0
	if (x * y) <= -2.9e+264:
		tmp = t_2
	elif (x * y) <= 4.6e-210:
		tmp = t_1
	elif (x * y) <= 1.0:
		tmp = (a * (c * i)) * -2.0
	elif (x * y) <= 9.5e+198:
		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(z * t))
	t_2 = Float64(Float64(x * y) * 2.0)
	tmp = 0.0
	if (Float64(x * y) <= -2.9e+264)
		tmp = t_2;
	elseif (Float64(x * y) <= 4.6e-210)
		tmp = t_1;
	elseif (Float64(x * y) <= 1.0)
		tmp = Float64(Float64(a * Float64(c * i)) * -2.0);
	elseif (Float64(x * y) <= 9.5e+198)
		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 * (z * t);
	t_2 = (x * y) * 2.0;
	tmp = 0.0;
	if ((x * y) <= -2.9e+264)
		tmp = t_2;
	elseif ((x * y) <= 4.6e-210)
		tmp = t_1;
	elseif ((x * y) <= 1.0)
		tmp = (a * (c * i)) * -2.0;
	elseif ((x * y) <= 9.5e+198)
		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[(z * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * y), $MachinePrecision] * 2.0), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2.9e+264], t$95$2, If[LessEqual[N[(x * y), $MachinePrecision], 4.6e-210], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1.0], N[(N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision] * -2.0), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 9.5e+198], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{-210}:\\
\;\;\;\;t_1\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.8999999999999998e264 or 9.5e198 < (*.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 77.6%

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

    if -2.8999999999999998e264 < (*.f64 x y) < 4.6e-210 or 1 < (*.f64 x y) < 9.5e198

    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) \]
    2. Taylor expanded in z around inf 41.6%

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

    if 4.6e-210 < (*.f64 x y) < 1

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{+264}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \mathbf{elif}\;x \cdot y \leq 4.6 \cdot 10^{-210}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 1:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 9.5 \cdot 10^{+198}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y\right) \cdot 2\\ \end{array} \]

Alternative 7: 81.5% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x \cdot y + z \cdot t\\ \mathbf{if}\;a \leq -7.6 \cdot 10^{+92} \lor \neg \left(a \leq 1.95 \cdot 10^{-89}\right):\\ \;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(t_1 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ (* x y) (* z t))))
   (if (or (<= a -7.6e+92) (not (<= a 1.95e-89)))
     (* 2.0 (- t_1 (* i (* a c))))
     (* 2.0 (- t_1 (* i (* c (* b c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) + (z * t);
	double tmp;
	if ((a <= -7.6e+92) || !(a <= 1.95e-89)) {
		tmp = 2.0 * (t_1 - (i * (a * c)));
	} else {
		tmp = 2.0 * (t_1 - (i * (c * (b * c))));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: tmp
    t_1 = (x * y) + (z * t)
    if ((a <= (-7.6d+92)) .or. (.not. (a <= 1.95d-89))) then
        tmp = 2.0d0 * (t_1 - (i * (a * c)))
    else
        tmp = 2.0d0 * (t_1 - (i * (c * (b * c))))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = (x * y) + (z * t);
	double tmp;
	if ((a <= -7.6e+92) || !(a <= 1.95e-89)) {
		tmp = 2.0 * (t_1 - (i * (a * c)));
	} else {
		tmp = 2.0 * (t_1 - (i * (c * (b * c))));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = (x * y) + (z * t)
	tmp = 0
	if (a <= -7.6e+92) or not (a <= 1.95e-89):
		tmp = 2.0 * (t_1 - (i * (a * c)))
	else:
		tmp = 2.0 * (t_1 - (i * (c * (b * c))))
	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 ((a <= -7.6e+92) || !(a <= 1.95e-89))
		tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(a * c))));
	else
		tmp = Float64(2.0 * Float64(t_1 - Float64(i * Float64(c * Float64(b * c)))));
	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 ((a <= -7.6e+92) || ~((a <= 1.95e-89)))
		tmp = 2.0 * (t_1 - (i * (a * c)));
	else
		tmp = 2.0 * (t_1 - (i * (c * (b * c))));
	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[Or[LessEqual[a, -7.6e+92], N[Not[LessEqual[a, 1.95e-89]], $MachinePrecision]], N[(2.0 * N[(t$95$1 - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(t$95$1 - N[(i * N[(c * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x \cdot y + z \cdot t\\
\mathbf{if}\;a \leq -7.6 \cdot 10^{+92} \lor \neg \left(a \leq 1.95 \cdot 10^{-89}\right):\\
\;\;\;\;2 \cdot \left(t_1 - i \cdot \left(a \cdot c\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.6000000000000001e92 or 1.94999999999999989e-89 < a

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

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

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

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

    if -7.6000000000000001e92 < a < 1.94999999999999989e-89

    1. Initial program 94.9%

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

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

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

Alternative 8: 67.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ t_2 := 2 \cdot \left(i \cdot \left(c \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\ \mathbf{if}\;c \leq -1.65 \cdot 10^{+201}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;c \leq -1.8 \cdot 10^{+69}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;c \leq 5.3 \cdot 10^{-17}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 4.9 \cdot 10^{+136}:\\ \;\;\;\;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 (- (* z t) (* a (* c i)))))
        (t_2 (* 2.0 (* i (* c (* b (- c)))))))
   (if (<= c -1.65e+201)
     t_2
     (if (<= c -1.8e+69)
       t_1
       (if (<= c 5.3e-17)
         (* (+ (* x y) (* z t)) 2.0)
         (if (<= c 4.9e+136) 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 * ((z * t) - (a * (c * i)));
	double t_2 = 2.0 * (i * (c * (b * -c)));
	double tmp;
	if (c <= -1.65e+201) {
		tmp = t_2;
	} else if (c <= -1.8e+69) {
		tmp = t_1;
	} else if (c <= 5.3e-17) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if (c <= 4.9e+136) {
		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 * ((z * t) - (a * (c * i)))
    t_2 = 2.0d0 * (i * (c * (b * -c)))
    if (c <= (-1.65d+201)) then
        tmp = t_2
    else if (c <= (-1.8d+69)) then
        tmp = t_1
    else if (c <= 5.3d-17) then
        tmp = ((x * y) + (z * t)) * 2.0d0
    else if (c <= 4.9d+136) 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 * ((z * t) - (a * (c * i)));
	double t_2 = 2.0 * (i * (c * (b * -c)));
	double tmp;
	if (c <= -1.65e+201) {
		tmp = t_2;
	} else if (c <= -1.8e+69) {
		tmp = t_1;
	} else if (c <= 5.3e-17) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if (c <= 4.9e+136) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * ((z * t) - (a * (c * i)))
	t_2 = 2.0 * (i * (c * (b * -c)))
	tmp = 0
	if c <= -1.65e+201:
		tmp = t_2
	elif c <= -1.8e+69:
		tmp = t_1
	elif c <= 5.3e-17:
		tmp = ((x * y) + (z * t)) * 2.0
	elif c <= 4.9e+136:
		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(Float64(z * t) - Float64(a * Float64(c * i))))
	t_2 = Float64(2.0 * Float64(i * Float64(c * Float64(b * Float64(-c)))))
	tmp = 0.0
	if (c <= -1.65e+201)
		tmp = t_2;
	elseif (c <= -1.8e+69)
		tmp = t_1;
	elseif (c <= 5.3e-17)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	elseif (c <= 4.9e+136)
		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 * ((z * t) - (a * (c * i)));
	t_2 = 2.0 * (i * (c * (b * -c)));
	tmp = 0.0;
	if (c <= -1.65e+201)
		tmp = t_2;
	elseif (c <= -1.8e+69)
		tmp = t_1;
	elseif (c <= 5.3e-17)
		tmp = ((x * y) + (z * t)) * 2.0;
	elseif (c <= 4.9e+136)
		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[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(i * N[(c * N[(b * (-c)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.65e+201], t$95$2, If[LessEqual[c, -1.8e+69], t$95$1, If[LessEqual[c, 5.3e-17], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 4.9e+136], t$95$1, t$95$2]]]]]]
\begin{array}{l}

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

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

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

\mathbf{elif}\;c \leq 4.9 \cdot 10^{+136}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -1.65e201 or 4.90000000000000012e136 < c

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(\left(b \cdot c\right) \cdot c\right) \cdot \color{blue}{\left(\sqrt{-i} \cdot \sqrt{-i}\right)}\right) \]
      7. add-sqr-sqrt2.2%

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

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

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

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(-i\right) \cdot \left(c \cdot \left(b \cdot c\right)\right)}\right) \]
      12. add-sqr-sqrt2.1%

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\sqrt{\left(-i\right) \cdot \left(-i\right)}} \cdot \left(c \cdot \left(b \cdot c\right)\right)\right) \]
      14. sqr-neg25.8%

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(\sqrt{i} \cdot \sqrt{i}\right)} \cdot \left(c \cdot \left(b \cdot c\right)\right)\right) \]
      16. add-sqr-sqrt81.2%

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

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

    if -1.65e201 < c < -1.8000000000000001e69 or 5.2999999999999998e-17 < c < 4.90000000000000012e136

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

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

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

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

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

    if -1.8000000000000001e69 < c < 5.2999999999999998e-17

    1. Initial program 97.0%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.65 \cdot 10^{+201}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(c \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.8 \cdot 10^{+69}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 5.3 \cdot 10^{-17}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 4.9 \cdot 10^{+136}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(c \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\ \end{array} \]

Alternative 9: 80.0% accurate, 1.0× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.9999999999999998e-81 or 3.9999999999999999e-69 < c

    1. Initial program 85.6%

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

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

    if -3.9999999999999998e-81 < c < 3.9999999999999999e-69

    1. Initial program 97.7%

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

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

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

Alternative 10: 81.4% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 75.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(\left(b \cdot c\right) \cdot c\right) \cdot \color{blue}{\left(\sqrt{-i} \cdot \sqrt{-i}\right)}\right) \]
      7. add-sqr-sqrt0.5%

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

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

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

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(-i\right) \cdot \left(c \cdot \left(b \cdot c\right)\right)}\right) \]
      12. add-sqr-sqrt0.3%

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\sqrt{\left(-i\right) \cdot \left(-i\right)}} \cdot \left(c \cdot \left(b \cdot c\right)\right)\right) \]
      14. sqr-neg40.1%

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(\sqrt{i} \cdot \sqrt{i}\right)} \cdot \left(c \cdot \left(b \cdot c\right)\right)\right) \]
      16. add-sqr-sqrt90.1%

        \[\leadsto 2 \cdot \left(-\color{blue}{i} \cdot \left(c \cdot \left(b \cdot c\right)\right)\right) \]
    7. Applied egg-rr90.1%

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

    if -7.19999999999999951e201 < c < 7.99999999999999959e124

    1. Initial program 93.2%

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

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

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

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

    if 7.99999999999999959e124 < c

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

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

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

Alternative 11: 74.5% accurate, 1.2× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.5499999999999999e69 or 4.00000000000000006e43 < c

    1. Initial program 80.4%

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

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

    if -1.5499999999999999e69 < c < 4.00000000000000006e43

    1. Initial program 97.2%

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

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

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

Alternative 12: 68.8% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -4 \cdot 10^{+121} \lor \neg \left(c \leq 1.3 \cdot 10^{+130}\right):\\
\;\;\;\;2 \cdot \left(b \cdot \left(i \cdot \left(c \cdot \left(-c\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -4.00000000000000015e121 or 1.2999999999999999e130 < c

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

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

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

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

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

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

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

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

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

    if -4.00000000000000015e121 < c < 1.2999999999999999e130

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

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

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

Alternative 13: 68.5% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.5 \cdot 10^{+121} \lor \neg \left(c \leq 5 \cdot 10^{+126}\right):\\
\;\;\;\;2 \cdot \left(i \cdot \left(c \cdot \left(b \cdot \left(-c\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.5e121 or 4.99999999999999977e126 < c

    1. Initial program 83.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 0 77.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(-\left(\left(b \cdot c\right) \cdot c\right) \cdot \color{blue}{\left(\sqrt{-i} \cdot \sqrt{-i}\right)}\right) \]
      7. add-sqr-sqrt4.5%

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

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

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

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(-i\right) \cdot \left(c \cdot \left(b \cdot c\right)\right)}\right) \]
      12. add-sqr-sqrt4.2%

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\sqrt{\left(-i\right) \cdot \left(-i\right)}} \cdot \left(c \cdot \left(b \cdot c\right)\right)\right) \]
      14. sqr-neg29.4%

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

        \[\leadsto 2 \cdot \left(-\color{blue}{\left(\sqrt{i} \cdot \sqrt{i}\right)} \cdot \left(c \cdot \left(b \cdot c\right)\right)\right) \]
      16. add-sqr-sqrt74.1%

        \[\leadsto 2 \cdot \left(-\color{blue}{i} \cdot \left(c \cdot \left(b \cdot c\right)\right)\right) \]
    7. Applied egg-rr74.1%

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

    if -3.5e121 < c < 4.99999999999999977e126

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

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

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

Alternative 14: 41.5% accurate, 1.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.9 \cdot 10^{+264} \lor \neg \left(x \cdot y \leq 2.9 \cdot 10^{+200}\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) -2.9e+264) (not (<= (* x y) 2.9e+200)))
   (* (* 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) <= -2.9e+264) || !((x * y) <= 2.9e+200)) {
		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) <= (-2.9d+264)) .or. (.not. ((x * y) <= 2.9d+200))) 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) <= -2.9e+264) || !((x * y) <= 2.9e+200)) {
		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) <= -2.9e+264) or not ((x * y) <= 2.9e+200):
		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) <= -2.9e+264) || !(Float64(x * y) <= 2.9e+200))
		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) <= -2.9e+264) || ~(((x * y) <= 2.9e+200)))
		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], -2.9e+264], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.9e+200]], $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 -2.9 \cdot 10^{+264} \lor \neg \left(x \cdot y \leq 2.9 \cdot 10^{+200}\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) < -2.8999999999999998e264 or 2.8999999999999999e200 < (*.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 77.6%

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

    if -2.8999999999999998e264 < (*.f64 x y) < 2.8999999999999999e200

    1. Initial program 91.4%

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

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

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

Alternative 15: 69.4% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -4.5 \cdot 10^{+121} \lor \neg \left(c \leq 1.65 \cdot 10^{+125}\right):\\
\;\;\;\;\left(c \cdot \left(c \cdot i\right)\right) \cdot \left(b \cdot -2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -4.5000000000000003e121 or 1.65000000000000003e125 < c

    1. Initial program 83.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 81.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 c around inf 70.6%

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

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

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

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

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

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

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

    if -4.5000000000000003e121 < c < 1.65000000000000003e125

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

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

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

Alternative 16: 68.4% accurate, 1.4× speedup?

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

\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 < -6.50000000000000019e121 or 4.5000000000000001e129 < c

    1. Initial program 83.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 81.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 c around inf 70.6%

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

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

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

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

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

    if -6.50000000000000019e121 < c < 4.5000000000000001e129

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

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

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

Alternative 17: 57.5% accurate, 1.4× speedup?

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

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

\mathbf{elif}\;a \leq 9 \cdot 10^{+148}:\\
\;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -2.70000000000000013e222

    1. Initial program 73.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 67.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 67.6%

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

    if -2.70000000000000013e222 < a < 8.99999999999999987e148

    1. Initial program 91.7%

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

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

    if 8.99999999999999987e148 < a

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

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

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

Alternative 18: 29.1% accurate, 3.8× speedup?

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

\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 90.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 z around inf 35.9%

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

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

Developer target: 93.9% 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 2023293 
(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))))