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

Percentage Accurate: 90.7% → 97.1%
Time: 16.4s
Alternatives: 22
Speedup: 0.5×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 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.7% 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: 97.1% 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(z \cdot \left(t - c \cdot \left(\frac{a \cdot i}{z} + \frac{b \cdot \left(c \cdot i\right)}{z}\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (+ a (* b c))) (t_2 (+ (* x y) (* z t))))
   (if (<= (- t_2 (* (* c t_1) i)) INFINITY)
     (* 2.0 (- t_2 (* t_1 (* c i))))
     (* 2.0 (* z (- t (* c (+ (/ (* a i) z) (/ (* b (* c i)) z)))))))))
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 * (z * (t - (c * (((a * i) / z) + ((b * (c * i)) / z)))));
	}
	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 * (z * (t - (c * (((a * i) / z) + ((b * (c * i)) / z)))));
	}
	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 * (z * (t - (c * (((a * i) / z) + ((b * (c * i)) / z)))))
	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(z * Float64(t - Float64(c * Float64(Float64(Float64(a * i) / z) + Float64(Float64(b * Float64(c * i)) / z))))));
	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 * (z * (t - (c * (((a * i) / z) + ((b * (c * i)) / z)))));
	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[(z * N[(t - N[(c * N[(N[(N[(a * i), $MachinePrecision] / z), $MachinePrecision] + N[(N[(b * N[(c * i), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $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(z \cdot \left(t - c \cdot \left(\frac{a \cdot i}{z} + \frac{b \cdot \left(c \cdot i\right)}{z}\right)\right)\right)\\


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

    1. Initial program 96.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-define96.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. associate-*l*99.9%

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

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

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

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

      \[\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 z around inf 35.7%

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

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

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

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

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

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

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

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

Alternative 2: 68.0% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := 2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ t_2 := a \cdot \left(c \cdot i\right)\\ t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\ \mathbf{if}\;c \leq -1 \cdot 10^{+167}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq -7.6 \cdot 10^{+126}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;c \leq -6.8 \cdot 10^{+91}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -2.4 \cdot 10^{+62}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;c \leq -6.6 \cdot 10^{+47}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 2.9 \cdot 10^{-150}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+167}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t\_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)))))
        (t_2 (* a (* c i)))
        (t_3 (* 2.0 (- (* x y) t_2))))
   (if (<= c -1e+167)
     t_1
     (if (<= c -7.6e+126)
       t_3
       (if (<= c -6.8e+91)
         (* 2.0 (* c (* b (* c (- i)))))
         (if (<= c -2.4e+62)
           t_3
           (if (<= c -6.6e+47)
             t_1
             (if (<= c 2.9e-150)
               (* (+ (* x y) (* z t)) 2.0)
               (if (<= c 3.2e+167) (* 2.0 (- (* z t) t_2)) 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 t_2 = a * (c * i);
	double t_3 = 2.0 * ((x * y) - t_2);
	double tmp;
	if (c <= -1e+167) {
		tmp = t_1;
	} else if (c <= -7.6e+126) {
		tmp = t_3;
	} else if (c <= -6.8e+91) {
		tmp = 2.0 * (c * (b * (c * -i)));
	} else if (c <= -2.4e+62) {
		tmp = t_3;
	} else if (c <= -6.6e+47) {
		tmp = t_1;
	} else if (c <= 2.9e-150) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if (c <= 3.2e+167) {
		tmp = 2.0 * ((z * t) - t_2);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = 2.0d0 * (c * ((b * c) * -i))
    t_2 = a * (c * i)
    t_3 = 2.0d0 * ((x * y) - t_2)
    if (c <= (-1d+167)) then
        tmp = t_1
    else if (c <= (-7.6d+126)) then
        tmp = t_3
    else if (c <= (-6.8d+91)) then
        tmp = 2.0d0 * (c * (b * (c * -i)))
    else if (c <= (-2.4d+62)) then
        tmp = t_3
    else if (c <= (-6.6d+47)) then
        tmp = t_1
    else if (c <= 2.9d-150) then
        tmp = ((x * y) + (z * t)) * 2.0d0
    else if (c <= 3.2d+167) then
        tmp = 2.0d0 * ((z * t) - t_2)
    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 t_2 = a * (c * i);
	double t_3 = 2.0 * ((x * y) - t_2);
	double tmp;
	if (c <= -1e+167) {
		tmp = t_1;
	} else if (c <= -7.6e+126) {
		tmp = t_3;
	} else if (c <= -6.8e+91) {
		tmp = 2.0 * (c * (b * (c * -i)));
	} else if (c <= -2.4e+62) {
		tmp = t_3;
	} else if (c <= -6.6e+47) {
		tmp = t_1;
	} else if (c <= 2.9e-150) {
		tmp = ((x * y) + (z * t)) * 2.0;
	} else if (c <= 3.2e+167) {
		tmp = 2.0 * ((z * t) - t_2);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = 2.0 * (c * ((b * c) * -i))
	t_2 = a * (c * i)
	t_3 = 2.0 * ((x * y) - t_2)
	tmp = 0
	if c <= -1e+167:
		tmp = t_1
	elif c <= -7.6e+126:
		tmp = t_3
	elif c <= -6.8e+91:
		tmp = 2.0 * (c * (b * (c * -i)))
	elif c <= -2.4e+62:
		tmp = t_3
	elif c <= -6.6e+47:
		tmp = t_1
	elif c <= 2.9e-150:
		tmp = ((x * y) + (z * t)) * 2.0
	elif c <= 3.2e+167:
		tmp = 2.0 * ((z * t) - t_2)
	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) * Float64(-i))))
	t_2 = Float64(a * Float64(c * i))
	t_3 = Float64(2.0 * Float64(Float64(x * y) - t_2))
	tmp = 0.0
	if (c <= -1e+167)
		tmp = t_1;
	elseif (c <= -7.6e+126)
		tmp = t_3;
	elseif (c <= -6.8e+91)
		tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-i)))));
	elseif (c <= -2.4e+62)
		tmp = t_3;
	elseif (c <= -6.6e+47)
		tmp = t_1;
	elseif (c <= 2.9e-150)
		tmp = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0);
	elseif (c <= 3.2e+167)
		tmp = Float64(2.0 * Float64(Float64(z * t) - t_2));
	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));
	t_2 = a * (c * i);
	t_3 = 2.0 * ((x * y) - t_2);
	tmp = 0.0;
	if (c <= -1e+167)
		tmp = t_1;
	elseif (c <= -7.6e+126)
		tmp = t_3;
	elseif (c <= -6.8e+91)
		tmp = 2.0 * (c * (b * (c * -i)));
	elseif (c <= -2.4e+62)
		tmp = t_3;
	elseif (c <= -6.6e+47)
		tmp = t_1;
	elseif (c <= 2.9e-150)
		tmp = ((x * y) + (z * t)) * 2.0;
	elseif (c <= 3.2e+167)
		tmp = 2.0 * ((z * t) - t_2);
	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]}, Block[{t$95$2 = N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1e+167], t$95$1, If[LessEqual[c, -7.6e+126], t$95$3, If[LessEqual[c, -6.8e+91], N[(2.0 * N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -2.4e+62], t$95$3, If[LessEqual[c, -6.6e+47], t$95$1, If[LessEqual[c, 2.9e-150], N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision], If[LessEqual[c, 3.2e+167], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$2), $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 \left(-i\right)\right)\right)\\
t_2 := a \cdot \left(c \cdot i\right)\\
t_3 := 2 \cdot \left(x \cdot y - t\_2\right)\\
\mathbf{if}\;c \leq -1 \cdot 10^{+167}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq -7.6 \cdot 10^{+126}:\\
\;\;\;\;t\_3\\

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

\mathbf{elif}\;c \leq -2.4 \cdot 10^{+62}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;c \leq -6.6 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;c \leq 3.2 \cdot 10^{+167}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if c < -1e167 or -2.4e62 < c < -6.5999999999999998e47 or 3.19999999999999981e167 < c

    1. Initial program 86.8%

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

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

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

    if -1e167 < c < -7.60000000000000033e126 or -6.8000000000000002e91 < c < -2.4e62

    1. Initial program 86.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 a around inf 74.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. *-commutative74.6%

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

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

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

    if -7.60000000000000033e126 < c < -6.8000000000000002e91

    1. Initial program 64.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 i around inf 87.1%

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

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

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

    if -6.5999999999999998e47 < c < 2.8999999999999998e-150

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

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

    if 2.8999999999999998e-150 < c < 3.19999999999999981e167

    1. Initial program 87.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 67.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -1 \cdot 10^{+167}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -7.6 \cdot 10^{+126}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -6.8 \cdot 10^{+91}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -2.4 \cdot 10^{+62}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -6.6 \cdot 10^{+47}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.9 \cdot 10^{-150}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 3.2 \cdot 10^{+167}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 67.9% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(x \cdot y + z \cdot t\right) \cdot 2\\ t_2 := 2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ t_3 := 2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{if}\;c \leq -4.8 \cdot 10^{+158}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;c \leq -1.65 \cdot 10^{+127}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq -3.8 \cdot 10^{+88}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.95 \cdot 10^{+62}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;c \leq -6 \cdot 10^{+48}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;c \leq 1.55 \cdot 10^{-149}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;c \leq 2.7 \cdot 10^{+166}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_3\\ \end{array} \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (let* ((t_1 (* (+ (* x y) (* z t)) 2.0))
        (t_2 (* 2.0 (- (* z t) (* a (* c i)))))
        (t_3 (* 2.0 (* c (* (* b c) (- i))))))
   (if (<= c -4.8e+158)
     t_3
     (if (<= c -1.65e+127)
       t_1
       (if (<= c -3.8e+88)
         (* 2.0 (* c (* b (* c (- i)))))
         (if (<= c -1.95e+62)
           t_2
           (if (<= c -6e+48)
             t_3
             (if (<= c 1.55e-149) t_1 (if (<= c 2.7e+166) t_2 t_3)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((x * y) + (z * t)) * 2.0;
	double t_2 = 2.0 * ((z * t) - (a * (c * i)));
	double t_3 = 2.0 * (c * ((b * c) * -i));
	double tmp;
	if (c <= -4.8e+158) {
		tmp = t_3;
	} else if (c <= -1.65e+127) {
		tmp = t_1;
	} else if (c <= -3.8e+88) {
		tmp = 2.0 * (c * (b * (c * -i)));
	} else if (c <= -1.95e+62) {
		tmp = t_2;
	} else if (c <= -6e+48) {
		tmp = t_3;
	} else if (c <= 1.55e-149) {
		tmp = t_1;
	} else if (c <= 2.7e+166) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8), intent (in) :: c
    real(8), intent (in) :: i
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = ((x * y) + (z * t)) * 2.0d0
    t_2 = 2.0d0 * ((z * t) - (a * (c * i)))
    t_3 = 2.0d0 * (c * ((b * c) * -i))
    if (c <= (-4.8d+158)) then
        tmp = t_3
    else if (c <= (-1.65d+127)) then
        tmp = t_1
    else if (c <= (-3.8d+88)) then
        tmp = 2.0d0 * (c * (b * (c * -i)))
    else if (c <= (-1.95d+62)) then
        tmp = t_2
    else if (c <= (-6d+48)) then
        tmp = t_3
    else if (c <= 1.55d-149) then
        tmp = t_1
    else if (c <= 2.7d+166) then
        tmp = t_2
    else
        tmp = t_3
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
	double t_1 = ((x * y) + (z * t)) * 2.0;
	double t_2 = 2.0 * ((z * t) - (a * (c * i)));
	double t_3 = 2.0 * (c * ((b * c) * -i));
	double tmp;
	if (c <= -4.8e+158) {
		tmp = t_3;
	} else if (c <= -1.65e+127) {
		tmp = t_1;
	} else if (c <= -3.8e+88) {
		tmp = 2.0 * (c * (b * (c * -i)));
	} else if (c <= -1.95e+62) {
		tmp = t_2;
	} else if (c <= -6e+48) {
		tmp = t_3;
	} else if (c <= 1.55e-149) {
		tmp = t_1;
	} else if (c <= 2.7e+166) {
		tmp = t_2;
	} else {
		tmp = t_3;
	}
	return tmp;
}
def code(x, y, z, t, a, b, c, i):
	t_1 = ((x * y) + (z * t)) * 2.0
	t_2 = 2.0 * ((z * t) - (a * (c * i)))
	t_3 = 2.0 * (c * ((b * c) * -i))
	tmp = 0
	if c <= -4.8e+158:
		tmp = t_3
	elif c <= -1.65e+127:
		tmp = t_1
	elif c <= -3.8e+88:
		tmp = 2.0 * (c * (b * (c * -i)))
	elif c <= -1.95e+62:
		tmp = t_2
	elif c <= -6e+48:
		tmp = t_3
	elif c <= 1.55e-149:
		tmp = t_1
	elif c <= 2.7e+166:
		tmp = t_2
	else:
		tmp = t_3
	return tmp
function code(x, y, z, t, a, b, c, i)
	t_1 = Float64(Float64(Float64(x * y) + Float64(z * t)) * 2.0)
	t_2 = Float64(2.0 * Float64(Float64(z * t) - Float64(a * Float64(c * i))))
	t_3 = Float64(2.0 * Float64(c * Float64(Float64(b * c) * Float64(-i))))
	tmp = 0.0
	if (c <= -4.8e+158)
		tmp = t_3;
	elseif (c <= -1.65e+127)
		tmp = t_1;
	elseif (c <= -3.8e+88)
		tmp = Float64(2.0 * Float64(c * Float64(b * Float64(c * Float64(-i)))));
	elseif (c <= -1.95e+62)
		tmp = t_2;
	elseif (c <= -6e+48)
		tmp = t_3;
	elseif (c <= 1.55e-149)
		tmp = t_1;
	elseif (c <= 2.7e+166)
		tmp = t_2;
	else
		tmp = t_3;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b, c, i)
	t_1 = ((x * y) + (z * t)) * 2.0;
	t_2 = 2.0 * ((z * t) - (a * (c * i)));
	t_3 = 2.0 * (c * ((b * c) * -i));
	tmp = 0.0;
	if (c <= -4.8e+158)
		tmp = t_3;
	elseif (c <= -1.65e+127)
		tmp = t_1;
	elseif (c <= -3.8e+88)
		tmp = 2.0 * (c * (b * (c * -i)));
	elseif (c <= -1.95e+62)
		tmp = t_2;
	elseif (c <= -6e+48)
		tmp = t_3;
	elseif (c <= 1.55e-149)
		tmp = t_1;
	elseif (c <= 2.7e+166)
		tmp = t_2;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(2.0 * N[(N[(z * t), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(2.0 * N[(c * N[(N[(b * c), $MachinePrecision] * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -4.8e+158], t$95$3, If[LessEqual[c, -1.65e+127], t$95$1, If[LessEqual[c, -3.8e+88], N[(2.0 * N[(c * N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, -1.95e+62], t$95$2, If[LessEqual[c, -6e+48], t$95$3, If[LessEqual[c, 1.55e-149], t$95$1, If[LessEqual[c, 2.7e+166], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;c \leq -1.65 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;c \leq -1.95 \cdot 10^{+62}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;c \leq -6 \cdot 10^{+48}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;c \leq 1.55 \cdot 10^{-149}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;c \leq 2.7 \cdot 10^{+166}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -4.80000000000000016e158 or -1.95e62 < c < -5.9999999999999999e48 or 2.70000000000000012e166 < c

    1. Initial program 87.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 i around inf 94.3%

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

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

    if -4.80000000000000016e158 < c < -1.64999999999999988e127 or -5.9999999999999999e48 < c < 1.54999999999999994e-149

    1. Initial program 95.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. Add Preprocessing
    3. Taylor expanded in c around 0 76.1%

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

    if -1.64999999999999988e127 < c < -3.7999999999999997e88

    1. Initial program 68.0%

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

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

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

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

    if -3.7999999999999997e88 < c < -1.95e62 or 1.54999999999999994e-149 < c < 2.70000000000000012e166

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -4.8 \cdot 10^{+158}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.65 \cdot 10^{+127}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq -3.8 \cdot 10^{+88}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq -1.95 \cdot 10^{+62}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq -6 \cdot 10^{+48}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.55 \cdot 10^{-149}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 2.7 \cdot 10^{+166}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 95.1% accurate, 0.4× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;2 \cdot \left(z \cdot t - 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) < -inf.0

    1. Initial program 82.1%

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

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

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

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

    if 1.9999999999999999e304 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i)

    1. Initial program 76.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. Add Preprocessing
    3. Taylor expanded in x around 0 90.0%

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

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

Alternative 5: 39.4% accurate, 0.4× speedup?

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

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

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

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

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

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

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


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

    1. Initial program 90.6%

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

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

    if -2e177 < (*.f64 x y) < -2.0000000000000002e-195

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

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

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot a\right)} \cdot i\right) \]
    5. Simplified62.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 x around inf 60.7%

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

      \[\leadsto 2 \cdot \left(x \cdot \color{blue}{\frac{t \cdot z}{x}}\right) \]
    8. Step-by-step derivation
      1. associate-/l*33.4%

        \[\leadsto 2 \cdot \left(x \cdot \color{blue}{\left(t \cdot \frac{z}{x}\right)}\right) \]
    9. Simplified33.4%

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

    if -2.0000000000000002e-195 < (*.f64 x y) < 0.0

    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
    3. Taylor expanded in a around inf 41.9%

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(c \cdot \left(-\color{blue}{i \cdot a}\right)\right) \]
      7. distribute-rgt-neg-in35.3%

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

      \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out35.3%

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

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

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

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

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

    if 0.0 < (*.f64 x y) < 5.0000000000000002e-109

    1. Initial program 96.2%

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

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

    if 5.0000000000000002e-109 < (*.f64 x y) < 2e208

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

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

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

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

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

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

      \[\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) \]
    7. Taylor expanded in c around 0 83.5%

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

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

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

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

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

    if 2e208 < (*.f64 x y)

    1. Initial program 79.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 x around inf 61.2%

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot y\right)\right)}^{1}} \]
      2. *-commutative61.2%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(y \cdot x\right)}\right)}^{1} \]
      3. associate-*r*61.2%

        \[\leadsto {\color{blue}{\left(\left(2 \cdot y\right) \cdot x\right)}}^{1} \]
    5. Applied egg-rr61.2%

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

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

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

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

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

Alternative 6: 96.3% 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(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right) - 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 (* c (- (* b (* c (- i))) (* 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 * (c * ((b * (c * -i)) - (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 * (c * ((b * (c * -i)) - (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 * (c * ((b * (c * -i)) - (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(c * Float64(Float64(b * Float64(c * Float64(-i))) - 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 * (c * ((b * (c * -i)) - (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[(c * N[(N[(b * N[(c * (-i)), $MachinePrecision]), $MachinePrecision] - 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(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right) - 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.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-define96.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. associate-*l*99.9%

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

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

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

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

      \[\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 i around inf 43.1%

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)\right)} \]
    4. Step-by-step derivation
      1. distribute-rgt-in43.1%

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

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

        \[\leadsto 2 \cdot \left(-1 \cdot \left(c \cdot \left(i \cdot a + \color{blue}{b \cdot \left(c \cdot i\right)}\right)\right)\right) \]
    5. Applied egg-rr43.1%

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

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

Alternative 7: 37.6% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -4.7 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-229}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 1.32 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.9 \cdot 10^{-174}:\\
\;\;\;\;t\_3\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.1e122 or 7.2e21 < z

    1. Initial program 85.8%

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

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

    if -1.1e122 < z < -4.6999999999999997e-8 or -2.50000000000000008e-229 < z < 1.32e-278

    1. Initial program 90.2%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(c \cdot \left(-\color{blue}{i \cdot a}\right)\right) \]
      7. distribute-rgt-neg-in34.9%

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

      \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out34.9%

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

        \[\leadsto 2 \cdot \left(c \cdot \left(-\color{blue}{a \cdot i}\right)\right) \]
      3. distribute-rgt-neg-out34.9%

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

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

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

    if -4.6999999999999997e-8 < z < -2.50000000000000008e-229 or 1.32e-278 < z < 1.9000000000000001e-174

    1. Initial program 94.3%

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

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot y\right)\right)}^{1}} \]
      2. *-commutative41.3%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(y \cdot x\right)}\right)}^{1} \]
      3. associate-*r*41.3%

        \[\leadsto {\color{blue}{\left(\left(2 \cdot y\right) \cdot x\right)}}^{1} \]
    5. Applied egg-rr41.3%

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

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

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

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

    if 1.9000000000000001e-174 < z < 7.2e21

    1. Initial program 97.4%

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

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

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

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

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

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

      \[\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) \]
    7. Taylor expanded in c around 0 90.0%

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(-1 \cdot a\right) \cdot \left(c \cdot i\right)\right)} \]
      2. mul-1-neg29.4%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.1 \cdot 10^{+122}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -4.7 \cdot 10^{-8}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-229}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{elif}\;z \leq 1.32 \cdot 10^{-278}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{-174}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+21}:\\ \;\;\;\;2 \cdot \left(\left(c \cdot i\right) \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 37.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -2.1 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.6 \cdot 10^{-228}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 1.3 \cdot 10^{-281}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.5 \cdot 10^{-170}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 3 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.3000000000000001e122 or 3e19 < z

    1. Initial program 85.8%

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

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

    if -2.3000000000000001e122 < z < -2.09999999999999994e-8 or -3.6000000000000002e-228 < z < 1.30000000000000002e-281 or 4.50000000000000002e-170 < z < 3e19

    1. Initial program 93.4%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \left(c \cdot \left(-\color{blue}{i \cdot a}\right)\right) \]
      7. distribute-rgt-neg-in29.6%

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

      \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(i \cdot \left(-a\right)\right)\right)} \]
    6. Step-by-step derivation
      1. distribute-rgt-neg-out29.6%

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

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

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

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

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

    if -2.09999999999999994e-8 < z < -3.6000000000000002e-228 or 1.30000000000000002e-281 < z < 4.50000000000000002e-170

    1. Initial program 94.4%

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

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot y\right)\right)}^{1}} \]
      2. *-commutative40.8%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(y \cdot x\right)}\right)}^{1} \]
      3. associate-*r*40.8%

        \[\leadsto {\color{blue}{\left(\left(2 \cdot y\right) \cdot x\right)}}^{1} \]
    5. Applied egg-rr40.8%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.3 \cdot 10^{+122}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -2.1 \cdot 10^{-8}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;z \leq -3.6 \cdot 10^{-228}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{elif}\;z \leq 1.3 \cdot 10^{-281}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;z \leq 4.5 \cdot 10^{-170}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{elif}\;z \leq 3 \cdot 10^{+19}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 9: 37.4% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;z \leq -1.8 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -1.6 \cdot 10^{-229}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 6.8 \cdot 10^{-286}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.2 \cdot 10^{-175}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;z \leq 90000000000:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -5.60000000000000012e121 or 9e10 < z

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

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

    if -5.60000000000000012e121 < z < -1.79999999999999991e-8 or -1.60000000000000007e-229 < z < 6.8000000000000002e-286 or 4.2e-175 < z < 9e10

    1. Initial program 93.4%

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

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

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

      \[\leadsto \color{blue}{2 \cdot \left(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. fma-define97.7%

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

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

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

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

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

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

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

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

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

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

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

    if -1.79999999999999991e-8 < z < -1.60000000000000007e-229 or 6.8000000000000002e-286 < z < 4.2e-175

    1. Initial program 94.3%

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

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot y\right)\right)}^{1}} \]
      2. *-commutative41.3%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(y \cdot x\right)}\right)}^{1} \]
      3. associate-*r*41.3%

        \[\leadsto {\color{blue}{\left(\left(2 \cdot y\right) \cdot x\right)}}^{1} \]
    5. Applied egg-rr41.3%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.6 \cdot 10^{+121}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;z \leq -1.8 \cdot 10^{-8}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;z \leq -1.6 \cdot 10^{-229}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{elif}\;z \leq 6.8 \cdot 10^{-286}:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{elif}\;z \leq 4.2 \cdot 10^{-175}:\\ \;\;\;\;x \cdot \left(y \cdot 2\right)\\ \mathbf{elif}\;z \leq 90000000000:\\ \;\;\;\;2 \cdot \left(i \cdot \left(a \cdot \left(-c\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 72.7% accurate, 0.5× speedup?

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

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

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

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

\mathbf{elif}\;c \leq 6.8 \cdot 10^{+37} \lor \neg \left(c \leq 1.05 \cdot 10^{+118}\right):\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -4.2e10 or 4.09999999999999999e-61 < c < 6.80000000000000011e37 or 1.05e118 < 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. Add Preprocessing
    3. Taylor expanded in i around inf 80.2%

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

    if -4.2e10 < c < 1.21999999999999992e-148

    1. Initial program 98.9%

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

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

    if 1.21999999999999992e-148 < c < 4.09999999999999999e-61

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

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

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

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

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

    if 6.80000000000000011e37 < c < 1.05e118

    1. Initial program 78.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 72.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. *-commutative72.0%

        \[\leadsto 2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \color{blue}{\left(c \cdot a\right)} \cdot i\right) \]
    5. Simplified72.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 63.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -42000000000:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq 1.22 \cdot 10^{-148}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq 4.1 \cdot 10^{-61}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{elif}\;c \leq 6.8 \cdot 10^{+37} \lor \neg \left(c \leq 1.05 \cdot 10^{+118}\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y - a \cdot \left(c \cdot i\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 86.5% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;c \leq 3.1 \cdot 10^{-59}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;c \leq 7.6 \cdot 10^{+49}:\\
\;\;\;\;2 \cdot \left(t\_2 - i \cdot \left(c \cdot \left(b \cdot c\right)\right)\right)\\

\mathbf{elif}\;c \leq 2.2 \cdot 10^{+85}:\\
\;\;\;\;t\_3\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -8.4999999999999996e-10

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

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

    if -8.4999999999999996e-10 < c < 3.09999999999999999e-59 or 7.5999999999999997e49 < c < 2.2000000000000002e85

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

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

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

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

    if 3.09999999999999999e-59 < c < 7.5999999999999997e49

    1. Initial program 87.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 0 83.5%

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

    if 2.2000000000000002e85 < c

    1. Initial program 85.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. Add Preprocessing
    3. Taylor expanded in x around 0 98.1%

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

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

Alternative 12: 87.0% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;c \leq 3.4 \cdot 10^{-59}:\\
\;\;\;\;2 \cdot \left(t\_2 - i \cdot \left(a \cdot c\right)\right)\\

\mathbf{elif}\;c \leq 2.2 \cdot 10^{+67}:\\
\;\;\;\;2 \cdot \left(t\_2 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if c < -2.74999999999999987e-11

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

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

    if -2.74999999999999987e-11 < c < 3.40000000000000018e-59

    1. Initial program 98.9%

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

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

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

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

    if 3.40000000000000018e-59 < c < 2.2e67

    1. Initial program 89.1%

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

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

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

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

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

      \[\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) \]
    7. Taylor expanded in a around 0 82.3%

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

    if 2.2e67 < c

    1. Initial program 85.0%

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

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

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

Alternative 13: 68.8% accurate, 0.6× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3 \cdot 10^{+159} \lor \neg \left(c \leq -1.35 \cdot 10^{+127}\right) \land \left(c \leq -9.6 \cdot 10^{+46} \lor \neg \left(c \leq 7.6 \cdot 10^{+81}\right)\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.0000000000000002e159 or -1.3500000000000001e127 < c < -9.60000000000000034e46 or 7.599999999999999e81 < c

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

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

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

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

    if -3.0000000000000002e159 < c < -1.3500000000000001e127 or -9.60000000000000034e46 < c < 7.599999999999999e81

    1. Initial program 94.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. Add Preprocessing
    3. Taylor expanded in c around 0 68.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3 \cdot 10^{+159} \lor \neg \left(c \leq -1.35 \cdot 10^{+127}\right) \land \left(c \leq -9.6 \cdot 10^{+46} \lor \neg \left(c \leq 7.6 \cdot 10^{+81}\right)\right):\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 68.4% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;c \leq -3.3 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;c \leq 2.7 \cdot 10^{+84}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -6.2000000000000004e158 or 2.7e84 < c

    1. Initial program 85.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. Add Preprocessing
    3. Taylor expanded in i around inf 91.5%

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

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

    if -6.2000000000000004e158 < c < -3.30000000000000015e124 or -3.5500000000000001e47 < c < 2.7e84

    1. Initial program 94.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. Add Preprocessing
    3. Taylor expanded in c around 0 68.5%

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

    if -3.30000000000000015e124 < c < -3.5500000000000001e47

    1. Initial program 87.4%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -6.2 \cdot 10^{+158}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \mathbf{elif}\;c \leq -3.3 \cdot 10^{+124}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{elif}\;c \leq -3.55 \cdot 10^{+47}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(b \cdot \left(c \cdot \left(-i\right)\right)\right)\right)\\ \mathbf{elif}\;c \leq 2.7 \cdot 10^{+84}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(c \cdot \left(\left(b \cdot c\right) \cdot \left(-i\right)\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 15: 54.9% accurate, 0.7× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;i \leq -2 \cdot 10^{+139} \lor \neg \left(i \leq -2.2 \cdot 10^{+91} \lor \neg \left(i \leq -1.05 \cdot 10^{-46}\right) \land i \leq 8.5 \cdot 10^{+149}\right):\\
\;\;\;\;2 \cdot \left(\left(c \cdot i\right) \cdot \left(-a\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if i < -2.00000000000000007e139

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

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

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

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

    if -2.00000000000000007e139 < i < -2.19999999999999999e91 or -1.04999999999999994e-46 < i < 8.49999999999999956e149

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

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

    if -2.19999999999999999e91 < i < -1.04999999999999994e-46 or 8.49999999999999956e149 < i

    1. Initial program 94.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-define94.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. associate-*l*94.2%

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

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

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

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

      \[\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) \]
    7. Taylor expanded in c around 0 69.0%

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(\left(-1 \cdot a\right) \cdot \left(c \cdot i\right)\right)} \]
      2. mul-1-neg48.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -2 \cdot 10^{+139} \lor \neg \left(i \leq -2.2 \cdot 10^{+91} \lor \neg \left(i \leq -1.05 \cdot 10^{-46}\right) \land i \leq 8.5 \cdot 10^{+149}\right):\\ \;\;\;\;2 \cdot \left(\left(c \cdot i\right) \cdot \left(-a\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 16: 42.7% accurate, 0.7× speedup?

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

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

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

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

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


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

    1. Initial program 90.6%

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

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

    if -2e177 < (*.f64 x y) < 5.0000000000000002e-109

    1. Initial program 93.8%

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

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

    if 5.0000000000000002e-109 < (*.f64 x y) < 2e208

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

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

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

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

    if 2e208 < (*.f64 x y)

    1. Initial program 79.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 x around inf 61.2%

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot y\right)\right)}^{1}} \]
      2. *-commutative61.2%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(y \cdot x\right)}\right)}^{1} \]
      3. associate-*r*61.2%

        \[\leadsto {\color{blue}{\left(\left(2 \cdot y\right) \cdot x\right)}}^{1} \]
    5. Applied egg-rr61.2%

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

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

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

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

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

