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

Percentage Accurate: 95.8% → 99.0%
Time: 13.1s
Alternatives: 14
Speedup: 0.8×

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 14 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.8% 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: 99.0% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y #s(literal 9 binary64)) < -1e16

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \color{blue}{\mathsf{fma}\left(x, 2, -\left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right)}\right) \]
      13. associate-*l*98.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, -\color{blue}{\left(y \cdot 9\right) \cdot \left(t \cdot z\right)}\right)\right) \]
      14. distribute-rgt-neg-in98.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \color{blue}{\left(y \cdot 9\right) \cdot \left(-t \cdot z\right)}\right)\right) \]
      15. *-commutative98.6%

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \color{blue}{\left(\left(-z \cdot t\right) \cdot 9\right)}\right)\right) \]
      18. distribute-lft-neg-in99.9%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \color{blue}{\left(-\left(z \cdot t\right) \cdot 9\right)}\right)\right) \]
      19. associate-*r*99.9%

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

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

    if -1e16 < (*.f64 y #s(literal 9 binary64))

    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. associate-+l-95.9%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*92.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 \]
      10. associate-*l*92.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. Simplified92.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg92.8%

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(\left(-y \cdot 9\right) \cdot z\right)} \cdot t\right) + a \cdot \left(27 \cdot b\right) \]
      5. distribute-rgt-neg-in96.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \cdot 9 \leq -1 \cdot 10^{+16}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 98.9% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 2 \cdot 10^{-60}:\\ \;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t 2e-60)
   (+ (+ (* (* z -9.0) (* y t)) (* x 2.0)) (* a (* 27.0 b)))
   (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= 2e-60) {
		tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + (a * (27.0 * b));
	} else {
		tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
	}
	return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= 2e-60)
		tmp = Float64(Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(x * 2.0)) + Float64(a * Float64(27.0 * b)));
	else
		tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0)))));
	end
	return tmp
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 2e-60], N[(N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2 \cdot 10^{-60}:\\
\;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + a \cdot \left(27 \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.9999999999999999e-60

    1. Initial program 92.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. associate-+l-92.8%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*94.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 \]
      10. 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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg95.4%

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

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

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

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

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

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

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

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

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

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

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

    if 1.9999999999999999e-60 < t

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right)} \]
      12. cancel-sign-sub-inv91.9%

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \color{blue}{\mathsf{fma}\left(x, 2, \left(-\left(y \cdot 9\right) \cdot t\right) \cdot z\right)}\right) \]
      14. distribute-lft-neg-in91.9%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \color{blue}{-\left(\left(y \cdot 9\right) \cdot t\right) \cdot z}\right)\right) \]
      15. distribute-rgt-neg-in91.9%

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \color{blue}{\left(t \cdot \left(y \cdot 9\right)\right)} \cdot \left(-z\right)\right)\right) \]
      17. associate-*r*98.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot \left(-z\right)\right)}\right)\right) \]
      18. associate-*l*98.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \color{blue}{\left(y \cdot \left(9 \cdot \left(-z\right)\right)\right)}\right)\right) \]
      19. neg-mul-198.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(9 \cdot \color{blue}{\left(-1 \cdot z\right)}\right)\right)\right)\right) \]
      20. associate-*r*98.6%

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(-9 \cdot z\right)\right)\right)\right)} \]
    4. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification97.9%

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

