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

Percentage Accurate: 89.8% → 92.7%
Time: 14.7s
Alternatives: 16
Speedup: 0.7×

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 16 alternatives:

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

Initial Program: 89.8% 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: 92.7% accurate, 0.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if i < -1e6 or 3.0000000000000001e-198 < i

    1. Initial program 94.9%

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

    if -1e6 < i < 3.0000000000000001e-198

    1. Initial program 80.2%

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

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

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

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

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

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

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

Alternative 2: 94.1% accurate, 0.2× speedup?

\[\begin{array}{l} \\ 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) \end{array} \]
(FPCore (x y z t a b c i)
 :precision binary64
 (* 2.0 (- (fma 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 * (fma(x, y, (z * t)) - ((a + (b * c)) * (c * i)));
}
function code(x, y, z, t, a, b, c, i)
	return Float64(2.0 * Float64(fma(x, y, Float64(z * t)) - Float64(Float64(a + Float64(b * c)) * Float64(c * i))))
end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(2.0 * N[(N[(x * y + 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(\mathsf{fma}\left(x, y, z \cdot t\right) - \left(a + b \cdot c\right) \cdot \left(c \cdot i\right)\right)
\end{array}
Derivation
  1. Initial program 89.4%

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

      \[\leadsto 2 \cdot \left(\color{blue}{\mathsf{fma}\left(x, y, z \cdot t\right)} - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
    2. associate-*l*95.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. Simplified95.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. Final simplification95.4%

    \[\leadsto 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) \]

Alternative 3: 94.1% accurate, 0.5× speedup?

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

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

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


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

    1. Initial program 73.9%

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

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

    if -inf.0 < (*.f64 (*.f64 (+.f64 a (*.f64 b c)) c) i) < 1.00000000000000003e282

    1. Initial program 98.7%

      \[2 \cdot \left(\left(x \cdot y + z \cdot t\right) - \left(\left(a + b \cdot c\right) \cdot c\right) \cdot i\right) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification95.4%

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

Alternative 4: 44.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -1.1 \cdot 10^{-66}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-134}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \cdot y \leq 3.7 \cdot 10^{-263}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+55}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 x y) < -2.25e89 or 2.00000000000000002e55 < (*.f64 x y)

    1. Initial program 89.1%

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

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

    if -2.25e89 < (*.f64 x y) < -1.1000000000000001e-66 or -2.60000000000000023e-134 < (*.f64 x y) < 0.0 or 3.6999999999999997e-263 < (*.f64 x y) < 2.00000000000000002e55

    1. Initial program 89.2%

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

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

    if -1.1000000000000001e-66 < (*.f64 x y) < -2.60000000000000023e-134 or 0.0 < (*.f64 x y) < 3.6999999999999997e-263

    1. Initial program 91.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -2.25 \cdot 10^{+89}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;x \cdot y \leq -1.1 \cdot 10^{-66}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-134}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 3.7 \cdot 10^{-263}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+55}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \end{array} \]

Alternative 5: 44.1% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;x \cdot y \leq -3.1 \cdot 10^{-66}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 0:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \cdot y \leq 1.25 \cdot 10^{+58}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if (*.f64 x y) < -7.99999999999999968e88 or 1.24999999999999996e58 < (*.f64 x y)

    1. Initial program 89.1%

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

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

    if -7.99999999999999968e88 < (*.f64 x y) < -3.0999999999999997e-66 or -2.60000000000000023e-134 < (*.f64 x y) < 0.0 or 1.7e-261 < (*.f64 x y) < 1.24999999999999996e58

    1. Initial program 89.2%

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

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

    if -3.0999999999999997e-66 < (*.f64 x y) < -2.60000000000000023e-134

    1. Initial program 89.1%

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

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

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

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

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

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

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

    if 0.0 < (*.f64 x y) < 1.7e-261

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -8 \cdot 10^{+88}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \mathbf{elif}\;x \cdot y \leq -3.1 \cdot 10^{-66}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq -2.6 \cdot 10^{-134}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 0:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \cdot y \leq 1.7 \cdot 10^{-261}:\\ \;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\ \mathbf{elif}\;x \cdot y \leq 1.25 \cdot 10^{+58}:\\ \;\;\;\;2 \cdot \left(z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y\right)\\ \end{array} \]

Alternative 6: 81.5% 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}\;x \cdot y \leq -6.2 \cdot 10^{+112} \lor \neg \left(x \cdot y \leq 2.5 \cdot 10^{+57}\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) -6.2e+112) (not (<= (* x y) 2.5e+57)))
     (* 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) <= -6.2e+112) || !((x * y) <= 2.5e+57)) {
		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) <= (-6.2d+112)) .or. (.not. ((x * y) <= 2.5d+57))) 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) <= -6.2e+112) || !((x * y) <= 2.5e+57)) {
		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) <= -6.2e+112) or not ((x * y) <= 2.5e+57):
		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) <= -6.2e+112) || !(Float64(x * y) <= 2.5e+57))
		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) <= -6.2e+112) || ~(((x * y) <= 2.5e+57)))
		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], -6.2e+112], N[Not[LessEqual[N[(x * y), $MachinePrecision], 2.5e+57]], $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 -6.2 \cdot 10^{+112} \lor \neg \left(x \cdot y \leq 2.5 \cdot 10^{+57}\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) < -6.19999999999999965e112 or 2.49999999999999986e57 < (*.f64 x y)

    1. Initial program 88.8%

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

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

    if -6.19999999999999965e112 < (*.f64 x y) < 2.49999999999999986e57

    1. Initial program 89.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \cdot y \leq -6.2 \cdot 10^{+112} \lor \neg \left(x \cdot y \leq 2.5 \cdot 10^{+57}\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} \]