Alternative 17: 79.3% accurate, 0.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.05 \cdot 10^{-36} \lor \neg \left(c \leq 8.4 \cdot 10^{-169}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -1.04999999999999995e-36 or 8.4000000000000002e-169 < 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. Add Preprocessing
    3. Taylor expanded in x around 0 83.1%

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

    if -1.04999999999999995e-36 < c < 8.4000000000000002e-169

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

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

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

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

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

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

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


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

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

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

    if -2.74999999999999987e-11 < c < 5.0000000000000001e-59

    1. Initial program 98.9%

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

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

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

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

    if 5.0000000000000001e-59 < c

    1. Initial program 86.3%

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

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

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

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

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

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

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


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

    1. Initial program 85.8%

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

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

    if -1.3e-42 < c < 1.56000000000000008e-169

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

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

    if 1.56000000000000008e-169 < c

    1. Initial program 88.1%

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

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

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

Alternative 20: 44.5% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.32 \cdot 10^{+177} \lor \neg \left(x \cdot y \leq 3.3 \cdot 10^{+90}\right):\\
\;\;\;\;\left(x \cdot y\right) \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.3200000000000001e177 or 3.30000000000000008e90 < (*.f64 x y)

    1. Initial program 87.3%

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

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

    if -1.3200000000000001e177 < (*.f64 x y) < 3.30000000000000008e90

    1. Initial program 92.5%

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

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

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

Alternative 21: 44.5% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 90.6%

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

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

    if -2e177 < (*.f64 x y) < 4.99999999999999983e89

    1. Initial program 92.5%

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

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

    if 4.99999999999999983e89 < (*.f64 x y)

    1. Initial program 85.3%

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

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

        \[\leadsto \color{blue}{{\left(2 \cdot \left(x \cdot y\right)\right)}^{1}} \]
      2. *-commutative49.2%

        \[\leadsto {\left(2 \cdot \color{blue}{\left(y \cdot x\right)}\right)}^{1} \]
      3. associate-*r*49.2%

        \[\leadsto {\color{blue}{\left(\left(2 \cdot y\right) \cdot x\right)}}^{1} \]
    5. Applied egg-rr49.2%

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

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

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

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

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

Alternative 22: 29.4% accurate, 3.8× speedup?

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

\\
2 \cdot \left(z \cdot t\right)
\end{array}
Derivation
  1. Initial program 90.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. Add Preprocessing
  3. Taylor expanded in z around inf 25.2%

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

    \[\leadsto 2 \cdot \left(z \cdot t\right) \]
  5. Add Preprocessing

Developer target: 94.8% 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 2024103 
(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
  (* 2.0 (- (+ (* x y) (* z t)) (* (+ a (* b c)) (* c i))))

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