Alternative 3: 45.2% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{if}\;y \leq -1.02 \cdot 10^{+185}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+140}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+31}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -7000000:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-150}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, 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 (* -9.0 (* t (* y z)))))
   (if (<= y -1.02e+185)
     t_1
     (if (<= y -5.5e+140)
       (* 27.0 (* a b))
       (if (<= y -5.6e+101)
         t_1
         (if (<= y -2e+31)
           (* x 2.0)
           (if (<= y -7000000.0)
             (* b (* a 27.0))
             (if (<= y 1.25e-150) (* x 2.0) t_1))))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -9.0 * (t * (y * z));
	double tmp;
	if (y <= -1.02e+185) {
		tmp = t_1;
	} else if (y <= -5.5e+140) {
		tmp = 27.0 * (a * b);
	} else if (y <= -5.6e+101) {
		tmp = t_1;
	} else if (y <= -2e+31) {
		tmp = x * 2.0;
	} else if (y <= -7000000.0) {
		tmp = b * (a * 27.0);
	} else if (y <= 1.25e-150) {
		tmp = x * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, 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 = (-9.0d0) * (t * (y * z))
    if (y <= (-1.02d+185)) then
        tmp = t_1
    else if (y <= (-5.5d+140)) then
        tmp = 27.0d0 * (a * b)
    else if (y <= (-5.6d+101)) then
        tmp = t_1
    else if (y <= (-2d+31)) then
        tmp = x * 2.0d0
    else if (y <= (-7000000.0d0)) then
        tmp = b * (a * 27.0d0)
    else if (y <= 1.25d-150) then
        tmp = x * 2.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -9.0 * (t * (y * z));
	double tmp;
	if (y <= -1.02e+185) {
		tmp = t_1;
	} else if (y <= -5.5e+140) {
		tmp = 27.0 * (a * b);
	} else if (y <= -5.6e+101) {
		tmp = t_1;
	} else if (y <= -2e+31) {
		tmp = x * 2.0;
	} else if (y <= -7000000.0) {
		tmp = b * (a * 27.0);
	} else if (y <= 1.25e-150) {
		tmp = x * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	t_1 = -9.0 * (t * (y * z))
	tmp = 0
	if y <= -1.02e+185:
		tmp = t_1
	elif y <= -5.5e+140:
		tmp = 27.0 * (a * b)
	elif y <= -5.6e+101:
		tmp = t_1
	elif y <= -2e+31:
		tmp = x * 2.0
	elif y <= -7000000.0:
		tmp = b * (a * 27.0)
	elif y <= 1.25e-150:
		tmp = x * 2.0
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(-9.0 * Float64(t * Float64(y * z)))
	tmp = 0.0
	if (y <= -1.02e+185)
		tmp = t_1;
	elseif (y <= -5.5e+140)
		tmp = Float64(27.0 * Float64(a * b));
	elseif (y <= -5.6e+101)
		tmp = t_1;
	elseif (y <= -2e+31)
		tmp = Float64(x * 2.0);
	elseif (y <= -7000000.0)
		tmp = Float64(b * Float64(a * 27.0));
	elseif (y <= 1.25e-150)
		tmp = Float64(x * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = -9.0 * (t * (y * z));
	tmp = 0.0;
	if (y <= -1.02e+185)
		tmp = t_1;
	elseif (y <= -5.5e+140)
		tmp = 27.0 * (a * b);
	elseif (y <= -5.6e+101)
		tmp = t_1;
	elseif (y <= -2e+31)
		tmp = x * 2.0;
	elseif (y <= -7000000.0)
		tmp = b * (a * 27.0);
	elseif (y <= 1.25e-150)
		tmp = x * 2.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+185], t$95$1, If[LessEqual[y, -5.5e+140], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.6e+101], t$95$1, If[LessEqual[y, -2e+31], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -7000000.0], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-150], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -5.5 \cdot 10^{+140}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;y \leq -5.6 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -2 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;y \leq -7000000:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-150}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.0200000000000001e185 or -5.5e140 < y < -5.59999999999999962e101 or 1.24999999999999997e-150 < y

    1. Initial program 93.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. Step-by-step derivation
      1. associate-+l-93.4%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*96.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 \]
      10. associate-*l*96.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. Simplified96.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. Add Preprocessing
    5. Taylor expanded in y around inf 52.1%

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

    if -1.0200000000000001e185 < y < -5.5e140

    1. Initial program 99.5%

      \[\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. associate-+l-99.5%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*99.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 \]
      10. 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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg100.0%

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(\left(-y \cdot 9\right) \cdot z\right)} \cdot t\right) + a \cdot \left(27 \cdot b\right) \]
      5. distribute-rgt-neg-in100.0%

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

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

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

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

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

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

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

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

    if -5.59999999999999962e101 < y < -1.9999999999999999e31 or -7e6 < y < 1.24999999999999997e-150

    1. Initial program 97.2%

      \[\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. associate-+l-97.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*90.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 \]
      10. associate-*l*90.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. Simplified90.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. Add Preprocessing
    5. Taylor expanded in x around inf 47.4%

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

    if -1.9999999999999999e31 < y < -7e6

    1. Initial program 84.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. associate-+l-84.3%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*99.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 \]
      10. associate-*l*99.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. Simplified99.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    8. Step-by-step derivation
      1. *-commutative83.3%

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

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

        \[\leadsto \color{blue}{b \cdot \left(a \cdot 27\right)} \]
      4. *-commutative83.0%

        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} \]
    9. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.02 \cdot 10^{+185}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;y \leq -5.5 \cdot 10^{+140}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq -5.6 \cdot 10^{+101}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;y \leq -2 \cdot 10^{+31}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -7000000:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-150}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 46.3% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{if}\;y \leq -2.7 \cdot 10^{+184}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{+140}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{+101}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{+31}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -9000000:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-150}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, 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 (* -9.0 (* t (* y z)))))
   (if (<= y -2.7e+184)
     (* -9.0 (* y (* z t)))
     (if (<= y -5.2e+140)
       (* 27.0 (* a b))
       (if (<= y -4.6e+101)
         t_1
         (if (<= y -3.2e+31)
           (* x 2.0)
           (if (<= y -9000000.0)
             (* b (* a 27.0))
             (if (<= y 1.25e-150) (* x 2.0) t_1))))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -9.0 * (t * (y * z));
	double tmp;
	if (y <= -2.7e+184) {
		tmp = -9.0 * (y * (z * t));
	} else if (y <= -5.2e+140) {
		tmp = 27.0 * (a * b);
	} else if (y <= -4.6e+101) {
		tmp = t_1;
	} else if (y <= -3.2e+31) {
		tmp = x * 2.0;
	} else if (y <= -9000000.0) {
		tmp = b * (a * 27.0);
	} else if (y <= 1.25e-150) {
		tmp = x * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, 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 = (-9.0d0) * (t * (y * z))
    if (y <= (-2.7d+184)) then
        tmp = (-9.0d0) * (y * (z * t))
    else if (y <= (-5.2d+140)) then
        tmp = 27.0d0 * (a * b)
    else if (y <= (-4.6d+101)) then
        tmp = t_1
    else if (y <= (-3.2d+31)) then
        tmp = x * 2.0d0
    else if (y <= (-9000000.0d0)) then
        tmp = b * (a * 27.0d0)
    else if (y <= 1.25d-150) then
        tmp = x * 2.0d0
    else
        tmp = t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = -9.0 * (t * (y * z));
	double tmp;
	if (y <= -2.7e+184) {
		tmp = -9.0 * (y * (z * t));
	} else if (y <= -5.2e+140) {
		tmp = 27.0 * (a * b);
	} else if (y <= -4.6e+101) {
		tmp = t_1;
	} else if (y <= -3.2e+31) {
		tmp = x * 2.0;
	} else if (y <= -9000000.0) {
		tmp = b * (a * 27.0);
	} else if (y <= 1.25e-150) {
		tmp = x * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	t_1 = -9.0 * (t * (y * z))
	tmp = 0
	if y <= -2.7e+184:
		tmp = -9.0 * (y * (z * t))
	elif y <= -5.2e+140:
		tmp = 27.0 * (a * b)
	elif y <= -4.6e+101:
		tmp = t_1
	elif y <= -3.2e+31:
		tmp = x * 2.0
	elif y <= -9000000.0:
		tmp = b * (a * 27.0)
	elif y <= 1.25e-150:
		tmp = x * 2.0
	else:
		tmp = t_1
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(-9.0 * Float64(t * Float64(y * z)))
	tmp = 0.0
	if (y <= -2.7e+184)
		tmp = Float64(-9.0 * Float64(y * Float64(z * t)));
	elseif (y <= -5.2e+140)
		tmp = Float64(27.0 * Float64(a * b));
	elseif (y <= -4.6e+101)
		tmp = t_1;
	elseif (y <= -3.2e+31)
		tmp = Float64(x * 2.0);
	elseif (y <= -9000000.0)
		tmp = Float64(b * Float64(a * 27.0));
	elseif (y <= 1.25e-150)
		tmp = Float64(x * 2.0);
	else
		tmp = t_1;
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = -9.0 * (t * (y * z));
	tmp = 0.0;
	if (y <= -2.7e+184)
		tmp = -9.0 * (y * (z * t));
	elseif (y <= -5.2e+140)
		tmp = 27.0 * (a * b);
	elseif (y <= -4.6e+101)
		tmp = t_1;
	elseif (y <= -3.2e+31)
		tmp = x * 2.0;
	elseif (y <= -9000000.0)
		tmp = b * (a * 27.0);
	elseif (y <= 1.25e-150)
		tmp = x * 2.0;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(-9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e+184], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -5.2e+140], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -4.6e+101], t$95$1, If[LessEqual[y, -3.2e+31], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -9000000.0], N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.25e-150], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{+184}:\\
\;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

\mathbf{elif}\;y \leq -5.2 \cdot 10^{+140}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;y \leq -4.6 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;y \leq -3.2 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;y \leq -9000000:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

\mathbf{elif}\;y \leq 1.25 \cdot 10^{-150}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if y < -2.6999999999999999e184

    1. Initial program 92.2%

      \[\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. associate-+l-92.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*97.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 \]
      10. associate-*l*97.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. Simplified97.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. Add Preprocessing
    5. Taylor expanded in y around inf 70.8%

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

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

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

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

        \[\leadsto -9 \cdot {\color{blue}{\left(z \cdot \left(y \cdot t\right)\right)}}^{1} \]
    7. Applied egg-rr73.2%

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

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

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

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

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

    if -2.6999999999999999e184 < y < -5.2000000000000002e140

    1. Initial program 99.5%

      \[\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. associate-+l-99.5%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*99.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 \]
      10. 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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg100.0%

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(\left(-y \cdot 9\right) \cdot z\right)} \cdot t\right) + a \cdot \left(27 \cdot b\right) \]
      5. distribute-rgt-neg-in100.0%

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

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

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

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

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

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

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

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

    if -5.2000000000000002e140 < y < -4.6000000000000003e101 or 1.24999999999999997e-150 < y

    1. Initial program 93.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. associate-+l-93.7%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*96.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 \]
      10. associate-*l*96.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. Simplified96.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. Add Preprocessing
    5. Taylor expanded in y around inf 45.8%

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

    if -4.6000000000000003e101 < y < -3.2000000000000001e31 or -9e6 < y < 1.24999999999999997e-150

    1. Initial program 97.2%

      \[\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. associate-+l-97.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*90.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 \]
      10. associate-*l*90.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. Simplified90.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. Add Preprocessing
    5. Taylor expanded in x around inf 47.4%

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

    if -3.2000000000000001e31 < y < -9e6

    1. Initial program 84.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. associate-+l-84.3%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*99.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 \]
      10. associate-*l*99.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. Simplified99.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    8. Step-by-step derivation
      1. *-commutative83.3%

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

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

        \[\leadsto \color{blue}{b \cdot \left(a \cdot 27\right)} \]
      4. *-commutative83.0%

        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} \]
    9. Simplified83.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -2.7 \cdot 10^{+184}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -5.2 \cdot 10^{+140}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq -4.6 \cdot 10^{+101}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;y \leq -3.2 \cdot 10^{+31}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -9000000:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;y \leq 1.25 \cdot 10^{-150}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 46.3% accurate, 0.5× speedup?

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

