Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A

Percentage Accurate: 95.6% → 97.0%
Time: 9.6s
Alternatives: 13
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 95.6% accurate, 1.0× speedup?

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

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

Alternative 1: 97.0% accurate, 0.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.32 \cdot 10^{+39}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(9 \cdot \left(y \cdot z\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z -1.32e+39)
   (+ (* a (* 27.0 b)) (* z (* -9.0 (* y t))))
   (+ (- (* x 2.0) (* t (* 9.0 (* y z)))) (* b (* a 27.0)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.32e+39) {
		tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	} else {
		tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.0));
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (z <= (-1.32d+39)) then
        tmp = (a * (27.0d0 * b)) + (z * ((-9.0d0) * (y * t)))
    else
        tmp = ((x * 2.0d0) - (t * (9.0d0 * (y * z)))) + (b * (a * 27.0d0))
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= -1.32e+39) {
		tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	} else {
		tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= -1.32e+39:
		tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)))
	else:
		tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.0))
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= -1.32e+39)
		tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(-9.0 * Float64(y * t))));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(y * z)))) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (z <= -1.32e+39)
		tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	else
		tmp = ((x * 2.0) - (t * (9.0 * (y * z)))) + (b * (a * 27.0));
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.32e+39], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+39}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.32e39

    1. Initial program 94.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg94.1%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg94.1%

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*86.6%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified86.6%

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*72.9%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right) \]
      2. *-commutative72.9%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right) \]
      3. *-commutative72.9%

        \[\leadsto \left(a \cdot 27\right) \cdot b - 9 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \]
      4. associate-*l*73.0%

        \[\leadsto \left(a \cdot 27\right) \cdot b - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right) \cdot t} \]
      5. sub-neg73.0%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(-\left(9 \cdot \left(y \cdot z\right)\right) \cdot t\right)} \]
      6. +-commutative73.0%

        \[\leadsto \color{blue}{\left(-\left(9 \cdot \left(y \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
      7. associate-*l*72.9%

        \[\leadsto \left(-\color{blue}{9 \cdot \left(\left(y \cdot z\right) \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      8. *-commutative72.9%

        \[\leadsto \left(-9 \cdot \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      9. distribute-lft-neg-in72.9%

        \[\leadsto \color{blue}{\left(-9\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      10. associate-*r*74.6%

        \[\leadsto \left(-9\right) \cdot \color{blue}{\left(\left(t \cdot y\right) \cdot z\right)} + \left(a \cdot 27\right) \cdot b \]
      11. associate-*r*74.6%

        \[\leadsto \color{blue}{\left(\left(-9\right) \cdot \left(t \cdot y\right)\right) \cdot z} + \left(a \cdot 27\right) \cdot b \]
      12. metadata-eval74.6%

        \[\leadsto \left(\color{blue}{-9} \cdot \left(t \cdot y\right)\right) \cdot z + \left(a \cdot 27\right) \cdot b \]
      13. *-commutative74.6%

        \[\leadsto \left(-9 \cdot \color{blue}{\left(y \cdot t\right)}\right) \cdot z + \left(a \cdot 27\right) \cdot b \]
      14. associate-*l*74.6%

        \[\leadsto \left(-9 \cdot \left(y \cdot t\right)\right) \cdot z + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    6. Applied egg-rr74.6%

      \[\leadsto \color{blue}{\left(-9 \cdot \left(y \cdot t\right)\right) \cdot z + a \cdot \left(27 \cdot b\right)} \]

    if -1.32e39 < z

    1. Initial program 98.4%

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

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

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

Alternative 2: 96.4% accurate, 0.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\right)\right) \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (fma a (* 27.0 b) (fma x 2.0 (* y (* t (* -9.0 z))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return fma(a, (27.0 * b), fma(x, 2.0, (y * (t * (-9.0 * z)))));
}
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	return fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(t * Float64(-9.0 * z)))))
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(t * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  2. Simplified95.8%

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

    \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(t \cdot \left(-9 \cdot z\right)\right)\right)\right) \]

Alternative 3: 81.0% accurate, 0.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} t_1 := x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ t_2 := a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{if}\;z \leq -1.75 \cdot 10^{+36}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-20}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-45}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-43}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (- (* x 2.0) (* 9.0 (* t (* y z)))))
        (t_2 (+ (* a (* 27.0 b)) (* z (* -9.0 (* y t))))))
   (if (<= z -1.75e+36)
     t_2
     (if (<= z -7.5e-20)
       t_1
       (if (<= z -2.8e-45)
         t_2
         (if (<= z 1.55e-43) (+ (* x 2.0) (* 27.0 (* a b))) t_1))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x * 2.0) - (9.0 * (t * (y * z)));
	double t_2 = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	double tmp;
	if (z <= -1.75e+36) {
		tmp = t_2;
	} else if (z <= -7.5e-20) {
		tmp = t_1;
	} else if (z <= -2.8e-45) {
		tmp = t_2;
	} else if (z <= 1.55e-43) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
    t_2 = (a * (27.0d0 * b)) + (z * ((-9.0d0) * (y * t)))
    if (z <= (-1.75d+36)) then
        tmp = t_2
    else if (z <= (-7.5d-20)) then
        tmp = t_1
    else if (z <= (-2.8d-45)) then
        tmp = t_2
    else if (z <= 1.55d-43) then
        tmp = (x * 2.0d0) + (27.0d0 * (a * b))
    else
        tmp = t_1
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = (x * 2.0) - (9.0 * (t * (y * z)));
	double t_2 = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	double tmp;
	if (z <= -1.75e+36) {
		tmp = t_2;
	} else if (z <= -7.5e-20) {
		tmp = t_1;
	} else if (z <= -2.8e-45) {
		tmp = t_2;
	} else if (z <= 1.55e-43) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	t_1 = (x * 2.0) - (9.0 * (t * (y * z)))
	t_2 = (a * (27.0 * b)) + (z * (-9.0 * (y * t)))
	tmp = 0
	if z <= -1.75e+36:
		tmp = t_2
	elif z <= -7.5e-20:
		tmp = t_1
	elif z <= -2.8e-45:
		tmp = t_2
	elif z <= 1.55e-43:
		tmp = (x * 2.0) + (27.0 * (a * b))
	else:
		tmp = t_1
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z))))
	t_2 = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(-9.0 * Float64(y * t))))
	tmp = 0.0
	if (z <= -1.75e+36)
		tmp = t_2;
	elseif (z <= -7.5e-20)
		tmp = t_1;
	elseif (z <= -2.8e-45)
		tmp = t_2;
	elseif (z <= 1.55e-43)
		tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b)));
	else
		tmp = t_1;
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = (x * 2.0) - (9.0 * (t * (y * z)));
	t_2 = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	tmp = 0.0;
	if (z <= -1.75e+36)
		tmp = t_2;
	elseif (z <= -7.5e-20)
		tmp = t_1;
	elseif (z <= -2.8e-45)
		tmp = t_2;
	elseif (z <= 1.55e-43)
		tmp = (x * 2.0) + (27.0 * (a * b));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+36], t$95$2, If[LessEqual[z, -7.5e-20], t$95$1, If[LessEqual[z, -2.8e-45], t$95$2, If[LessEqual[z, 1.55e-43], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+36}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -7.5 \cdot 10^{-20}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2.8 \cdot 10^{-45}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq 1.55 \cdot 10^{-43}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.7499999999999999e36 or -7.49999999999999981e-20 < z < -2.8000000000000001e-45

    1. Initial program 94.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg94.7%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg94.7%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*88.1%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*88.0%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified88.0%

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*70.6%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right) \]
      2. *-commutative70.6%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right) \]
      3. *-commutative70.6%

        \[\leadsto \left(a \cdot 27\right) \cdot b - 9 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \]
      4. associate-*l*70.6%

        \[\leadsto \left(a \cdot 27\right) \cdot b - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right) \cdot t} \]
      5. sub-neg70.6%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(-\left(9 \cdot \left(y \cdot z\right)\right) \cdot t\right)} \]
      6. +-commutative70.6%

        \[\leadsto \color{blue}{\left(-\left(9 \cdot \left(y \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
      7. associate-*l*70.6%

        \[\leadsto \left(-\color{blue}{9 \cdot \left(\left(y \cdot z\right) \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      8. *-commutative70.6%

        \[\leadsto \left(-9 \cdot \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      9. distribute-lft-neg-in70.6%

        \[\leadsto \color{blue}{\left(-9\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      10. associate-*r*72.0%

        \[\leadsto \left(-9\right) \cdot \color{blue}{\left(\left(t \cdot y\right) \cdot z\right)} + \left(a \cdot 27\right) \cdot b \]
      11. associate-*r*72.1%

        \[\leadsto \color{blue}{\left(\left(-9\right) \cdot \left(t \cdot y\right)\right) \cdot z} + \left(a \cdot 27\right) \cdot b \]
      12. metadata-eval72.1%

        \[\leadsto \left(\color{blue}{-9} \cdot \left(t \cdot y\right)\right) \cdot z + \left(a \cdot 27\right) \cdot b \]
      13. *-commutative72.1%

        \[\leadsto \left(-9 \cdot \color{blue}{\left(y \cdot t\right)}\right) \cdot z + \left(a \cdot 27\right) \cdot b \]
      14. associate-*l*72.0%

        \[\leadsto \left(-9 \cdot \left(y \cdot t\right)\right) \cdot z + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    6. Applied egg-rr72.0%

      \[\leadsto \color{blue}{\left(-9 \cdot \left(y \cdot t\right)\right) \cdot z + a \cdot \left(27 \cdot b\right)} \]

    if -1.7499999999999999e36 < z < -7.49999999999999981e-20 or 1.55e-43 < z

    1. Initial program 96.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg96.6%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg96.6%

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*94.3%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified94.3%

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

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

    if -2.8000000000000001e-45 < z < 1.55e-43

    1. Initial program 99.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*99.8%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*99.9%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.75 \cdot 10^{+36}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -7.5 \cdot 10^{-20}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;z \leq -2.8 \cdot 10^{-45}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 1.55 \cdot 10^{-43}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 4: 81.3% accurate, 0.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(a \cdot b\right)\\ t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ t_3 := x \cdot 2 - t_2\\ \mathbf{if}\;z \leq -2.4 \cdot 10^{+39}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-50}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-91}:\\ \;\;\;\;t_1 - t_2\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-44}:\\ \;\;\;\;x \cdot 2 + t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* 27.0 (* a b)))
        (t_2 (* 9.0 (* t (* y z))))
        (t_3 (- (* x 2.0) t_2)))
   (if (<= z -2.4e+39)
     (+ (* a (* 27.0 b)) (* z (* -9.0 (* y t))))
     (if (<= z -8.6e-50)
       t_3
       (if (<= z -5.8e-91)
         (- t_1 t_2)
         (if (<= z 6.5e-44) (+ (* x 2.0) t_1) t_3))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 27.0 * (a * b);
	double t_2 = 9.0 * (t * (y * z));
	double t_3 = (x * 2.0) - t_2;
	double tmp;
	if (z <= -2.4e+39) {
		tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	} else if (z <= -8.6e-50) {
		tmp = t_3;
	} else if (z <= -5.8e-91) {
		tmp = t_1 - t_2;
	} else if (z <= 6.5e-44) {
		tmp = (x * 2.0) + t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = 27.0d0 * (a * b)
    t_2 = 9.0d0 * (t * (y * z))
    t_3 = (x * 2.0d0) - t_2
    if (z <= (-2.4d+39)) then
        tmp = (a * (27.0d0 * b)) + (z * ((-9.0d0) * (y * t)))
    else if (z <= (-8.6d-50)) then
        tmp = t_3
    else if (z <= (-5.8d-91)) then
        tmp = t_1 - t_2
    else if (z <= 6.5d-44) then
        tmp = (x * 2.0d0) + t_1
    else
        tmp = t_3
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 27.0 * (a * b);
	double t_2 = 9.0 * (t * (y * z));
	double t_3 = (x * 2.0) - t_2;
	double tmp;
	if (z <= -2.4e+39) {
		tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	} else if (z <= -8.6e-50) {
		tmp = t_3;
	} else if (z <= -5.8e-91) {
		tmp = t_1 - t_2;
	} else if (z <= 6.5e-44) {
		tmp = (x * 2.0) + t_1;
	} else {
		tmp = t_3;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	t_1 = 27.0 * (a * b)
	t_2 = 9.0 * (t * (y * z))
	t_3 = (x * 2.0) - t_2
	tmp = 0
	if z <= -2.4e+39:
		tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)))
	elif z <= -8.6e-50:
		tmp = t_3
	elif z <= -5.8e-91:
		tmp = t_1 - t_2
	elif z <= 6.5e-44:
		tmp = (x * 2.0) + t_1
	else:
		tmp = t_3
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(27.0 * Float64(a * b))
	t_2 = Float64(9.0 * Float64(t * Float64(y * z)))
	t_3 = Float64(Float64(x * 2.0) - t_2)
	tmp = 0.0
	if (z <= -2.4e+39)
		tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(z * Float64(-9.0 * Float64(y * t))));
	elseif (z <= -8.6e-50)
		tmp = t_3;
	elseif (z <= -5.8e-91)
		tmp = Float64(t_1 - t_2);
	elseif (z <= 6.5e-44)
		tmp = Float64(Float64(x * 2.0) + t_1);
	else
		tmp = t_3;
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = 27.0 * (a * b);
	t_2 = 9.0 * (t * (y * z));
	t_3 = (x * 2.0) - t_2;
	tmp = 0.0;
	if (z <= -2.4e+39)
		tmp = (a * (27.0 * b)) + (z * (-9.0 * (y * t)));
	elseif (z <= -8.6e-50)
		tmp = t_3;
	elseif (z <= -5.8e-91)
		tmp = t_1 - t_2;
	elseif (z <= 6.5e-44)
		tmp = (x * 2.0) + t_1;
	else
		tmp = t_3;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[z, -2.4e+39], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.6e-50], t$95$3, If[LessEqual[z, -5.8e-91], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[z, 6.5e-44], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_3 := x \cdot 2 - t_2\\
\mathbf{if}\;z \leq -2.4 \cdot 10^{+39}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\

\mathbf{elif}\;z \leq -8.6 \cdot 10^{-50}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;z \leq -5.8 \cdot 10^{-91}:\\
\;\;\;\;t_1 - t_2\\

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-44}:\\
\;\;\;\;x \cdot 2 + t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.4000000000000001e39

    1. Initial program 94.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg94.1%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg94.1%

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*86.6%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified86.6%

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    5. Step-by-step derivation
      1. associate-*r*72.9%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right) \]
      2. *-commutative72.9%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right) \]
      3. *-commutative72.9%

        \[\leadsto \left(a \cdot 27\right) \cdot b - 9 \cdot \color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \]
      4. associate-*l*73.0%

        \[\leadsto \left(a \cdot 27\right) \cdot b - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right) \cdot t} \]
      5. sub-neg73.0%

        \[\leadsto \color{blue}{\left(a \cdot 27\right) \cdot b + \left(-\left(9 \cdot \left(y \cdot z\right)\right) \cdot t\right)} \]
      6. +-commutative73.0%

        \[\leadsto \color{blue}{\left(-\left(9 \cdot \left(y \cdot z\right)\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b} \]
      7. associate-*l*72.9%

        \[\leadsto \left(-\color{blue}{9 \cdot \left(\left(y \cdot z\right) \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      8. *-commutative72.9%

        \[\leadsto \left(-9 \cdot \color{blue}{\left(t \cdot \left(y \cdot z\right)\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      9. distribute-lft-neg-in72.9%

        \[\leadsto \color{blue}{\left(-9\right) \cdot \left(t \cdot \left(y \cdot z\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      10. associate-*r*74.6%

        \[\leadsto \left(-9\right) \cdot \color{blue}{\left(\left(t \cdot y\right) \cdot z\right)} + \left(a \cdot 27\right) \cdot b \]
      11. associate-*r*74.6%

        \[\leadsto \color{blue}{\left(\left(-9\right) \cdot \left(t \cdot y\right)\right) \cdot z} + \left(a \cdot 27\right) \cdot b \]
      12. metadata-eval74.6%

        \[\leadsto \left(\color{blue}{-9} \cdot \left(t \cdot y\right)\right) \cdot z + \left(a \cdot 27\right) \cdot b \]
      13. *-commutative74.6%

        \[\leadsto \left(-9 \cdot \color{blue}{\left(y \cdot t\right)}\right) \cdot z + \left(a \cdot 27\right) \cdot b \]
      14. associate-*l*74.6%

        \[\leadsto \left(-9 \cdot \left(y \cdot t\right)\right) \cdot z + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    6. Applied egg-rr74.6%

      \[\leadsto \color{blue}{\left(-9 \cdot \left(y \cdot t\right)\right) \cdot z + a \cdot \left(27 \cdot b\right)} \]

    if -2.4000000000000001e39 < z < -8.59999999999999995e-50 or 6.5e-44 < z

    1. Initial program 96.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg96.8%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg96.8%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*94.7%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*94.8%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified94.8%

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

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

    if -8.59999999999999995e-50 < z < -5.8000000000000001e-91

    1. Initial program 99.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg99.6%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg99.6%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*99.6%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*100.0%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified100.0%

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]

    if -5.8000000000000001e-91 < z < 6.5e-44

    1. Initial program 99.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg99.7%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*99.8%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*99.9%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified99.9%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.4 \cdot 10^{+39}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -8.6 \cdot 10^{-50}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;z \leq -5.8 \cdot 10^{-91}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;z \leq 6.5 \cdot 10^{-44}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 5: 95.6% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right) \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (+ (- (* x 2.0) (* (* y 9.0) (* t z))) (* a (* 27.0 b))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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
    code = ((x * 2.0d0) - ((y * 9.0d0) * (t * z))) + (a * (27.0d0 * b))
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	return ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b))
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(t * z))) + Float64(a * Float64(27.0 * b)))
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp = code(x, y, z, t, a, b)
	tmp = ((x * 2.0) - ((y * 9.0) * (t * z))) + (a * (27.0 * b));
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  2. Step-by-step derivation
    1. sub-neg97.6%

      \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
    2. sub-neg97.6%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
    3. associate-*l*95.4%

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
    4. associate-*l*95.4%

      \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
  3. Simplified95.4%

    \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
  4. Final simplification95.4%

    \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(t \cdot z\right)\right) + a \cdot \left(27 \cdot b\right) \]

Alternative 6: 46.6% accurate, 1.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} t_1 := a \cdot \left(27 \cdot b\right)\\ \mathbf{if}\;x \leq -2.6 \cdot 10^{+99}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -1.25 \cdot 10^{-23}:\\ \;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;x \leq -3.1 \cdot 10^{-44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 3.65 \cdot 10^{-225}:\\ \;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+105}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* 27.0 b))))
   (if (<= x -2.6e+99)
     (* x 2.0)
     (if (<= x -1.25e-23)
       (* z (* -9.0 (* y t)))
       (if (<= x -3.1e-44)
         t_1
         (if (<= x 3.65e-225)
           (* (* y z) (* t -9.0))
           (if (<= x 3.8e+105) t_1 (* x 2.0))))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (27.0 * b);
	double tmp;
	if (x <= -2.6e+99) {
		tmp = x * 2.0;
	} else if (x <= -1.25e-23) {
		tmp = z * (-9.0 * (y * t));
	} else if (x <= -3.1e-44) {
		tmp = t_1;
	} else if (x <= 3.65e-225) {
		tmp = (y * z) * (t * -9.0);
	} else if (x <= 3.8e+105) {
		tmp = t_1;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = a * (27.0d0 * b)
    if (x <= (-2.6d+99)) then
        tmp = x * 2.0d0
    else if (x <= (-1.25d-23)) then
        tmp = z * ((-9.0d0) * (y * t))
    else if (x <= (-3.1d-44)) then
        tmp = t_1
    else if (x <= 3.65d-225) then
        tmp = (y * z) * (t * (-9.0d0))
    else if (x <= 3.8d+105) then
        tmp = t_1
    else
        tmp = x * 2.0d0
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (27.0 * b);
	double tmp;
	if (x <= -2.6e+99) {
		tmp = x * 2.0;
	} else if (x <= -1.25e-23) {
		tmp = z * (-9.0 * (y * t));
	} else if (x <= -3.1e-44) {
		tmp = t_1;
	} else if (x <= 3.65e-225) {
		tmp = (y * z) * (t * -9.0);
	} else if (x <= 3.8e+105) {
		tmp = t_1;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	t_1 = a * (27.0 * b)
	tmp = 0
	if x <= -2.6e+99:
		tmp = x * 2.0
	elif x <= -1.25e-23:
		tmp = z * (-9.0 * (y * t))
	elif x <= -3.1e-44:
		tmp = t_1
	elif x <= 3.65e-225:
		tmp = (y * z) * (t * -9.0)
	elif x <= 3.8e+105:
		tmp = t_1
	else:
		tmp = x * 2.0
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(27.0 * b))
	tmp = 0.0
	if (x <= -2.6e+99)
		tmp = Float64(x * 2.0);
	elseif (x <= -1.25e-23)
		tmp = Float64(z * Float64(-9.0 * Float64(y * t)));
	elseif (x <= -3.1e-44)
		tmp = t_1;
	elseif (x <= 3.65e-225)
		tmp = Float64(Float64(y * z) * Float64(t * -9.0));
	elseif (x <= 3.8e+105)
		tmp = t_1;
	else
		tmp = Float64(x * 2.0);
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (27.0 * b);
	tmp = 0.0;
	if (x <= -2.6e+99)
		tmp = x * 2.0;
	elseif (x <= -1.25e-23)
		tmp = z * (-9.0 * (y * t));
	elseif (x <= -3.1e-44)
		tmp = t_1;
	elseif (x <= 3.65e-225)
		tmp = (y * z) * (t * -9.0);
	elseif (x <= 3.8e+105)
		tmp = t_1;
	else
		tmp = x * 2.0;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.6e+99], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -1.25e-23], N[(z * N[(-9.0 * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -3.1e-44], t$95$1, If[LessEqual[x, 3.65e-225], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e+105], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;x \leq -2.6 \cdot 10^{+99}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -1.25 \cdot 10^{-23}:\\
\;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\

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

\mathbf{elif}\;x \leq 3.65 \cdot 10^{-225}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\

\mathbf{elif}\;x \leq 3.8 \cdot 10^{+105}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -2.6e99 or 3.8e105 < x

    1. Initial program 99.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg99.0%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg99.0%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*99.0%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*99.0%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified99.0%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in x around inf 72.8%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -2.6e99 < x < -1.2500000000000001e-23

    1. Initial program 99.7%

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

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Taylor expanded in y around inf 44.2%

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

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

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

        \[\leadsto \left(\color{blue}{\left(y \cdot t\right)} \cdot z\right) \cdot -9 \]
      4. associate-*l*44.3%

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

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot \left(z \cdot -9\right) \]
    5. Simplified44.3%

      \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(z \cdot -9\right)} \]
    6. Taylor expanded in t around 0 44.2%

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

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

        \[\leadsto \color{blue}{\left(\left(t \cdot y\right) \cdot z\right)} \cdot -9 \]
      3. associate-*r*44.3%

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

        \[\leadsto \color{blue}{\left(z \cdot -9\right) \cdot \left(t \cdot y\right)} \]
      5. associate-*r*44.2%

        \[\leadsto \color{blue}{z \cdot \left(-9 \cdot \left(t \cdot y\right)\right)} \]
    8. Simplified44.2%

      \[\leadsto \color{blue}{z \cdot \left(-9 \cdot \left(t \cdot y\right)\right)} \]

    if -1.2500000000000001e-23 < x < -3.09999999999999984e-44 or 3.64999999999999998e-225 < x < 3.8e105

    1. Initial program 95.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg95.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg95.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*94.6%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*94.7%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified94.7%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in a around inf 49.7%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*49.7%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative49.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. associate-*r*49.8%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    6. Simplified49.8%

      \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} \]

    if -3.09999999999999984e-44 < x < 3.64999999999999998e-225

    1. Initial program 96.7%

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

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Taylor expanded in y around inf 53.8%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutative53.8%

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

        \[\leadsto \color{blue}{\left(\left(t \cdot y\right) \cdot z\right)} \cdot -9 \]
      3. *-commutative46.8%

        \[\leadsto \left(\color{blue}{\left(y \cdot t\right)} \cdot z\right) \cdot -9 \]
      4. associate-*l*46.8%

        \[\leadsto \color{blue}{\left(y \cdot t\right) \cdot \left(z \cdot -9\right)} \]
      5. *-commutative46.8%

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot \left(z \cdot -9\right) \]
    5. Simplified46.8%

      \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(z \cdot -9\right)} \]
    6. Taylor expanded in t around 0 53.8%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutative53.8%

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

        \[\leadsto \color{blue}{\left(\left(t \cdot y\right) \cdot z\right)} \cdot -9 \]
      3. associate-*r*46.8%

        \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(z \cdot -9\right)} \]
      4. *-commutative46.8%

        \[\leadsto \color{blue}{\left(z \cdot -9\right) \cdot \left(t \cdot y\right)} \]
      5. associate-*r*46.8%

        \[\leadsto \color{blue}{z \cdot \left(-9 \cdot \left(t \cdot y\right)\right)} \]
    8. Simplified46.8%

      \[\leadsto \color{blue}{z \cdot \left(-9 \cdot \left(t \cdot y\right)\right)} \]
    9. Taylor expanded in z around 0 53.8%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*r*53.8%

        \[\leadsto \color{blue}{\left(-9 \cdot t\right) \cdot \left(y \cdot z\right)} \]
    11. Simplified53.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.6 \cdot 10^{+99}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -1.25 \cdot 10^{-23}:\\ \;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;x \leq -3.1 \cdot 10^{-44}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;x \leq 3.65 \cdot 10^{-225}:\\ \;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+105}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 7: 46.7% accurate, 1.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} t_1 := a \cdot \left(27 \cdot b\right)\\ \mathbf{if}\;x \leq -3.5 \cdot 10^{+99}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-28}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(-9 \cdot z\right)\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-45}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-227}:\\ \;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\ \mathbf{elif}\;x \leq 7 \cdot 10^{+101}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* 27.0 b))))
   (if (<= x -3.5e+99)
     (* x 2.0)
     (if (<= x -4.4e-28)
       (* (* y t) (* -9.0 z))
       (if (<= x -7e-45)
         t_1
         (if (<= x 1.65e-227)
           (* (* y z) (* t -9.0))
           (if (<= x 7e+101) t_1 (* x 2.0))))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (27.0 * b);
	double tmp;
	if (x <= -3.5e+99) {
		tmp = x * 2.0;
	} else if (x <= -4.4e-28) {
		tmp = (y * t) * (-9.0 * z);
	} else if (x <= -7e-45) {
		tmp = t_1;
	} else if (x <= 1.65e-227) {
		tmp = (y * z) * (t * -9.0);
	} else if (x <= 7e+101) {
		tmp = t_1;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = a * (27.0d0 * b)
    if (x <= (-3.5d+99)) then
        tmp = x * 2.0d0
    else if (x <= (-4.4d-28)) then
        tmp = (y * t) * ((-9.0d0) * z)
    else if (x <= (-7d-45)) then
        tmp = t_1
    else if (x <= 1.65d-227) then
        tmp = (y * z) * (t * (-9.0d0))
    else if (x <= 7d+101) then
        tmp = t_1
    else
        tmp = x * 2.0d0
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (27.0 * b);
	double tmp;
	if (x <= -3.5e+99) {
		tmp = x * 2.0;
	} else if (x <= -4.4e-28) {
		tmp = (y * t) * (-9.0 * z);
	} else if (x <= -7e-45) {
		tmp = t_1;
	} else if (x <= 1.65e-227) {
		tmp = (y * z) * (t * -9.0);
	} else if (x <= 7e+101) {
		tmp = t_1;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	t_1 = a * (27.0 * b)
	tmp = 0
	if x <= -3.5e+99:
		tmp = x * 2.0
	elif x <= -4.4e-28:
		tmp = (y * t) * (-9.0 * z)
	elif x <= -7e-45:
		tmp = t_1
	elif x <= 1.65e-227:
		tmp = (y * z) * (t * -9.0)
	elif x <= 7e+101:
		tmp = t_1
	else:
		tmp = x * 2.0
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(27.0 * b))
	tmp = 0.0
	if (x <= -3.5e+99)
		tmp = Float64(x * 2.0);
	elseif (x <= -4.4e-28)
		tmp = Float64(Float64(y * t) * Float64(-9.0 * z));
	elseif (x <= -7e-45)
		tmp = t_1;
	elseif (x <= 1.65e-227)
		tmp = Float64(Float64(y * z) * Float64(t * -9.0));
	elseif (x <= 7e+101)
		tmp = t_1;
	else
		tmp = Float64(x * 2.0);
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (27.0 * b);
	tmp = 0.0;
	if (x <= -3.5e+99)
		tmp = x * 2.0;
	elseif (x <= -4.4e-28)
		tmp = (y * t) * (-9.0 * z);
	elseif (x <= -7e-45)
		tmp = t_1;
	elseif (x <= 1.65e-227)
		tmp = (y * z) * (t * -9.0);
	elseif (x <= 7e+101)
		tmp = t_1;
	else
		tmp = x * 2.0;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.5e+99], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -4.4e-28], N[(N[(y * t), $MachinePrecision] * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -7e-45], t$95$1, If[LessEqual[x, 1.65e-227], N[(N[(y * z), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e+101], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+99}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -4.4 \cdot 10^{-28}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(-9 \cdot z\right)\\

\mathbf{elif}\;x \leq -7 \cdot 10^{-45}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 1.65 \cdot 10^{-227}:\\
\;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\

\mathbf{elif}\;x \leq 7 \cdot 10^{+101}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -3.4999999999999998e99 or 7.00000000000000046e101 < x

    1. Initial program 99.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg99.0%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg99.0%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*99.0%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*99.0%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified99.0%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in x around inf 72.8%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -3.4999999999999998e99 < x < -4.39999999999999992e-28

    1. Initial program 99.7%

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

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Taylor expanded in y around inf 44.2%

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

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

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

        \[\leadsto \left(\color{blue}{\left(y \cdot t\right)} \cdot z\right) \cdot -9 \]
      4. associate-*l*44.3%

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

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot \left(z \cdot -9\right) \]
    5. Simplified44.3%

      \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(z \cdot -9\right)} \]

    if -4.39999999999999992e-28 < x < -7e-45 or 1.65e-227 < x < 7.00000000000000046e101

    1. Initial program 95.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg95.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg95.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*94.6%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*94.7%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified94.7%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in a around inf 49.7%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*49.7%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative49.7%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. associate-*r*49.8%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    6. Simplified49.8%

      \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} \]

    if -7e-45 < x < 1.65e-227

    1. Initial program 96.7%

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

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Taylor expanded in y around inf 53.8%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    4. Step-by-step derivation
      1. *-commutative53.8%

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

        \[\leadsto \color{blue}{\left(\left(t \cdot y\right) \cdot z\right)} \cdot -9 \]
      3. *-commutative46.8%

        \[\leadsto \left(\color{blue}{\left(y \cdot t\right)} \cdot z\right) \cdot -9 \]
      4. associate-*l*46.8%

        \[\leadsto \color{blue}{\left(y \cdot t\right) \cdot \left(z \cdot -9\right)} \]
      5. *-commutative46.8%

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot \left(z \cdot -9\right) \]
    5. Simplified46.8%

      \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(z \cdot -9\right)} \]
    6. Taylor expanded in t around 0 53.8%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    7. Step-by-step derivation
      1. *-commutative53.8%

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

        \[\leadsto \color{blue}{\left(\left(t \cdot y\right) \cdot z\right)} \cdot -9 \]
      3. associate-*r*46.8%

        \[\leadsto \color{blue}{\left(t \cdot y\right) \cdot \left(z \cdot -9\right)} \]
      4. *-commutative46.8%

        \[\leadsto \color{blue}{\left(z \cdot -9\right) \cdot \left(t \cdot y\right)} \]
      5. associate-*r*46.8%

        \[\leadsto \color{blue}{z \cdot \left(-9 \cdot \left(t \cdot y\right)\right)} \]
    8. Simplified46.8%

      \[\leadsto \color{blue}{z \cdot \left(-9 \cdot \left(t \cdot y\right)\right)} \]
    9. Taylor expanded in z around 0 53.8%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    10. Step-by-step derivation
      1. associate-*r*53.8%

        \[\leadsto \color{blue}{\left(-9 \cdot t\right) \cdot \left(y \cdot z\right)} \]
    11. Simplified53.8%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.5 \cdot 10^{+99}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -4.4 \cdot 10^{-28}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(-9 \cdot z\right)\\ \mathbf{elif}\;x \leq -7 \cdot 10^{-45}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;x \leq 1.65 \cdot 10^{-227}:\\ \;\;\;\;\left(y \cdot z\right) \cdot \left(t \cdot -9\right)\\ \mathbf{elif}\;x \leq 7 \cdot 10^{+101}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 8: 77.1% accurate, 1.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq -2.35 \cdot 10^{+82} \lor \neg \left(a \leq 0.0082\right):\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= a -2.35e+82) (not (<= a 0.0082)))
   (+ (* x 2.0) (* 27.0 (* a b)))
   (- (* x 2.0) (* 9.0 (* t (* y z))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -2.35e+82) || !(a <= 0.0082)) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else {
		tmp = (x * 2.0) - (9.0 * (t * (y * z)));
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if ((a <= (-2.35d+82)) .or. (.not. (a <= 0.0082d0))) then
        tmp = (x * 2.0d0) + (27.0d0 * (a * b))
    else
        tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((a <= -2.35e+82) || !(a <= 0.0082)) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else {
		tmp = (x * 2.0) - (9.0 * (t * (y * z)));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	tmp = 0
	if (a <= -2.35e+82) or not (a <= 0.0082):
		tmp = (x * 2.0) + (27.0 * (a * b))
	else:
		tmp = (x * 2.0) - (9.0 * (t * (y * z)))
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((a <= -2.35e+82) || !(a <= 0.0082))
		tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b)));
	else
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(y * z))));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((a <= -2.35e+82) || ~((a <= 0.0082)))
		tmp = (x * 2.0) + (27.0 * (a * b));
	else
		tmp = (x * 2.0) - (9.0 * (t * (y * z)));
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.35e+82], N[Not[LessEqual[a, 0.0082]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.35 \cdot 10^{+82} \lor \neg \left(a \leq 0.0082\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -2.35e82 or 0.00820000000000000069 < a

    1. Initial program 96.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg96.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg96.9%

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*94.1%

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]

    if -2.35e82 < a < 0.00820000000000000069

    1. Initial program 98.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg98.0%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg98.0%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*96.2%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*96.2%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.35 \cdot 10^{+82} \lor \neg \left(a \leq 0.0082\right):\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 9: 47.1% accurate, 1.3× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} t_1 := a \cdot \left(27 \cdot b\right)\\ \mathbf{if}\;x \leq -2.1 \cdot 10^{+126}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-257}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-226}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{+103}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* a (* 27.0 b))))
   (if (<= x -2.1e+126)
     (* x 2.0)
     (if (<= x -2.3e-257)
       t_1
       (if (<= x 2.7e-226)
         (* -9.0 (* t (* y z)))
         (if (<= x 1.75e+103) t_1 (* x 2.0)))))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (27.0 * b);
	double tmp;
	if (x <= -2.1e+126) {
		tmp = x * 2.0;
	} else if (x <= -2.3e-257) {
		tmp = t_1;
	} else if (x <= 2.7e-226) {
		tmp = -9.0 * (t * (y * z));
	} else if (x <= 1.75e+103) {
		tmp = t_1;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: t_1
    real(8) :: tmp
    t_1 = a * (27.0d0 * b)
    if (x <= (-2.1d+126)) then
        tmp = x * 2.0d0
    else if (x <= (-2.3d-257)) then
        tmp = t_1
    else if (x <= 2.7d-226) then
        tmp = (-9.0d0) * (t * (y * z))
    else if (x <= 1.75d+103) then
        tmp = t_1
    else
        tmp = x * 2.0d0
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = a * (27.0 * b);
	double tmp;
	if (x <= -2.1e+126) {
		tmp = x * 2.0;
	} else if (x <= -2.3e-257) {
		tmp = t_1;
	} else if (x <= 2.7e-226) {
		tmp = -9.0 * (t * (y * z));
	} else if (x <= 1.75e+103) {
		tmp = t_1;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	t_1 = a * (27.0 * b)
	tmp = 0
	if x <= -2.1e+126:
		tmp = x * 2.0
	elif x <= -2.3e-257:
		tmp = t_1
	elif x <= 2.7e-226:
		tmp = -9.0 * (t * (y * z))
	elif x <= 1.75e+103:
		tmp = t_1
	else:
		tmp = x * 2.0
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(27.0 * b))
	tmp = 0.0
	if (x <= -2.1e+126)
		tmp = Float64(x * 2.0);
	elseif (x <= -2.3e-257)
		tmp = t_1;
	elseif (x <= 2.7e-226)
		tmp = Float64(-9.0 * Float64(t * Float64(y * z)));
	elseif (x <= 1.75e+103)
		tmp = t_1;
	else
		tmp = Float64(x * 2.0);
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (27.0 * b);
	tmp = 0.0;
	if (x <= -2.1e+126)
		tmp = x * 2.0;
	elseif (x <= -2.3e-257)
		tmp = t_1;
	elseif (x <= 2.7e-226)
		tmp = -9.0 * (t * (y * z));
	elseif (x <= 1.75e+103)
		tmp = t_1;
	else
		tmp = x * 2.0;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+126], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -2.3e-257], t$95$1, If[LessEqual[x, 2.7e-226], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.75e+103], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+126}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -2.3 \cdot 10^{-257}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 2.7 \cdot 10^{-226}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\

