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

Percentage Accurate: 90.0% → 96.0%
Time: 15.7s
Alternatives: 15
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 15 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.0% accurate, 1.0× speedup?

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

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

Alternative 1: 96.0% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 92.0% accurate, 0.5× speedup?

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

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

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

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


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

    1. Initial program 68.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 88.4%

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

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

    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. Add Preprocessing

    if 1e256 < (*.f64 (+.f64 a (*.f64 b c)) c)

    1. Initial program 73.4%

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

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

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

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

Alternative 3: 74.2% accurate, 0.6× speedup?

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

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

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

\mathbf{elif}\;c \leq -7.2 \cdot 10^{-52} \lor \neg \left(c \leq 9.2 \cdot 10^{+77}\right):\\
\;\;\;\;t\_1\\

\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 c < -6.3999999999999997e198 or -1.3199999999999999e23 < c < -7.19999999999999976e-52 or 9.19999999999999979e77 < c

    1. Initial program 82.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-define82.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. *-commutative82.8%

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

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

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

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

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

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

    if -6.3999999999999997e198 < c < -1.3199999999999999e23

    1. Initial program 72.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 0 75.4%

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

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

    if -7.19999999999999976e-52 < c < 9.19999999999999979e77

    1. Initial program 96.7%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -6.4 \cdot 10^{+198}:\\ \;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;c \leq -1.32 \cdot 10^{+23}:\\ \;\;\;\;2 \cdot \left(z \cdot t - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;c \leq -7.2 \cdot 10^{-52} \lor \neg \left(c \leq 9.2 \cdot 10^{+77}\right):\\ \;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot y + z \cdot t\right) \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 85.7% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;c \leq -1.45 \cdot 10^{+33}:\\
\;\;\;\;2 \cdot \left(t\_1 - \left(b \cdot c\right) \cdot \left(c \cdot i\right)\right)\\