\mathbf{elif}\;y \leq -2.3 \cdot 10^{+140}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;y \leq -2.9 \cdot 10^{+102}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\

\mathbf{elif}\;y \leq -6 \cdot 10^{+31}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;y \leq -6500000:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-150}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if y < -1.29999999999999997e184

    1. Initial program 92.2%

      \[\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. associate-+l-92.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*97.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 \]
      10. associate-*l*97.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. Simplified97.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. Add Preprocessing
    5. Taylor expanded in y around inf 70.8%

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

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

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

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

        \[\leadsto -9 \cdot {\color{blue}{\left(z \cdot \left(y \cdot t\right)\right)}}^{1} \]
    7. Applied egg-rr73.2%

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

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

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

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

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

    if -1.29999999999999997e184 < y < -2.2999999999999999e140

    1. Initial program 99.5%

      \[\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. associate-+l-99.5%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*99.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 \]
      10. 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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg100.0%

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(\left(-y \cdot 9\right) \cdot z\right)} \cdot t\right) + a \cdot \left(27 \cdot b\right) \]
      5. distribute-rgt-neg-in100.0%

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

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

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

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

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

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

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

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

    if -2.2999999999999999e140 < y < -2.9000000000000002e102

    1. Initial program 87.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. associate-+l-87.3%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*100.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 \]
      10. 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. Add Preprocessing
    5. Taylor expanded in y around inf 62.9%

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

    if -2.9000000000000002e102 < y < -5.99999999999999978e31 or -6.5e6 < y < 1.2e-150

    1. Initial program 97.2%

      \[\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. associate-+l-97.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*90.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 \]
      10. associate-*l*90.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. Simplified90.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. Add Preprocessing
    5. Taylor expanded in x around inf 47.4%

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

    if -5.99999999999999978e31 < y < -6.5e6

    1. Initial program 84.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. associate-+l-84.3%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*99.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 \]
      10. associate-*l*99.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. Simplified99.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg99.7%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    8. Step-by-step derivation
      1. *-commutative83.3%

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

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

        \[\leadsto \color{blue}{b \cdot \left(a \cdot 27\right)} \]
      4. *-commutative83.0%

        \[\leadsto b \cdot \color{blue}{\left(27 \cdot a\right)} \]
    9. Simplified83.0%

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

    if 1.2e-150 < y

    1. Initial program 94.2%

      \[\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. associate-+l-94.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*96.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 \]
      10. associate-*l*96.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. Simplified96.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. Add Preprocessing
    5. Taylor expanded in x around 0 68.3%

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

      \[\leadsto \color{blue}{y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(t \cdot z\right)\right)} \]
    7. Taylor expanded in y around inf 44.4%

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot {\left(\color{blue}{\left(z \cdot -9\right)} \cdot y\right)}^{1} \]
      5. associate-*l*44.4%

        \[\leadsto t \cdot {\color{blue}{\left(z \cdot \left(-9 \cdot y\right)\right)}}^{1} \]
    11. Applied egg-rr44.4%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.3 \cdot 10^{+184}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -2.3 \cdot 10^{+140}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq -2.9 \cdot 10^{+102}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;y \leq -6 \cdot 10^{+31}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -6500000:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-150}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 78.4% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(a \cdot b\right)\\ t_2 := x \cdot 2 + t\_1\\ \mathbf{if}\;y \leq -5.8 \cdot 10^{+177}:\\ \;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{+147}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{+83}:\\ \;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-150}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, 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 (+ (* x 2.0) t_1)))
   (if (<= y -5.8e+177)
     (* y (- (* 27.0 (/ (* a b) y)) (* 9.0 (* z t))))
     (if (<= y -1.55e+147)
       t_2
       (if (<= y -3.4e+83)
         (- t_1 (* 9.0 (* t (* y z))))
         (if (<= y 1.2e-150)
           t_2
           (+ (* (* z -9.0) (* y t)) (* b (* a 27.0)))))))))
