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

Percentage Accurate: 90.1% → 94.7%
Time: 15.6s
Alternatives: 13
Speedup: 0.6×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 90.1% accurate, 1.0× speedup?

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

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

Alternative 1: 94.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}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ 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))))
     (* 2.0 (- (* x y) (* c (* a i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double 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 = 2.0 * ((x * y) - (c * (a * i)));
	}
	return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (x * y) + (z * t);
	double tmp;
	if ((t_2 - ((c * t_1) * i)) <= Double.POSITIVE_INFINITY) {
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	} else {
		tmp = 2.0 * ((x * y) - (c * (a * i)));
	}
	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 = 2.0 * ((x * y) - (c * (a * i)))
	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(2.0 * Float64(Float64(x * y) - Float64(c * Float64(a * i))));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = (x * y) + (z * t);
	tmp = 0.0;
	if ((t_2 - ((c * t_1) * i)) <= Inf)
		tmp = 2.0 * (t_2 - (t_1 * (c * i)));
	else
		tmp = 2.0 * ((x * y) - (c * (a * i)));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(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[(2.0 * N[(N[(x * y), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $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}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\right)\\


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

    1. Initial program 96.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-define96.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. associate-*l*98.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. Simplified98.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-define98.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. +-commutative98.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-rr98.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 40.0%

      \[\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. *-commutative40.0%

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

      \[\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 z around 0 40.1%

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

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

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

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

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

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

Alternative 2: 87.6% 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\\ t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{+88}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+98}:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\right)\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+300}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c)))
        (t_2 (* (* c t_1) i))
        (t_3 (* 2.0 (- (* x y) t_2))))
   (if (<= t_2 -2e+88)
     t_3
     (if (<= t_2 2e+98)
       (* 2.0 (+ (* x y) (- (* z t) (* c (* a i)))))
       (if (<= t_2 5e+300) t_3 (* -2.0 (* c (* t_1 i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (c * t_1) * i;
	double t_3 = 2.0 * ((x * y) - t_2);
	double tmp;
	if (t_2 <= -2e+88) {
		tmp = t_3;
	} else if (t_2 <= 2e+98) {
		tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
	} else if (t_2 <= 5e+300) {
		tmp = t_3;
	} else {
		tmp = -2.0 * (c * (t_1 * i));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = a + (b * c)
    t_2 = (c * t_1) * i
    t_3 = 2.0d0 * ((x * y) - t_2)
    if (t_2 <= (-2d+88)) then
        tmp = t_3
    else if (t_2 <= 2d+98) then
        tmp = 2.0d0 * ((x * y) + ((z * t) - (c * (a * i))))
    else if (t_2 <= 5d+300) then
        tmp = t_3
    else
        tmp = (-2.0d0) * (c * (t_1 * i))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (c * t_1) * i;
	double t_3 = 2.0 * ((x * y) - t_2);
	double tmp;
	if (t_2 <= -2e+88) {
		tmp = t_3;
	} else if (t_2 <= 2e+98) {
		tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
	} else if (t_2 <= 5e+300) {
		tmp = t_3;
	} else {
		tmp = -2.0 * (c * (t_1 * i));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = (c * t_1) * i
	t_3 = 2.0 * ((x * y) - t_2)
	tmp = 0
	if t_2 <= -2e+88:
		tmp = t_3
	elif t_2 <= 2e+98:
		tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))))
	elif t_2 <= 5e+300:
		tmp = t_3
	else:
		tmp = -2.0 * (c * (t_1 * i))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(Float64(c * t_1) * i)
	t_3 = Float64(2.0 * Float64(Float64(x * y) - t_2))
	tmp = 0.0
	if (t_2 <= -2e+88)
		tmp = t_3;
	elseif (t_2 <= 2e+98)
		tmp = Float64(2.0 * Float64(Float64(x * y) + Float64(Float64(z * t) - Float64(c * Float64(a * i)))));
	elseif (t_2 <= 5e+300)
		tmp = t_3;
	else
		tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = (c * t_1) * i;
	t_3 = 2.0 * ((x * y) - t_2);
	tmp = 0.0;
	if (t_2 <= -2e+88)
		tmp = t_3;
	elseif (t_2 <= 2e+98)
		tmp = 2.0 * ((x * y) + ((z * t) - (c * (a * i))));
	elseif (t_2 <= 5e+300)
		tmp = t_3;
	else
		tmp = -2.0 * (c * (t_1 * i));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+88], t$95$3, If[LessEqual[t$95$2, 2e+98], N[(2.0 * N[(N[(x * y), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] - N[(c * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+300], t$95$3, N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < -1.99999999999999992e88 or 2e98 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000026e300

    1. Initial program 91.9%

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

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

    if -1.99999999999999992e88 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 2e98

    1. Initial program 97.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 a around inf 94.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. *-commutative94.6%

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

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

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

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

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

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

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

    if 5.00000000000000026e300 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    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*93.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. +-commutative93.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-define93.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. Simplified93.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 95.4%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq -2 \cdot 10^{+88}:\\ \;\;\;\;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 2 \cdot 10^{+98}:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\right)\\ \mathbf{elif}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq 5 \cdot 10^{+300}:\\ \;\;\;\;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: 89.3% 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 -2 \cdot 10^{+302} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+300}\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 -2e+302) (not (<= t_2 5e+300)))
     (* -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 <= -2e+302) || !(t_2 <= 5e+300)) {
		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 <= (-2d+302)) .or. (.not. (t_2 <= 5d+300))) 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 <= -2e+302) || !(t_2 <= 5e+300)) {
		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 <= -2e+302) or not (t_2 <= 5e+300):
		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 <= -2e+302) || !(t_2 <= 5e+300))
		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 <= -2e+302) || ~((t_2 <= 5e+300)))
		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, -2e+302], N[Not[LessEqual[t$95$2, 5e+300]], $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 -2 \cdot 10^{+302} \lor \neg \left(t\_2 \leq 5 \cdot 10^{+300}\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) < -2.0000000000000002e302 or 5.00000000000000026e300 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 83.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-define83.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. *-commutative83.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*90.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. +-commutative90.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-define90.0%

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

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

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

    if -2.0000000000000002e302 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000026e300

    1. Initial program 98.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 92.4%

      \[\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. *-commutative92.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq -2 \cdot 10^{+302} \lor \neg \left(\left(c \cdot \left(a + b \cdot c\right)\right) \cdot i \leq 5 \cdot 10^{+300}\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 4: 92.4% accurate, 0.6× 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^{+300}:\\ \;\;\;\;\left(\left(x \cdot y + z \cdot t\right) - t\_2\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(t\_1 \cdot i\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))) (t_2 (* (* c t_1) i)))
   (if (<= t_2 5e+300)
     (* (- (+ (* x y) (* z t)) t_2) 2.0)
     (* -2.0 (* c (* t_1 i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (c * t_1) * i;
	double tmp;
	if (t_2 <= 5e+300) {
		tmp = (((x * y) + (z * t)) - t_2) * 2.0;
	} else {
		tmp = -2.0 * (c * (t_1 * i));
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = a + (b * c)
    t_2 = (c * t_1) * i
    if (t_2 <= 5d+300) then
        tmp = (((x * y) + (z * t)) - t_2) * 2.0d0
    else
        tmp = (-2.0d0) * (c * (t_1 * i))
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = a + (b * c);
	double t_2 = (c * t_1) * i;
	double tmp;
	if (t_2 <= 5e+300) {
		tmp = (((x * y) + (z * t)) - t_2) * 2.0;
	} else {
		tmp = -2.0 * (c * (t_1 * i));
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = a + (b * c)
	t_2 = (c * t_1) * i
	tmp = 0
	if t_2 <= 5e+300:
		tmp = (((x * y) + (z * t)) - t_2) * 2.0
	else:
		tmp = -2.0 * (c * (t_1 * i))
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(a + Float64(b * c))
	t_2 = Float64(Float64(c * t_1) * i)
	tmp = 0.0
	if (t_2 <= 5e+300)
		tmp = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) - t_2) * 2.0);
	else
		tmp = Float64(-2.0 * Float64(c * Float64(t_1 * i)));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = a + (b * c);
	t_2 = (c * t_1) * i;
	tmp = 0.0;
	if (t_2 <= 5e+300)
		tmp = (((x * y) + (z * t)) - t_2) * 2.0;
	else
		tmp = -2.0 * (c * (t_1 * i));
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t$95$1), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[t$95$2, 5e+300], N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision] * 2.0), $MachinePrecision], N[(-2.0 * N[(c * N[(t$95$1 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 5.00000000000000026e300

    1. Initial program 95.3%

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

    if 5.00000000000000026e300 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    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*93.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. +-commutative93.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-define93.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. Simplified93.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 95.4%

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

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

Alternative 5: 74.8% accurate, 0.7× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.39999999999999984e25 or 3.4999999999999999e64 < c

    1. Initial program 87.0%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define87.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. *-commutative87.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*92.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. +-commutative92.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-define92.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. Simplified92.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 75.8%

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

    if -3.39999999999999984e25 < c < 2.39999999999999994e-18

    1. Initial program 97.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-define97.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. *-commutative97.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*90.7%

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

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

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

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

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

    if 2.39999999999999994e-18 < c < 3.4999999999999999e64

    1. Initial program 93.2%

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

      \[\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. *-commutative80.2%

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

      \[\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 z around 0 86.9%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.4 \cdot 10^{+25}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 2.4 \cdot 10^{-18}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 3.5 \cdot 10^{+64}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(a \cdot i\right)\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 6: 81.2% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.96 \cdot 10^{+111} \lor \neg \left(c \leq 1.1 \cdot 10^{+119}\right):\\
\;\;\;\;-2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.96000000000000001e111 or 1.1000000000000001e119 < c

    1. Initial program 86.2%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define86.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. *-commutative86.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*92.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. +-commutative92.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-define92.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. Simplified92.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 i around inf 84.7%

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

    if -1.96000000000000001e111 < c < 1.1000000000000001e119

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

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

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

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

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

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

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

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

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

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

Alternative 7: 81.9% accurate, 0.8× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;-2 \cdot t\_1\\


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

    1. Initial program 81.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-define81.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. *-commutative81.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.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. +-commutative91.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-define91.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. Simplified91.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 x around 0 91.8%

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

    if -1.8e108 < c < 7.2000000000000001e114

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

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

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

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

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

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

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

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

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

    if 7.2000000000000001e114 < c

    1. Initial program 91.2%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define91.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. *-commutative91.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*94.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. +-commutative94.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-define94.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. Simplified94.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.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1.8 \cdot 10^{+108}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 7.2 \cdot 10^{+114}:\\ \;\;\;\;2 \cdot \left(x \cdot y + \left(z \cdot t - c \cdot \left(a \cdot i\right)\right)\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 8: 48.5% accurate, 0.8× speedup?

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

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

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

\mathbf{elif}\;c \leq 1.75 \cdot 10^{+68}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -3.8e52 or 1.74999999999999989e68 < c

    1. Initial program 85.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-define85.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. *-commutative85.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.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. +-commutative91.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-define91.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. Simplified91.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 77.3%

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

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

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

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

    if -3.8e52 < c < 5.20000000000000018e-83

    1. Initial program 97.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define97.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. *-commutative97.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.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. +-commutative91.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-define91.0%

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

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

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

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

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

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

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

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

    if 5.20000000000000018e-83 < c < 1.74999999999999989e68

    1. Initial program 96.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define96.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. *-commutative96.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*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 x around inf 53.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.8 \cdot 10^{+52}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 5.2 \cdot 10^{-83}:\\ \;\;\;\;t \cdot \left(z \cdot 2\right)\\ \mathbf{elif}\;c \leq 1.75 \cdot 10^{+68}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;-2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 48.9% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;c \leq 1.98 \cdot 10^{-84}:\\
\;\;\;\;t \cdot \left(z \cdot 2\right)\\

\mathbf{elif}\;c \leq 1.05 \cdot 10^{+68}:\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -2e51 or 1.05e68 < c

    1. Initial program 85.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-define85.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. *-commutative85.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.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. +-commutative91.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-define91.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. Simplified91.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 77.3%

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

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

    if -2e51 < c < 1.97999999999999995e-84

    1. Initial program 97.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define97.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. *-commutative97.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.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. +-commutative91.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-define91.0%

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

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

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

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

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

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

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

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

    if 1.97999999999999995e-84 < c < 1.05e68

    1. Initial program 96.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define96.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. *-commutative96.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*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 x around inf 53.3%

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

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

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

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

Alternative 10: 74.4% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;c \leq -5.2 \cdot 10^{+24} \lor \neg \left(c \leq 3.2 \cdot 10^{+114}\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 -5.2e+24) (not (<= c 3.2e+114)))
   (* -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 <= -5.2e+24) || !(c <= 3.2e+114)) {
		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 <= (-5.2d+24)) .or. (.not. (c <= 3.2d+114))) 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 <= -5.2e+24) || !(c <= 3.2e+114)) {
		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 <= -5.2e+24) or not (c <= 3.2e+114):
		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 <= -5.2e+24) || !(c <= 3.2e+114))
		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 <= -5.2e+24) || ~((c <= 3.2e+114)))
		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, -5.2e+24], N[Not[LessEqual[c, 3.2e+114]], $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 -5.2 \cdot 10^{+24} \lor \neg \left(c \leq 3.2 \cdot 10^{+114}\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 < -5.1999999999999997e24 or 3.2e114 < c

    1. Initial program 88.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-define88.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. *-commutative88.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*94.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. +-commutative94.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-define94.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. Simplified94.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.0%

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

    if -5.1999999999999997e24 < c < 3.2e114

    1. Initial program 95.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-define95.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. *-commutative95.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.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -5.2 \cdot 10^{+24} \lor \neg \left(c \leq 3.2 \cdot 10^{+114}\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 11: 67.6% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 82.5%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define82.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. *-commutative82.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.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. +-commutative93.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-define93.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. Simplified93.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 86.4%

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

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

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

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

    if -1.25e79 < c < 2.6999999999999999e184

    1. Initial program 95.3%

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

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

        \[\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*90.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. +-commutative90.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-define90.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. Simplified90.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 c around 0 72.5%

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

    if 2.6999999999999999e184 < c

    1. Initial program 95.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-define95.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. *-commutative95.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*95.7%

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

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

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

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

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

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

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

Alternative 12: 37.8% accurate, 1.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+103} \lor \neg \left(x \leq 6.5 \cdot 10^{-73}\right):\\ \;\;\;\;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 (or (<= x -6.2e+103) (not (<= x 6.5e-73)))
   (* 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 ((x <= -6.2e+103) || !(x <= 6.5e-73)) {
		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 ((x <= (-6.2d+103)) .or. (.not. (x <= 6.5d-73))) 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 ((x <= -6.2e+103) || !(x <= 6.5e-73)) {
		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 (x <= -6.2e+103) or not (x <= 6.5e-73):
		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 ((x <= -6.2e+103) || !(x <= 6.5e-73))
		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 ((x <= -6.2e+103) || ~((x <= 6.5e-73)))
		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[Or[LessEqual[x, -6.2e+103], N[Not[LessEqual[x, 6.5e-73]], $MachinePrecision]], N[(x * N[(y * 2.0), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.2 \cdot 10^{+103} \lor \neg \left(x \leq 6.5 \cdot 10^{-73}\right):\\
\;\;\;\;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 x < -6.2000000000000003e103 or 6.4999999999999999e-73 < x

    1. Initial program 91.1%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define91.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. *-commutative91.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*91.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. +-commutative91.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-define91.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. Simplified91.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 x around inf 49.7%

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

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

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

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

    if -6.2000000000000003e103 < x < 6.4999999999999999e-73

    1. Initial program 94.9%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Step-by-step derivation
      1. fma-define94.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. *-commutative94.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*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 40.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.2 \cdot 10^{+103} \lor \neg \left(x \leq 6.5 \cdot 10^{-73}\right):\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot 2\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 28.0% 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 93.1%

    \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
  2. Step-by-step derivation
    1. fma-define93.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. *-commutative93.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*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 z around inf 31.4%

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

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

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

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

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

    \[\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 2024157 
(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))))