Alternative 7: 61.8% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;t \leq 1.15 \cdot 10^{+33} \lor \neg \left(t \leq 1.65 \cdot 10^{+101}\right) \land t \leq 4.6 \cdot 10^{+163}:\\
\;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -3.4999999999999998e-134

    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. Taylor expanded in c around 0 58.2%

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

    if -3.4999999999999998e-134 < t < 1.15000000000000005e33 or 1.65000000000000006e101 < t < 4.60000000000000003e163

    1. Initial program 87.9%

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

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

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

    if 1.15000000000000005e33 < t < 1.65000000000000006e101 or 4.60000000000000003e163 < t

    1. Initial program 85.0%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -3.5 \cdot 10^{-134}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+33} \lor \neg \left(t \leq 1.65 \cdot 10^{+101}\right) \land t \leq 4.6 \cdot 10^{+163}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \end{array} \]

Alternative 8: 61.8% accurate, 0.9× speedup?

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

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

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

\mathbf{elif}\;t \leq 1.15 \cdot 10^{+104} \lor \neg \left(t \leq 1.4 \cdot 10^{+163}\right):\\
\;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -9.4999999999999992e-133

    1. Initial program 93.4%

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

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

    if -9.4999999999999992e-133 < t < 1.15e32

    1. Initial program 88.7%

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

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

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

    if 1.15e32 < t < 1.14999999999999992e104 or 1.40000000000000007e163 < t

    1. Initial program 85.0%

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

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

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

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

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

    if 1.14999999999999992e104 < t < 1.40000000000000007e163

    1. Initial program 82.5%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -9.5 \cdot 10^{-133}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+32}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(b \cdot \left(c \cdot i\right)\right)\right)\\ \mathbf{elif}\;t \leq 1.15 \cdot 10^{+104} \lor \neg \left(t \leq 1.4 \cdot 10^{+163}\right):\\ \;\;\;\;2 \cdot \left(z \cdot t - a \cdot \left(c \cdot i\right)\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \left(x \cdot y - c \cdot \left(c \cdot \left(b \cdot i\right)\right)\right)\\ \end{array} \]

Alternative 9: 64.8% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -1.48 \cdot 10^{+44} \lor \neg \left(x \cdot y \leq 3.8 \cdot 10^{+23}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -1.48e44 or 3.79999999999999975e23 < (*.f64 x y)

    1. Initial program 90.5%

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

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

    if -1.48e44 < (*.f64 x y) < 3.79999999999999975e23

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

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

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

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

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

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

Alternative 10: 80.0% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -3.6 \cdot 10^{-85} \lor \neg \left(c \leq 1.55 \cdot 10^{-8}\right):\\
\;\;\;\;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 + z \cdot t\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -3.5999999999999998e-85 or 1.55e-8 < c

    1. Initial program 82.1%

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

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

    if -3.5999999999999998e-85 < c < 1.55e-8

    1. Initial program 97.5%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;c \leq -3.6 \cdot 10^{-85} \lor \neg \left(c \leq 1.55 \cdot 10^{-8}\right):\\ \;\;\;\;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 + z \cdot t\right)\\ \end{array} \]

Alternative 11: 64.1% accurate, 1.0× speedup?

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

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

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

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


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

    1. Initial program 85.3%

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

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

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

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

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

    if -6.39999999999999972e112 < (*.f64 x y) < 3e22

    1. Initial program 89.3%

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

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

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

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

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

    if 3e22 < (*.f64 x y)

    1. Initial program 92.5%

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

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

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