assert(x < y && y < z && z < t && t < a && 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 = (x * 2.0) + t_1;
	double tmp;
	if (y <= -5.8e+177) {
		tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
	} else if (y <= -1.55e+147) {
		tmp = t_2;
	} else if (y <= -3.4e+83) {
		tmp = t_1 - (9.0 * (t * (y * z)));
	} else if (y <= 1.2e-150) {
		tmp = t_2;
	} else {
		tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.0));
	}
	return tmp;
}
NOTE: x, y, z, t, 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 = 27.0d0 * (a * b)
    t_2 = (x * 2.0d0) + t_1
    if (y <= (-5.8d+177)) then
        tmp = y * ((27.0d0 * ((a * b) / y)) - (9.0d0 * (z * t)))
    else if (y <= (-1.55d+147)) then
        tmp = t_2
    else if (y <= (-3.4d+83)) then
        tmp = t_1 - (9.0d0 * (t * (y * z)))
    else if (y <= 1.2d-150) then
        tmp = t_2
    else
        tmp = ((z * (-9.0d0)) * (y * t)) + (b * (a * 27.0d0))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && 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 = (x * 2.0) + t_1;
	double tmp;
	if (y <= -5.8e+177) {
		tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
	} else if (y <= -1.55e+147) {
		tmp = t_2;
	} else if (y <= -3.4e+83) {
		tmp = t_1 - (9.0 * (t * (y * z)));
	} else if (y <= 1.2e-150) {
		tmp = t_2;
	} else {
		tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.0));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	t_1 = 27.0 * (a * b)
	t_2 = (x * 2.0) + t_1
	tmp = 0
	if y <= -5.8e+177:
		tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)))
	elif y <= -1.55e+147:
		tmp = t_2
	elif y <= -3.4e+83:
		tmp = t_1 - (9.0 * (t * (y * z)))
	elif y <= 1.2e-150:
		tmp = t_2
	else:
		tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.0))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(27.0 * Float64(a * b))
	t_2 = Float64(Float64(x * 2.0) + t_1)
	tmp = 0.0
	if (y <= -5.8e+177)
		tmp = Float64(y * Float64(Float64(27.0 * Float64(Float64(a * b) / y)) - Float64(9.0 * Float64(z * t))));
	elseif (y <= -1.55e+147)
		tmp = t_2;
	elseif (y <= -3.4e+83)
		tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z))));
	elseif (y <= 1.2e-150)
		tmp = t_2;
	else
		tmp = Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(b * Float64(a * 27.0)));
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = 27.0 * (a * b);
	t_2 = (x * 2.0) + t_1;
	tmp = 0.0;
	if (y <= -5.8e+177)
		tmp = y * ((27.0 * ((a * b) / y)) - (9.0 * (z * t)));
	elseif (y <= -1.55e+147)
		tmp = t_2;
	elseif (y <= -3.4e+83)
		tmp = t_1 - (9.0 * (t * (y * z)));
	elseif (y <= 1.2e-150)
		tmp = t_2;
	else
		tmp = ((z * -9.0) * (y * t)) + (b * (a * 27.0));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[y, -5.8e+177], N[(y * N[(N[(27.0 * N[(N[(a * b), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] - N[(9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.55e+147], t$95$2, If[LessEqual[y, -3.4e+83], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e-150], t$95$2, N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := x \cdot 2 + t\_1\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+177}:\\
\;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(z \cdot t\right)\right)\\

\mathbf{elif}\;y \leq -1.55 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;y \leq -3.4 \cdot 10^{+83}:\\
\;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\

\mathbf{elif}\;y \leq 1.2 \cdot 10^{-150}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -5.80000000000000027e177

    1. Initial program 92.2%

      \[\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. associate-+l-92.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*97.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 \]
      10. associate-*l*97.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. Simplified97.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. Add Preprocessing
    5. Taylor expanded in x around 0 84.1%

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

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

    if -5.80000000000000027e177 < y < -1.55e147 or -3.3999999999999998e83 < y < 1.2e-150

    1. Initial program 96.5%

      \[\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. associate-+l-96.5%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*90.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 \]
      10. associate-*l*91.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in y around 0 83.8%

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

    if -1.55e147 < y < -3.3999999999999998e83

    1. Initial program 89.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. associate-+l-89.7%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. 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 \]
      10. 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. Add Preprocessing
    5. 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)} \]

    if 1.2e-150 < y

    1. Initial program 94.2%

      \[\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. associate-+l-94.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*96.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 \]
      10. associate-*l*96.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. Simplified96.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. Add Preprocessing
    5. Taylor expanded in x around 0 68.3%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv68.3%

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.8 \cdot 10^{+177}:\\ \;\;\;\;y \cdot \left(27 \cdot \frac{a \cdot b}{y} - 9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;y \leq -1.55 \cdot 10^{+147}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq -3.4 \cdot 10^{+83}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;y \leq 1.2 \cdot 10^{-150}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 98.4% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := a \cdot \left(27 \cdot b\right)\\ \mathbf{if}\;y \cdot 9 \leq -1 \cdot 10^{+16}:\\ \;\;\;\;t\_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(z \cdot -9\right) \cdot \left(y \cdot t\right) + x \cdot 2\right) + t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, 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 (<= (* y 9.0) -1e+16)
     (+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
     (+ (+ (* (* z -9.0) (* y t)) (* x 2.0)) t_1))))
assert(x < y && y < z && z < t && t < a && 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 ((y * 9.0) <= -1e+16) {
		tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
	} else {
		tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + t_1;
	}
	return tmp;
}
NOTE: x, y, z, t, 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 ((y * 9.0d0) <= (-1d+16)) then
        tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
    else
        tmp = (((z * (-9.0d0)) * (y * t)) + (x * 2.0d0)) + t_1
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && 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 ((y * 9.0) <= -1e+16) {
		tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
	} else {
		tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + t_1;
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	t_1 = a * (27.0 * b)
	tmp = 0
	if (y * 9.0) <= -1e+16:
		tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)))
	else:
		tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + t_1
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(a * Float64(27.0 * b))
	tmp = 0.0
	if (Float64(y * 9.0) <= -1e+16)
		tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))));
	else
		tmp = Float64(Float64(Float64(Float64(z * -9.0) * Float64(y * t)) + Float64(x * 2.0)) + t_1);
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = a * (27.0 * b);
	tmp = 0.0;
	if ((y * 9.0) <= -1e+16)
		tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
	else
		tmp = (((z * -9.0) * (y * t)) + (x * 2.0)) + t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, 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[N[(y * 9.0), $MachinePrecision], -1e+16], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;y \cdot 9 \leq -1 \cdot 10^{+16}:\\