\mathbf{elif}\;c \leq 5.8 \cdot 10^{+77}:\\
\;\;\;\;2 \cdot \left(t\_1 - i \cdot \left(a \cdot c\right)\right)\\

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


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

    1. Initial program 75.3%

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

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

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

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

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

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

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

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

    if -6.3999999999999997e198 < c < -1.45000000000000012e33

    1. Initial program 71.6%

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

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

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

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

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

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

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

      \[\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 -1.45000000000000012e33 < c < 5.8000000000000003e77

    1. Initial program 97.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 a around inf 89.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. *-commutative89.9%

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

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

    if 5.8000000000000003e77 < c

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

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

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

Alternative 5: 81.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\ \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+87}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - t\_1\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 (or (<= (* x y) -2e+87) (not (<= (* x y) 5e+87)))
     (* 2.0 (- (* x y) t_1))
     (* 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 (((x * y) <= -2e+87) || !((x * y) <= 5e+87)) {
		tmp = 2.0 * ((x * y) - t_1);
	} 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 (((x * y) <= (-2d+87)) .or. (.not. ((x * y) <= 5d+87))) then
        tmp = 2.0d0 * ((x * y) - t_1)
    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 (((x * y) <= -2e+87) || !((x * y) <= 5e+87)) {
		tmp = 2.0 * ((x * y) - t_1);
	} 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 ((x * y) <= -2e+87) or not ((x * y) <= 5e+87):
		tmp = 2.0 * ((x * y) - t_1)
	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 ((Float64(x * y) <= -2e+87) || !(Float64(x * y) <= 5e+87))
		tmp = Float64(2.0 * Float64(Float64(x * y) - t_1));
	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 (((x * y) <= -2e+87) || ~(((x * y) <= 5e+87)))
		tmp = 2.0 * ((x * y) - t_1);
	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[Or[LessEqual[N[(x * y), $MachinePrecision], -2e+87], N[Not[LessEqual[N[(x * y), $MachinePrecision], 5e+87]], $MachinePrecision]], N[(2.0 * N[(N[(x * y), $MachinePrecision] - t$95$1), $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}\;x \cdot y \leq -2 \cdot 10^{+87} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+87}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y - t\_1\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.9999999999999999e87 or 4.9999999999999998e87 < (*.f64 x y)

    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 z around 0 86.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.9999999999999999e87 < (*.f64 x y) < 4.9999999999999998e87

    1. Initial program 88.6%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. Add Preprocessing
    3. Taylor expanded in x around 0 82.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 2 regimes into one program.
  4. Final simplification83.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+87} \lor \neg \left(x \cdot y \leq 5 \cdot 10^{+87}\right):\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(\left(a + b \cdot c\right) \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 6: 79.2% accurate, 0.7× speedup?

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

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

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

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


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

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

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

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

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

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

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

    if -1.00000000000000001e160 < (*.f64 x y) < 4.9999999999999998e87

    1. Initial program 88.4%

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

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

    if 4.9999999999999998e87 < (*.f64 x y)

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

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

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

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

Alternative 7: 86.4% 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 -7 \cdot 10^{-32}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\ \mathbf{elif}\;c \leq 5.8 \cdot 10^{+77}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - i \cdot \left(a \cdot c\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y - 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 -7e-32)
     (* 2.0 (- (* z t) t_1))
     (if (<= c 5.8e+77)
       (* 2.0 (- (+ (* x y) (* z t)) (* i (* a c))))
       (* 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 = c * ((a + (b * c)) * i);
	double tmp;
	if (c <= -7e-32) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 5.8e+77) {
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
	} 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) :: tmp
    t_1 = c * ((a + (b * c)) * i)
    if (c <= (-7d-32)) then
        tmp = 2.0d0 * ((z * t) - t_1)
    else if (c <= 5.8d+77) then
        tmp = 2.0d0 * (((x * y) + (z * t)) - (i * (a * c)))
    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 = c * ((a + (b * c)) * i);
	double tmp;
	if (c <= -7e-32) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 5.8e+77) {
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
	} else {
		tmp = 2.0 * ((x * y) - 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 <= -7e-32:
		tmp = 2.0 * ((z * t) - t_1)
	elif c <= 5.8e+77:
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)))
	else:
		tmp = 2.0 * ((x * y) - 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 <= -7e-32)
		tmp = Float64(2.0 * Float64(Float64(z * t) - t_1));
	elseif (c <= 5.8e+77)
		tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(i * Float64(a * c))));
	else
		tmp = Float64(2.0 * Float64(Float64(x * y) - 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 <= -7e-32)
		tmp = 2.0 * ((z * t) - t_1);
	elseif (c <= 5.8e+77)
		tmp = 2.0 * (((x * y) + (z * t)) - (i * (a * c)));
	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[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -7e-32], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.8e+77], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(i * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $MachinePrecision] - 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 -7 \cdot 10^{-32}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\

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

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


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

    1. Initial program 77.9%

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

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

    if -6.9999999999999997e-32 < c < 5.8000000000000003e77

    1. Initial program 96.8%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. 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) \]

    if 5.8000000000000003e77 < c

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

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

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