\mathbf{elif}\;x \leq 1.75 \cdot 10^{+103}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;x \cdot 2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.0999999999999999e126 or 1.75e103 < x

    1. Initial program 98.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg98.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg98.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*98.9%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*98.9%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified98.9%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in x around inf 75.3%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -2.0999999999999999e126 < x < -2.3e-257 or 2.70000000000000014e-226 < x < 1.75e103

    1. Initial program 96.3%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg96.3%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg96.3%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*93.0%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*93.0%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified93.0%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in a around inf 47.3%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*47.3%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative47.3%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. associate-*r*47.4%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    6. Simplified47.4%

      \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} \]

    if -2.3e-257 < x < 2.70000000000000014e-226

    1. Initial program 99.6%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg99.6%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg99.6%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*96.0%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*96.1%

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

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in y around inf 68.6%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.1 \cdot 10^{+126}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -2.3 \cdot 10^{-257}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;x \leq 2.7 \cdot 10^{-226}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;x \leq 1.75 \cdot 10^{+103}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 10: 70.7% accurate, 1.3× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+185}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-131}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(-9 \cdot z\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= y -3.4e+185)
   (* -9.0 (* t (* y z)))
   (if (<= y 2.1e-131) (+ (* x 2.0) (* 27.0 (* a b))) (* (* y t) (* -9.0 z)))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.4e+185) {
		tmp = -9.0 * (t * (y * z));
	} else if (y <= 2.1e-131) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else {
		tmp = (y * t) * (-9.0 * z);
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y <= (-3.4d+185)) then
        tmp = (-9.0d0) * (t * (y * z))
    else if (y <= 2.1d-131) then
        tmp = (x * 2.0d0) + (27.0d0 * (a * b))
    else
        tmp = (y * t) * ((-9.0d0) * z)
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y <= -3.4e+185) {
		tmp = -9.0 * (t * (y * z));
	} else if (y <= 2.1e-131) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else {
		tmp = (y * t) * (-9.0 * z);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	tmp = 0
	if y <= -3.4e+185:
		tmp = -9.0 * (t * (y * z))
	elif y <= 2.1e-131:
		tmp = (x * 2.0) + (27.0 * (a * b))
	else:
		tmp = (y * t) * (-9.0 * z)
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y <= -3.4e+185)
		tmp = Float64(-9.0 * Float64(t * Float64(y * z)));
	elseif (y <= 2.1e-131)
		tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b)));
	else
		tmp = Float64(Float64(y * t) * Float64(-9.0 * z));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y <= -3.4e+185)
		tmp = -9.0 * (t * (y * z));
	elseif (y <= 2.1e-131)
		tmp = (x * 2.0) + (27.0 * (a * b));
	else
		tmp = (y * t) * (-9.0 * z);
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3.4e+185], N[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e-131], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * t), $MachinePrecision] * N[(-9.0 * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+185}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\

\mathbf{elif}\;y \leq 2.1 \cdot 10^{-131}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\

\mathbf{else}:\\
\;\;\;\;\left(y \cdot t\right) \cdot \left(-9 \cdot z\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -3.40000000000000017e185

    1. Initial program 79.7%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg79.7%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg79.7%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*94.4%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*94.4%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified94.4%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in y around inf 54.0%

      \[\leadsto \color{blue}{-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]

    if -3.40000000000000017e185 < y < 2.09999999999999997e-131

    1. Initial program 99.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg99.8%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg99.8%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*94.8%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*94.9%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified94.9%

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]

    if 2.09999999999999997e-131 < y

    1. Initial program 97.6%

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

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(9 \cdot \left(y \cdot z\right)\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    3. Taylor expanded in y around inf 48.9%

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

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

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

        \[\leadsto \left(\color{blue}{\left(y \cdot t\right)} \cdot z\right) \cdot -9 \]
      4. associate-*l*43.5%

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

        \[\leadsto \color{blue}{\left(t \cdot y\right)} \cdot \left(z \cdot -9\right) \]
    5. Simplified43.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -3.4 \cdot 10^{+185}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 2.1 \cdot 10^{-131}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(y \cdot t\right) \cdot \left(-9 \cdot z\right)\\ \end{array} \]

Alternative 11: 47.8% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{+128} \lor \neg \left(x \leq 5.5 \cdot 10^{+102}\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= x -5.2e+128) (not (<= x 5.5e+102))) (* x 2.0) (* 27.0 (* a b))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x <= -5.2e+128) || !(x <= 5.5e+102)) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if ((x <= (-5.2d+128)) .or. (.not. (x <= 5.5d+102))) then
        tmp = x * 2.0d0
    else
        tmp = 27.0d0 * (a * b)
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x <= -5.2e+128) || !(x <= 5.5e+102)) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (a * b);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	tmp = 0
	if (x <= -5.2e+128) or not (x <= 5.5e+102):
		tmp = x * 2.0
	else:
		tmp = 27.0 * (a * b)
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((x <= -5.2e+128) || !(x <= 5.5e+102))
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(27.0 * Float64(a * b));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((x <= -5.2e+128) || ~((x <= 5.5e+102)))
		tmp = x * 2.0;
	else
		tmp = 27.0 * (a * b);
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -5.2e+128], N[Not[LessEqual[x, 5.5e+102]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+128} \lor \neg \left(x \leq 5.5 \cdot 10^{+102}\right):\\
\;\;\;\;x \cdot 2\\

\mathbf{else}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -5.2e128 or 5.49999999999999981e102 < x

    1. Initial program 98.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg98.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg98.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*98.9%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*98.9%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified98.9%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in x around inf 75.3%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -5.2e128 < x < 5.49999999999999981e102

    1. Initial program 96.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg96.8%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg96.8%

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*93.5%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in a around inf 45.1%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.2 \cdot 10^{+128} \lor \neg \left(x \leq 5.5 \cdot 10^{+102}\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 12: 47.7% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{+127} \lor \neg \left(x \leq 9 \cdot 10^{+108}\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= x -3.3e+127) (not (<= x 9e+108))) (* x 2.0) (* a (* 27.0 b))))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x <= -3.3e+127) || !(x <= 9e+108)) {
		tmp = x * 2.0;
	} else {
		tmp = a * (27.0 * b);
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if ((x <= (-3.3d+127)) .or. (.not. (x <= 9d+108))) then
        tmp = x * 2.0d0
    else
        tmp = a * (27.0d0 * b)
    end if
    code = tmp
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((x <= -3.3e+127) || !(x <= 9e+108)) {
		tmp = x * 2.0;
	} else {
		tmp = a * (27.0 * b);
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	tmp = 0
	if (x <= -3.3e+127) or not (x <= 9e+108):
		tmp = x * 2.0
	else:
		tmp = a * (27.0 * b)
	return tmp
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if ((x <= -3.3e+127) || !(x <= 9e+108))
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(a * Float64(27.0 * b));
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if ((x <= -3.3e+127) || ~((x <= 9e+108)))
		tmp = x * 2.0;
	else
		tmp = a * (27.0 * b);
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -3.3e+127], N[Not[LessEqual[x, 9e+108]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.3 \cdot 10^{+127} \lor \neg \left(x \leq 9 \cdot 10^{+108}\right):\\
\;\;\;\;x \cdot 2\\

\mathbf{else}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.29999999999999977e127 or 9e108 < x

    1. Initial program 98.9%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg98.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg98.9%

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*98.9%

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*98.9%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified98.9%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in x around inf 75.3%

      \[\leadsto \color{blue}{2 \cdot x} \]

    if -3.29999999999999977e127 < x < 9e108

    1. Initial program 96.8%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg96.8%

        \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
      2. sub-neg96.8%

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*93.5%

        \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    3. Simplified93.5%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Taylor expanded in a around inf 45.1%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. associate-*r*45.1%

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
      2. *-commutative45.1%

        \[\leadsto \color{blue}{\left(a \cdot 27\right)} \cdot b \]
      3. associate-*r*45.1%

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} \]
    6. Simplified45.1%

      \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification55.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.3 \cdot 10^{+127} \lor \neg \left(x \leq 9 \cdot 10^{+108}\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]

Alternative 13: 30.3% accurate, 5.7× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ x \cdot 2 \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b) :precision binary64 (* x 2.0))
assert(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    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
    code = x * 2.0d0
end function
assert y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	return x * 2.0
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	return Float64(x * 2.0)
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp = code(x, y, z, t, a, b)
	tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: a and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
x \cdot 2
\end{array}
Derivation
  1. Initial program 97.6%

    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  2. Step-by-step derivation
    1. sub-neg97.6%

      \[\leadsto \color{blue}{\left(x \cdot 2 + \left(-\left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)\right)} + \left(a \cdot 27\right) \cdot b \]
    2. sub-neg97.6%

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
    3. associate-*l*95.4%

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
    4. associate-*l*95.4%

      \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{a \cdot \left(27 \cdot b\right)} \]
  3. Simplified95.4%

    \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
  4. Taylor expanded in x around inf 36.4%

    \[\leadsto \color{blue}{2 \cdot x} \]
  5. Final simplification36.4%

    \[\leadsto x \cdot 2 \]

Developer target: 95.1% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (< y 7.590524218811189e-161)
   (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b)))
   (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    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) :: tmp
    if (y < 7.590524218811189d-161) then
        tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
    else
        tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y < 7.590524218811189e-161:
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b))
	else:
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y < 7.590524218811189e-161)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b)));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y < 7.590524218811189e-161)
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	else
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2023320 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, A"
  :precision binary64

  :herbie-target
  (if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))

  (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))