\;\;\;\;t\_1 + \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 y #s(literal 9 binary64)) < -1e16

    1. Initial program 91.5%

      \[\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. associate-+l-91.5%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*98.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 \]
      10. associate-*l*98.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. Simplified98.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. Add Preprocessing

    if -1e16 < (*.f64 y #s(literal 9 binary64))

    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. associate-+l-95.9%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*92.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 \]
      10. associate-*l*92.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. Simplified92.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg92.8%

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

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

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

        \[\leadsto \left(x \cdot 2 + \color{blue}{\left(\left(-y \cdot 9\right) \cdot z\right)} \cdot t\right) + a \cdot \left(27 \cdot b\right) \]
      5. distribute-rgt-neg-in96.4%

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

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

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

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

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

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

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

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

Alternative 8: 80.8% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -3.3e-10 or 7.6e9 < z

    1. Initial program 92.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. associate-+l-92.3%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*91.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 \]
      10. associate-*l*91.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in x around 0 73.8%

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)} \]
    6. Step-by-step derivation
      1. cancel-sign-sub-inv73.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.3e-10 < z < 7.6e9

    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. associate-+l-97.6%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*97.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 \]
      10. associate-*l*98.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. Simplified98.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. Add Preprocessing
    5. Taylor expanded in y around 0 80.4%

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

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