Alternative 8: 86.4% 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 -5.2 \cdot 10^{-35}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\ \mathbf{elif}\;c \leq 5.8 \cdot 10^{+77}:\\ \;\;\;\;2 \cdot \left(\left(x \cdot y + z \cdot t\right) - a \cdot \left(c \cdot i\right)\right)\\ \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 (* c (* (+ a (* b c)) i))))
   (if (<= c -5.2e-35)
     (* 2.0 (- (* z t) t_1))
     (if (<= c 5.8e+77)
       (* 2.0 (- (+ (* x y) (* z t)) (* a (* c i))))
       (* 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 = c * ((a + (b * c)) * i);
	double tmp;
	if (c <= -5.2e-35) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 5.8e+77) {
		tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
	} 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) :: tmp
    t_1 = c * ((a + (b * c)) * i)
    if (c <= (-5.2d-35)) then
        tmp = 2.0d0 * ((z * t) - t_1)
    else if (c <= 5.8d+77) then
        tmp = 2.0d0 * (((x * y) + (z * t)) - (a * (c * i)))
    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 = c * ((a + (b * c)) * i);
	double tmp;
	if (c <= -5.2e-35) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 5.8e+77) {
		tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
	} else {
		tmp = 2.0 * ((x * y) - 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 <= -5.2e-35:
		tmp = 2.0 * ((z * t) - t_1)
	elif c <= 5.8e+77:
		tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)))
	else:
		tmp = 2.0 * ((x * y) - 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 <= -5.2e-35)
		tmp = Float64(2.0 * Float64(Float64(z * t) - t_1));
	elseif (c <= 5.8e+77)
		tmp = Float64(2.0 * Float64(Float64(Float64(x * y) + Float64(z * t)) - Float64(a * Float64(c * i))));
	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 = c * ((a + (b * c)) * i);
	tmp = 0.0;
	if (c <= -5.2e-35)
		tmp = 2.0 * ((z * t) - t_1);
	elseif (c <= 5.8e+77)
		tmp = 2.0 * (((x * y) + (z * t)) - (a * (c * i)));
	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[(c * N[(N[(a + N[(b * c), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -5.2e-35], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 5.8e+77], N[(2.0 * N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] - N[(a * N[(c * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(2.0 * N[(N[(x * y), $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 -5.2 \cdot 10^{-35}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t\_1\right)\\

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

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


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

    1. Initial program 77.9%

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

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

    if -5.20000000000000009e-35 < c < 5.8000000000000003e77

    1. Initial program 96.8%

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

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

    if 5.8000000000000003e77 < c

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

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

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

Alternative 9: 47.6% accurate, 0.8× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if c < -9.50000000000000094e-69 or 1.84999999999999994e93 < c

    1. Initial program 80.3%

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

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

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

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

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

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

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

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

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

    if -9.50000000000000094e-69 < c < -2.30000000000000012e-264

    1. Initial program 99.9%

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

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

    if -2.30000000000000012e-264 < c < 1.84999999999999994e93

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 39.1% accurate, 0.9× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -2.39999999999999998e-64 or 1.5e12 < y

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.39999999999999998e-64 < y < 3.50000000000000004e-196

    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 39.9%

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

    if 3.50000000000000004e-196 < y < 1.5e12

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 74.4% accurate, 0.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -7.2 \cdot 10^{-52} \lor \neg \left(c \leq 8.5 \cdot 10^{+77}\right):\\
\;\;\;\;\left(c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\right) \cdot -2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -7.19999999999999976e-52 or 8.50000000000000018e77 < c

    1. Initial program 80.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-define80.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. *-commutative80.0%

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

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

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

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

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

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

    if -7.19999999999999976e-52 < c < 8.50000000000000018e77

    1. Initial program 96.7%

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

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

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

Alternative 12: 70.1% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -9.2 \cdot 10^{+60} \lor \neg \left(c \leq 2.15 \cdot 10^{+92}\right):\\
\;\;\;\;\left(c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right) \cdot -2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -9.20000000000000068e60 or 2.1499999999999999e92 < c

    1. Initial program 77.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-define77.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. *-commutative77.0%

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

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

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

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

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

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

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

    if -9.20000000000000068e60 < c < 2.1499999999999999e92

    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. Add Preprocessing
    3. Taylor expanded in c around 0 72.3%

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

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

Alternative 13: 70.0% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 72.3%

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

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

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

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

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

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

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

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

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

    if -1.1e58 < c < 3.2000000000000001e93

    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. Add Preprocessing
    3. Taylor expanded in c around 0 72.3%

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

    if 3.2000000000000001e93 < c

    1. Initial program 81.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-define81.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. *-commutative81.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 40.7% accurate, 1.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{-66} \lor \neg \left(y \leq 3.8 \cdot 10^{+28}\right):\\
\;\;\;\;x \cdot \left(y \cdot 2\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.45000000000000006e-66 or 3.7999999999999999e28 < y

    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. Step-by-step derivation
      1. fma-define88.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. *-commutative88.1%

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

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

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

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

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

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

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

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

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

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

    if -1.45000000000000006e-66 < y < 3.7999999999999999e28

    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 z around inf 37.8%

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

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

Alternative 15: 30.0% 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 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 z around inf 27.3%

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

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

Developer Target 1: 94.1% accurate, 1.0× speedup?

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

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

Reproduce

?
herbie shell --seed 2024131 
(FPCore (x y z t a b c i)
  :name "Diagrams.ThreeD.Shapes:frustum from diagrams-lib-1.3.0.3, A"
  :precision binary64

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

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