Alternative 12: 86.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := c \cdot \left(\left(a + b \cdot c\right) \cdot i\right)\\ \mathbf{if}\;c \leq -1.32 \cdot 10^{+44}:\\ \;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\ \mathbf{elif}\;c \leq 2.15 \cdot 10^{+27}:\\ \;\;\;\;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 -1.32e+44)
     (* 2.0 (- (* z t) t_1))
     (if (<= c 2.15e+27)
       (* 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 <= -1.32e+44) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 2.15e+27) {
		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 <= (-1.32d+44)) then
        tmp = 2.0d0 * ((z * t) - t_1)
    else if (c <= 2.15d+27) 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 <= -1.32e+44) {
		tmp = 2.0 * ((z * t) - t_1);
	} else if (c <= 2.15e+27) {
		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 <= -1.32e+44:
		tmp = 2.0 * ((z * t) - t_1)
	elif c <= 2.15e+27:
		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 <= -1.32e+44)
		tmp = Float64(2.0 * Float64(Float64(z * t) - t_1));
	elseif (c <= 2.15e+27)
		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 <= -1.32e+44)
		tmp = 2.0 * ((z * t) - t_1);
	elseif (c <= 2.15e+27)
		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, -1.32e+44], N[(2.0 * N[(N[(z * t), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 2.15e+27], 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 -1.32 \cdot 10^{+44}:\\
\;\;\;\;2 \cdot \left(z \cdot t - t_1\right)\\

\mathbf{elif}\;c \leq 2.15 \cdot 10^{+27}:\\
\;\;\;\;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 < -1.3200000000000001e44

    1. Initial program 79.2%

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

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

    if -1.3200000000000001e44 < c < 2.15000000000000004e27

    1. Initial program 97.9%

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

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

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

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

    if 2.15000000000000004e27 < c

    1. Initial program 76.4%

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

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

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

Alternative 13: 55.9% accurate, 1.1× speedup?

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

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

\mathbf{elif}\;i \leq 5.8 \cdot 10^{+82} \lor \neg \left(i \leq 9 \cdot 10^{+135}\right) \land i \leq 1.5 \cdot 10^{+178}:\\
\;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\

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


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

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

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

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

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

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

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

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

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

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

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

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

    if -8.99999999999999947e126 < i < 5.8000000000000003e82 or 9.00000000000000014e135 < i < 1.50000000000000008e178

    1. Initial program 86.2%

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

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

    if 5.8000000000000003e82 < i < 9.00000000000000014e135 or 1.50000000000000008e178 < i

    1. Initial program 97.2%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;i \leq -9 \cdot 10^{+126}:\\ \;\;\;\;\left(i \cdot \left(a \cdot c\right)\right) \cdot -2\\ \mathbf{elif}\;i \leq 5.8 \cdot 10^{+82} \lor \neg \left(i \leq 9 \cdot 10^{+135}\right) \land i \leq 1.5 \cdot 10^{+178}:\\ \;\;\;\;2 \cdot \left(x \cdot y + z \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot \left(c \cdot i\right)\right) \cdot -2\\ \end{array} \]

Alternative 14: 74.6% accurate, 1.2× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;c \leq -0.025 \lor \neg \left(c \leq 1750\right):\\
\;\;\;\;2 \cdot \left(c \cdot \left(\left(a + b \cdot c\right) \cdot \left(-i\right)\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if c < -0.025000000000000001 or 1750 < 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. Taylor expanded in z around 0 79.0%

      \[\leadsto 2 \cdot \color{blue}{\left(x \cdot y - c \cdot \left(i \cdot \left(a + b \cdot c\right)\right)\right)} \]
    3. Step-by-step derivation
      1. distribute-lft-in76.6%

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

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

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

      \[\leadsto 2 \cdot \color{blue}{\left(-1 \cdot \left(c \cdot \left(a \cdot i + b \cdot \left(c \cdot i\right)\right)\right)\right)} \]
    6. Step-by-step derivation
      1. mul-1-neg67.0%

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

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

        \[\leadsto 2 \cdot \left(-\left(a \cdot i + \color{blue}{\left(b \cdot c\right) \cdot i}\right) \cdot c\right) \]
      4. distribute-rgt-in72.7%

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

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

        \[\leadsto 2 \cdot \color{blue}{\left(c \cdot \left(-i \cdot \left(a + b \cdot c\right)\right)\right)} \]
      7. distribute-lft-neg-in72.7%

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

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

    if -0.025000000000000001 < c < 1750

    1. Initial program 97.7%

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

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

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

Alternative 15: 44.4% accurate, 1.4× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -3 \cdot 10^{+89} \lor \neg \left(x \cdot y \leq 1.65 \cdot 10^{+55}\right):\\
\;\;\;\;2 \cdot \left(x \cdot y\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 x y) < -3.00000000000000013e89 or 1.65e55 < (*.f64 x y)

    1. Initial program 89.1%

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

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

    if -3.00000000000000013e89 < (*.f64 x y) < 1.65e55

    1. Initial program 89.6%

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

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

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

Alternative 16: 28.8% 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 89.4%

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

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

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

Developer target: 93.8% accurate, 1.0× speedup?

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

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

Reproduce

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

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

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