Alternative 9: 78.4% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;x \leq -2.25 \cdot 10^{+157} \lor \neg \left(x \leq 2.3 \cdot 10^{+15}\right):\\ \;\;\;\;x \cdot 2 + t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_1 - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, 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))))
   (if (or (<= x -2.25e+157) (not (<= x 2.3e+15)))
     (+ (* x 2.0) t_1)
     (- t_1 (* 9.0 (* t (* y z)))))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 27.0 * (a * b);
	double tmp;
	if ((x <= -2.25e+157) || !(x <= 2.3e+15)) {
		tmp = (x * 2.0) + t_1;
	} else {
		tmp = t_1 - (9.0 * (t * (y * z)));
	}
	return tmp;
}
NOTE: x, y, z, t, 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 = 27.0d0 * (a * b)
    if ((x <= (-2.25d+157)) .or. (.not. (x <= 2.3d+15))) then
        tmp = (x * 2.0d0) + t_1
    else
        tmp = t_1 - (9.0d0 * (t * (y * z)))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && 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 tmp;
	if ((x <= -2.25e+157) || !(x <= 2.3e+15)) {
		tmp = (x * 2.0) + t_1;
	} else {
		tmp = t_1 - (9.0 * (t * (y * z)));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	t_1 = 27.0 * (a * b)
	tmp = 0
	if (x <= -2.25e+157) or not (x <= 2.3e+15):
		tmp = (x * 2.0) + t_1
	else:
		tmp = t_1 - (9.0 * (t * (y * z)))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(27.0 * Float64(a * b))
	tmp = 0.0
	if ((x <= -2.25e+157) || !(x <= 2.3e+15))
		tmp = Float64(Float64(x * 2.0) + t_1);
	else
		tmp = Float64(t_1 - Float64(9.0 * Float64(t * Float64(y * z))));
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = 27.0 * (a * b);
	tmp = 0.0;
	if ((x <= -2.25e+157) || ~((x <= 2.3e+15)))
		tmp = (x * 2.0) + t_1;
	else
		tmp = t_1 - (9.0 * (t * (y * z)));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, 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]}, If[Or[LessEqual[x, -2.25e+157], N[Not[LessEqual[x, 2.3e+15]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - N[(9.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -2.25 \cdot 10^{+157} \lor \neg \left(x \leq 2.3 \cdot 10^{+15}\right):\\
\;\;\;\;x \cdot 2 + t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.24999999999999992e157 or 2.3e15 < x

    1. Initial program 90.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. Step-by-step derivation
      1. associate-+l-90.4%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*97.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 \]
      10. associate-*l*98.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. Simplified98.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. Add Preprocessing
    5. Taylor expanded in y around 0 78.6%

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

    if -2.24999999999999992e157 < x < 2.3e15

    1. Initial program 97.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. Step-by-step derivation
      1. associate-+l-97.4%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*92.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 \]
      10. associate-*l*92.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. Simplified92.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. Add Preprocessing
    5. Taylor expanded in x around 0 84.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.25 \cdot 10^{+157} \lor \neg \left(x \leq 2.3 \cdot 10^{+15}\right):\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 92.9% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.4999999999999996e249

    1. Initial program 81.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. associate-+l-81.6%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*93.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 \]
      10. associate-*l*93.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. Simplified93.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. Add Preprocessing
    5. Taylor expanded in x around 0 87.6%

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

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

    if -4.4999999999999996e249 < y

    1. Initial program 95.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. associate-+l-95.6%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. 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 \]
      10. 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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg94.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 98.3% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 7.0000000000000002e33

    1. Initial program 93.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. associate-+l-93.1%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*95.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 \]
      10. associate-*l*95.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. Simplified95.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg95.9%

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

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

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

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

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

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

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

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

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

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

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

    if 7.0000000000000002e33 < t

    1. Initial program 99.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. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification97.9%

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

Alternative 12: 74.2% accurate, 0.9× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -3.8000000000000002e75

    1. Initial program 91.5%

      \[\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. associate-+l-91.5%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*84.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 \]
      10. associate-*l*84.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. Simplified84.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. Add Preprocessing
    5. Taylor expanded in x around 0 75.7%

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

      \[\leadsto \color{blue}{z \cdot \left(27 \cdot \frac{a \cdot b}{z} - 9 \cdot \left(t \cdot y\right)\right)} \]
    7. Taylor expanded in a around 0 65.6%

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

    if -3.8000000000000002e75 < z < 5.9999999999999996e102

    1. Initial program 98.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. associate-+l-98.1%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*98.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 \]
      10. associate-*l*98.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. Simplified98.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. Add Preprocessing
    5. Taylor expanded in y around 0 77.7%

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

    if 5.9999999999999996e102 < z

    1. Initial program 87.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. associate-+l-87.1%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*91.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 \]
      10. associate-*l*91.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. Simplified91.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. Add Preprocessing
    5. Taylor expanded in y around inf 54.0%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.8 \cdot 10^{+75}:\\ \;\;\;\;z \cdot \left(-9 \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 6 \cdot 10^{+102}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 46.1% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -1.2e104 or 3.80000000000000002e-72 < a

    1. Initial program 98.2%

      \[\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. associate-+l-98.2%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. 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 \]
      10. associate-*l*95.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. Simplified95.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. Add Preprocessing
    5. Step-by-step derivation
      1. sub-neg95.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e104 < a < 3.80000000000000002e-72

    1. Initial program 91.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. associate-+l-91.8%

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

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

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

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

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      9. associate-*l*93.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 \]
      10. associate-*l*93.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. Simplified93.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. Add Preprocessing
    5. Taylor expanded in x around inf 49.2%

      \[\leadsto \color{blue}{2 \cdot x} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification53.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1.2 \cdot 10^{+104} \lor \neg \left(a \leq 3.8 \cdot 10^{-72}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 14: 31.0% accurate, 5.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ x \cdot 2 \end{array} \]
NOTE: x, y, z, t, 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(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
NOTE: x, y, z, t, 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 x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	return x * 2.0
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	return Float64(x * 2.0)
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
	tmp = x * 2.0;
end
NOTE: x, y, z, t, 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}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Derivation
  1. Initial program 94.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. associate-+l-94.8%

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

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(\left(y \cdot 9\right) \cdot z\right)} \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    9. 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 \]
    10. 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. Add Preprocessing
  5. Taylor expanded in x around inf 32.9%

    \[\leadsto \color{blue}{2 \cdot x} \]
  6. Final simplification32.9%

    \[\leadsto x \cdot 2 \]
  7. Add Preprocessing

Developer target: 95.4% accurate, 0.8× 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 2024077 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, A"
  :precision binary64

  :alt
  (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)))