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

Percentage Accurate: 89.9% → 96.7%
Time: 18.9s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 89.9% accurate, 1.0× speedup?

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

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

Alternative 1: 96.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 92.8%

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

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

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

      \[\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)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define97.7%

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

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

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

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

    1. Initial program 0.0%

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

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

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

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

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

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

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

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

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

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

Alternative 2: 83.4% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_3 \leq -1 \cdot 10^{-62}:\\
\;\;\;\;t\_4\\

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

\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+153}:\\
\;\;\;\;t\_4\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 70.9%

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1e-62 or 5.00000000000000036e-18 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e153

    1. Initial program 99.7%

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

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

    if -1e-62 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000036e-18

    1. Initial program 98.8%

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

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

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

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

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

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

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

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

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

Alternative 3: 86.6% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_3 \leq -5 \cdot 10^{+49}:\\
\;\;\;\;t\_4\\

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

\mathbf{elif}\;t\_3 \leq 10^{+307}:\\
\;\;\;\;t\_4\\

\mathbf{else}:\\
\;\;\;\;t\_2\\


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

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.0000000000000004e49 or 1e-26 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 9.99999999999999986e306

    1. Initial program 99.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. Add Preprocessing
    3. Taylor expanded in x around inf 93.2%

      \[\leadsto 2 \cdot \left(\color{blue}{x \cdot \left(y + \frac{t \cdot z}{x}\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    4. Step-by-step derivation
      1. associate-/l*88.5%

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

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

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

    if -5.0000000000000004e49 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1e-26

    1. Initial program 98.9%

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

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

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

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

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

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

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

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

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

Alternative 4: 95.1% accurate, 0.4× speedup?

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

\\
\begin{array}{l}
t_1 := a + b \cdot c\\
t_2 := \left(c \cdot t\_1\right) \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty \lor \neg \left(t\_2 \leq 10^{+307}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\

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


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

    1. Initial program 67.6%

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

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

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

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

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

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

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

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

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

    1. Initial program 99.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. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification94.9%

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

Alternative 5: 87.5% accurate, 0.5× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -5.00000000000000007e239 or 2.0000000000000001e167 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 72.1%

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

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

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

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

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

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

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

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

    if -5.00000000000000007e239 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2.0000000000000001e167

    1. Initial program 99.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. Add Preprocessing
    3. Taylor expanded in a around inf 90.6%

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

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

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

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

Alternative 6: 95.7% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 92.8%

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

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

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

      \[\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)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define97.7%

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

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

      \[\leadsto 2 \cdot \left(\color{blue}{\left(z \cdot t + x \cdot y\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. Add Preprocessing
    3. Taylor expanded in a around inf 33.3%

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

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

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

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

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

    \[\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(\left(x \cdot y + z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(-2 \cdot \frac{a \cdot \left(c \cdot i\right)}{x} + y \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 78.3% accurate, 0.7× speedup?

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

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

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

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


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

    1. Initial program 84.9%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z + x \cdot y\right)} \]
    6. Taylor expanded in x around inf 88.7%

      \[\leadsto \color{blue}{x \cdot \left(2 \cdot y + 2 \cdot \frac{t \cdot z}{x}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out88.7%

        \[\leadsto x \cdot \color{blue}{\left(2 \cdot \left(y + \frac{t \cdot z}{x}\right)\right)} \]
      2. associate-/l*92.6%

        \[\leadsto x \cdot \left(2 \cdot \left(y + \color{blue}{t \cdot \frac{z}{x}}\right)\right) \]
    8. Simplified92.6%

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

    if -2.0000000000000001e238 < (*.f64 x y) < 4.9999999999999998e87

    1. Initial program 89.0%

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

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

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

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

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

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

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

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

    if 4.9999999999999998e87 < (*.f64 x y)

    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. Step-by-step derivation
      1. fma-define84.8%

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(t \cdot z + x \cdot y\right)} \]
    6. Taylor expanded in y around inf 76.7%

      \[\leadsto \color{blue}{y \cdot \left(2 \cdot x + 2 \cdot \frac{t \cdot z}{y}\right)} \]
    7. Step-by-step derivation
      1. distribute-lft-out76.7%

        \[\leadsto y \cdot \color{blue}{\left(2 \cdot \left(x + \frac{t \cdot z}{y}\right)\right)} \]
      2. associate-/l*76.7%

        \[\leadsto y \cdot \left(2 \cdot \left(x + \color{blue}{t \cdot \frac{z}{y}}\right)\right) \]
    8. Simplified76.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+238}:\\ \;\;\;\;x \cdot \left(2 \cdot \left(y + t \cdot \frac{z}{x}\right)\right)\\ \mathbf{elif}\;x \cdot y \leq 5 \cdot 10^{+87}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;y \cdot \left(2 \cdot \left(x + t \cdot \frac{z}{y}\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 38.8% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot 2\right)\\
\mathbf{if}\;y \leq -1.6 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\

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

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

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.60000000000000011e-16 or 3.55e6 < y

    1. Initial program 84.0%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative45.5%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot 2} \]
      2. associate-*l*45.5%

        \[\leadsto \color{blue}{x \cdot \left(y \cdot 2\right)} \]
    7. Simplified45.5%

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

    if -1.60000000000000011e-16 < y < 1.40000000000000012e-265

    1. Initial program 93.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. Step-by-step derivation
      1. fma-define93.4%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(2 \cdot t\right) \cdot z} \]
      2. *-commutative33.0%

        \[\leadsto \color{blue}{\left(t \cdot 2\right)} \cdot z \]
      3. associate-*l*33.0%

        \[\leadsto \color{blue}{t \cdot \left(2 \cdot z\right)} \]
      4. *-commutative33.0%

        \[\leadsto t \cdot \color{blue}{\left(z \cdot 2\right)} \]
    7. Simplified33.0%

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

    if 1.40000000000000012e-265 < y < 3.55e6

    1. Initial program 87.5%

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

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

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

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

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

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

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

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

Alternative 9: 74.4% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.5999999999999999e83 or 1.9999999999999999e60 < c

    1. Initial program 70.8%

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

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

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

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

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

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

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

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

    if -1.5999999999999999e83 < c < 1.9999999999999999e60

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

Alternative 10: 69.2% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.2e84 or 3.2999999999999998e71 < c

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

    if -1.2e84 < c < 3.2999999999999998e71

    1. Initial program 97.3%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.2 \cdot 10^{+84} \lor \neg \left(c \leq 3.3 \cdot 10^{+71}\right):\\ \;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 47.6% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.6 \cdot 10^{+83} \lor \neg \left(c \leq 2.2 \cdot 10^{+72}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.5999999999999999e83 or 2.2e72 < c

    1. Initial program 70.7%

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

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

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

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

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

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

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

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

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

    if -1.5999999999999999e83 < c < 2.2e72

    1. Initial program 97.3%

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative39.5%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot 2} \]
      2. associate-*l*39.5%

        \[\leadsto \color{blue}{x \cdot \left(y \cdot 2\right)} \]
    7. Simplified39.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.6 \cdot 10^{+83} \lor \neg \left(c \leq 2.2 \cdot 10^{+72}\right):\\ \;\;\;\;-2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 12: 33.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.5 \cdot 10^{+138}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 5.4999999999999999e138

    1. Initial program 88.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. Step-by-step derivation
      1. fma-define88.9%

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(x \cdot y\right)} \]
    6. Step-by-step derivation
      1. *-commutative33.4%

        \[\leadsto \color{blue}{\left(x \cdot y\right) \cdot 2} \]
      2. associate-*l*33.4%

        \[\leadsto \color{blue}{x \cdot \left(y \cdot 2\right)} \]
    7. Simplified33.4%

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

    if 5.4999999999999999e138 < t

    1. Initial program 82.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. fma-define82.2%

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(2 \cdot t\right) \cdot z} \]
      2. *-commutative52.6%

        \[\leadsto \color{blue}{\left(t \cdot 2\right)} \cdot z \]
      3. associate-*l*52.6%

        \[\leadsto \color{blue}{t \cdot \left(2 \cdot z\right)} \]
      4. *-commutative52.6%

        \[\leadsto t \cdot \color{blue}{\left(z \cdot 2\right)} \]
    7. Simplified52.6%

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

Alternative 13: 29.7% accurate, 3.8× speedup?

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(2 \cdot t\right) \cdot z} \]
    2. *-commutative25.6%

      \[\leadsto \color{blue}{\left(t \cdot 2\right)} \cdot z \]
    3. associate-*l*25.6%

      \[\leadsto \color{blue}{t \cdot \left(2 \cdot z\right)} \]
    4. *-commutative25.6%

      \[\leadsto t \cdot \color{blue}{\left(z \cdot 2\right)} \]
  7. Simplified25.6%

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

Developer Target 1: 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 2024182 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

  :alt
  (! :herbie-platform default (* 2 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i)))))

  (* 2.0 (- (+ (* x y) (* z t)) (* (* (+ a (* b c)) c) i))))