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

Percentage Accurate: 95.5% → 98.4%
Time: 15.0s
Alternatives: 13
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 13 alternatives:

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

Initial Program: 95.5% 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: 98.4% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;y \cdot 9 \leq -200000000:\\ \;\;\;\;\left(27 \cdot \left(b \cdot a\right) + x \cdot 2\right) - y \cdot \left(\left(9 \cdot z\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(27 \cdot a, b, \mathsf{fma}\left(x, 2, \left(z \cdot -9\right) \cdot \left(y \cdot t\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.
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) -200000000.0)
   (- (+ (* 27.0 (* b a)) (* x 2.0)) (* y (* (* 9.0 z) t)))
   (fma (* 27.0 a) b (fma x 2.0 (* (* z -9.0) (* y t))))))
assert(x < y && y < z && z < t && t < a && 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 ((y * 9.0) <= -200000000.0) {
		tmp = ((27.0 * (b * a)) + (x * 2.0)) - (y * ((9.0 * z) * t));
	} else {
		tmp = fma((27.0 * a), b, fma(x, 2.0, ((z * -9.0) * (y * t))));
	}
	return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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) <= -200000000.0)
		tmp = Float64(Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0)) - Float64(y * Float64(Float64(9.0 * z) * t)));
	else
		tmp = fma(Float64(27.0 * a), b, fma(x, 2.0, Float64(Float64(z * -9.0) * Float64(y * t))));
	end
	return tmp
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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], -200000000.0], N[(N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(9.0 * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(27.0 * a), $MachinePrecision] * b + N[(x * 2.0 + N[(N[(z * -9.0), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \cdot 9 \leq -200000000:\\
\;\;\;\;\left(27 \cdot \left(b \cdot a\right) + x \cdot 2\right) - y \cdot \left(\left(9 \cdot z\right) \cdot t\right)\\

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


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

    1. Initial program 90.1%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*99.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. Simplified99.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. +-commutative99.8%

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

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

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

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

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

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

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

    if -2e8 < (*.f64 y 9)

    1. Initial program 93.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. sub-neg93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 49.7% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;z \leq -1.85 \cdot 10^{+74}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-199}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-235}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-295}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-263}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-64}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;z \leq 3.6:\\ \;\;\;\;x \cdot 2\\ \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.
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 (* b a))))
   (if (<= z -1.85e+74)
     (* -9.0 (* z (* y t)))
     (if (<= z -1.05e-199)
       t_1
       (if (<= z -3.9e-235)
         (* x 2.0)
         (if (<= z -1.45e-295)
           t_1
           (if (<= z 4.7e-263)
             (* x 2.0)
             (if (<= z 7e-64)
               (* a (* 27.0 b))
               (if (<= z 3.6) (* x 2.0) (* -9.0 (* t (* y z))))))))))))
assert(x < y && y < z && z < t && t < a && 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 t_1 = 27.0 * (b * a);
	double tmp;
	if (z <= -1.85e+74) {
		tmp = -9.0 * (z * (y * t));
	} else if (z <= -1.05e-199) {
		tmp = t_1;
	} else if (z <= -3.9e-235) {
		tmp = x * 2.0;
	} else if (z <= -1.45e-295) {
		tmp = t_1;
	} else if (z <= 4.7e-263) {
		tmp = x * 2.0;
	} else if (z <= 7e-64) {
		tmp = a * (27.0 * b);
	} else if (z <= 3.6) {
		tmp = x * 2.0;
	} 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.
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 * (b * a)
    if (z <= (-1.85d+74)) then
        tmp = (-9.0d0) * (z * (y * t))
    else if (z <= (-1.05d-199)) then
        tmp = t_1
    else if (z <= (-3.9d-235)) then
        tmp = x * 2.0d0
    else if (z <= (-1.45d-295)) then
        tmp = t_1
    else if (z <= 4.7d-263) then
        tmp = x * 2.0d0
    else if (z <= 7d-64) then
        tmp = a * (27.0d0 * b)
    else if (z <= 3.6d0) then
        tmp = x * 2.0d0
    else
        tmp = (-9.0d0) * (t * (y * z))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 * (b * a);
	double tmp;
	if (z <= -1.85e+74) {
		tmp = -9.0 * (z * (y * t));
	} else if (z <= -1.05e-199) {
		tmp = t_1;
	} else if (z <= -3.9e-235) {
		tmp = x * 2.0;
	} else if (z <= -1.45e-295) {
		tmp = t_1;
	} else if (z <= 4.7e-263) {
		tmp = x * 2.0;
	} else if (z <= 7e-64) {
		tmp = a * (27.0 * b);
	} else if (z <= 3.6) {
		tmp = x * 2.0;
	} else {
		tmp = -9.0 * (t * (y * z));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 * (b * a)
	tmp = 0
	if z <= -1.85e+74:
		tmp = -9.0 * (z * (y * t))
	elif z <= -1.05e-199:
		tmp = t_1
	elif z <= -3.9e-235:
		tmp = x * 2.0
	elif z <= -1.45e-295:
		tmp = t_1
	elif z <= 4.7e-263:
		tmp = x * 2.0
	elif z <= 7e-64:
		tmp = a * (27.0 * b)
	elif z <= 3.6:
		tmp = x * 2.0
	else:
		tmp = -9.0 * (t * (y * z))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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(b * a))
	tmp = 0.0
	if (z <= -1.85e+74)
		tmp = Float64(-9.0 * Float64(z * Float64(y * t)));
	elseif (z <= -1.05e-199)
		tmp = t_1;
	elseif (z <= -3.9e-235)
		tmp = Float64(x * 2.0);
	elseif (z <= -1.45e-295)
		tmp = t_1;
	elseif (z <= 4.7e-263)
		tmp = Float64(x * 2.0);
	elseif (z <= 7e-64)
		tmp = Float64(a * Float64(27.0 * b));
	elseif (z <= 3.6)
		tmp = Float64(x * 2.0);
	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])){:}
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 * (b * a);
	tmp = 0.0;
	if (z <= -1.85e+74)
		tmp = -9.0 * (z * (y * t));
	elseif (z <= -1.05e-199)
		tmp = t_1;
	elseif (z <= -3.9e-235)
		tmp = x * 2.0;
	elseif (z <= -1.45e-295)
		tmp = t_1;
	elseif (z <= 4.7e-263)
		tmp = x * 2.0;
	elseif (z <= 7e-64)
		tmp = a * (27.0 * b);
	elseif (z <= 3.6)
		tmp = x * 2.0;
	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.
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[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.85e+74], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.05e-199], t$95$1, If[LessEqual[z, -3.9e-235], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.45e-295], t$95$1, If[LessEqual[z, 4.7e-263], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 7e-64], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6], N[(x * 2.0), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;z \leq -1.85 \cdot 10^{+74}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\

\mathbf{elif}\;z \leq -1.05 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.9 \cdot 10^{-235}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq -1.45 \cdot 10^{-295}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 4.7 \cdot 10^{-263}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq 7 \cdot 10^{-64}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

\mathbf{elif}\;z \leq 3.6:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -1.8500000000000001e74

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.8500000000000001e74 < z < -1.05000000000000001e-199 or -3.8999999999999997e-235 < z < -1.45000000000000008e-295

    1. Initial program 95.8%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*98.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. Simplified98.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. Step-by-step derivation
      1. +-commutative98.3%

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

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

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

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

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

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

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

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

    if -1.05000000000000001e-199 < z < -3.8999999999999997e-235 or -1.45000000000000008e-295 < z < 4.6999999999999997e-263 or 7.0000000000000006e-64 < z < 3.60000000000000009

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*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 \]
      4. associate-*l*99.9%

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

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

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

    if 4.6999999999999997e-263 < z < 7.0000000000000006e-64

    1. Initial program 96.8%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*96.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. Simplified96.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. +-commutative96.9%

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

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

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

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

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

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

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

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

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

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

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

    if 3.60000000000000009 < z

    1. Initial program 87.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.85 \cdot 10^{+74}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -1.05 \cdot 10^{-199}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;z \leq -3.9 \cdot 10^{-235}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -1.45 \cdot 10^{-295}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;z \leq 4.7 \cdot 10^{-263}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-64}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;z \leq 3.6:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 51.1% accurate, 0.4× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;z \leq -2.1 \cdot 10^{-70}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-199}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-235}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-295}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 10^{-263}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;z \leq 112000000:\\ \;\;\;\;x \cdot 2\\ \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.
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 (* b a))))
   (if (<= z -2.1e-70)
     (* y (* -9.0 (* z t)))
     (if (<= z -2.5e-199)
       t_1
       (if (<= z -3.5e-235)
         (* x 2.0)
         (if (<= z -1.5e-295)
           t_1
           (if (<= z 1e-263)
             (* x 2.0)
             (if (<= z 2.75e-58)
               (* a (* 27.0 b))
               (if (<= z 112000000.0) (* x 2.0) (* -9.0 (* t (* y z))))))))))))
assert(x < y && y < z && z < t && t < a && 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 t_1 = 27.0 * (b * a);
	double tmp;
	if (z <= -2.1e-70) {
		tmp = y * (-9.0 * (z * t));
	} else if (z <= -2.5e-199) {
		tmp = t_1;
	} else if (z <= -3.5e-235) {
		tmp = x * 2.0;
	} else if (z <= -1.5e-295) {
		tmp = t_1;
	} else if (z <= 1e-263) {
		tmp = x * 2.0;
	} else if (z <= 2.75e-58) {
		tmp = a * (27.0 * b);
	} else if (z <= 112000000.0) {
		tmp = x * 2.0;
	} 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.
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 * (b * a)
    if (z <= (-2.1d-70)) then
        tmp = y * ((-9.0d0) * (z * t))
    else if (z <= (-2.5d-199)) then
        tmp = t_1
    else if (z <= (-3.5d-235)) then
        tmp = x * 2.0d0
    else if (z <= (-1.5d-295)) then
        tmp = t_1
    else if (z <= 1d-263) then
        tmp = x * 2.0d0
    else if (z <= 2.75d-58) then
        tmp = a * (27.0d0 * b)
    else if (z <= 112000000.0d0) then
        tmp = x * 2.0d0
    else
        tmp = (-9.0d0) * (t * (y * z))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 * (b * a);
	double tmp;
	if (z <= -2.1e-70) {
		tmp = y * (-9.0 * (z * t));
	} else if (z <= -2.5e-199) {
		tmp = t_1;
	} else if (z <= -3.5e-235) {
		tmp = x * 2.0;
	} else if (z <= -1.5e-295) {
		tmp = t_1;
	} else if (z <= 1e-263) {
		tmp = x * 2.0;
	} else if (z <= 2.75e-58) {
		tmp = a * (27.0 * b);
	} else if (z <= 112000000.0) {
		tmp = x * 2.0;
	} else {
		tmp = -9.0 * (t * (y * z));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 * (b * a)
	tmp = 0
	if z <= -2.1e-70:
		tmp = y * (-9.0 * (z * t))
	elif z <= -2.5e-199:
		tmp = t_1
	elif z <= -3.5e-235:
		tmp = x * 2.0
	elif z <= -1.5e-295:
		tmp = t_1
	elif z <= 1e-263:
		tmp = x * 2.0
	elif z <= 2.75e-58:
		tmp = a * (27.0 * b)
	elif z <= 112000000.0:
		tmp = x * 2.0
	else:
		tmp = -9.0 * (t * (y * z))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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(b * a))
	tmp = 0.0
	if (z <= -2.1e-70)
		tmp = Float64(y * Float64(-9.0 * Float64(z * t)));
	elseif (z <= -2.5e-199)
		tmp = t_1;
	elseif (z <= -3.5e-235)
		tmp = Float64(x * 2.0);
	elseif (z <= -1.5e-295)
		tmp = t_1;
	elseif (z <= 1e-263)
		tmp = Float64(x * 2.0);
	elseif (z <= 2.75e-58)
		tmp = Float64(a * Float64(27.0 * b));
	elseif (z <= 112000000.0)
		tmp = Float64(x * 2.0);
	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])){:}
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 * (b * a);
	tmp = 0.0;
	if (z <= -2.1e-70)
		tmp = y * (-9.0 * (z * t));
	elseif (z <= -2.5e-199)
		tmp = t_1;
	elseif (z <= -3.5e-235)
		tmp = x * 2.0;
	elseif (z <= -1.5e-295)
		tmp = t_1;
	elseif (z <= 1e-263)
		tmp = x * 2.0;
	elseif (z <= 2.75e-58)
		tmp = a * (27.0 * b);
	elseif (z <= 112000000.0)
		tmp = x * 2.0;
	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.
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[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e-70], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5e-199], t$95$1, If[LessEqual[z, -3.5e-235], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, -1.5e-295], t$95$1, If[LessEqual[z, 1e-263], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 2.75e-58], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 112000000.0], N[(x * 2.0), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{-70}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-235}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq -1.5 \cdot 10^{-295}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 10^{-263}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

\mathbf{elif}\;z \leq 112000000:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if z < -2.1000000000000001e-70

    1. Initial program 90.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. sub-neg90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.1000000000000001e-70 < z < -2.4999999999999998e-199 or -3.4999999999999999e-235 < z < -1.49999999999999998e-295

    1. Initial program 95.7%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*99.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. Simplified99.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. +-commutative99.8%

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

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

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

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

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

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

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

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

    if -2.4999999999999998e-199 < z < -3.4999999999999999e-235 or -1.49999999999999998e-295 < z < 1e-263 or 2.74999999999999998e-58 < z < 1.12e8

    1. Initial program 100.0%

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

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

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*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 \]
      4. associate-*l*99.9%

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

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

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

    if 1e-263 < z < 2.74999999999999998e-58

    1. Initial program 96.9%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*97.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. Simplified97.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. +-commutative97.0%

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

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

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

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

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

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

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

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

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

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

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

    if 1.12e8 < z

    1. Initial program 87.8%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.1 \cdot 10^{-70}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-199}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-235}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -1.5 \cdot 10^{-295}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;z \leq 10^{-263}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 2.75 \cdot 10^{-58}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;z \leq 112000000:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 79.1% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;z \leq -1.4 \cdot 10^{+75}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-95} \lor \neg \left(z \leq 1.2 \cdot 10^{-55}\right) \land z \leq 0.00033:\\ \;\;\;\;t\_1 + x \cdot 2\\ \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.
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 (* b a))))
   (if (<= z -1.4e+75)
     (- (* x 2.0) (* 9.0 (* z (* y t))))
     (if (or (<= z 2.05e-95) (and (not (<= z 1.2e-55)) (<= z 0.00033)))
       (+ t_1 (* x 2.0))
       (- t_1 (* 9.0 (* t (* y z))))))))
assert(x < y && y < z && z < t && t < a && 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 t_1 = 27.0 * (b * a);
	double tmp;
	if (z <= -1.4e+75) {
		tmp = (x * 2.0) - (9.0 * (z * (y * t)));
	} else if ((z <= 2.05e-95) || (!(z <= 1.2e-55) && (z <= 0.00033))) {
		tmp = t_1 + (x * 2.0);
	} 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.
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 * (b * a)
    if (z <= (-1.4d+75)) then
        tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
    else if ((z <= 2.05d-95) .or. (.not. (z <= 1.2d-55)) .and. (z <= 0.00033d0)) then
        tmp = t_1 + (x * 2.0d0)
    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;
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 * (b * a);
	double tmp;
	if (z <= -1.4e+75) {
		tmp = (x * 2.0) - (9.0 * (z * (y * t)));
	} else if ((z <= 2.05e-95) || (!(z <= 1.2e-55) && (z <= 0.00033))) {
		tmp = t_1 + (x * 2.0);
	} else {
		tmp = t_1 - (9.0 * (t * (y * z)));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 * (b * a)
	tmp = 0
	if z <= -1.4e+75:
		tmp = (x * 2.0) - (9.0 * (z * (y * t)))
	elif (z <= 2.05e-95) or (not (z <= 1.2e-55) and (z <= 0.00033)):
		tmp = t_1 + (x * 2.0)
	else:
		tmp = t_1 - (9.0 * (t * (y * z)))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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(b * a))
	tmp = 0.0
	if (z <= -1.4e+75)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t))));
	elseif ((z <= 2.05e-95) || (!(z <= 1.2e-55) && (z <= 0.00033)))
		tmp = Float64(t_1 + Float64(x * 2.0));
	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])){:}
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 * (b * a);
	tmp = 0.0;
	if (z <= -1.4e+75)
		tmp = (x * 2.0) - (9.0 * (z * (y * t)));
	elseif ((z <= 2.05e-95) || (~((z <= 1.2e-55)) && (z <= 0.00033)))
		tmp = t_1 + (x * 2.0);
	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.
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[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e+75], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 2.05e-95], And[N[Not[LessEqual[z, 1.2e-55]], $MachinePrecision], LessEqual[z, 0.00033]]], N[(t$95$1 + N[(x * 2.0), $MachinePrecision]), $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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{+75}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\

\mathbf{elif}\;z \leq 2.05 \cdot 10^{-95} \lor \neg \left(z \leq 1.2 \cdot 10^{-55}\right) \land z \leq 0.00033:\\
\;\;\;\;t\_1 + x \cdot 2\\

\mathbf{else}:\\
\;\;\;\;t\_1 - 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 < -1.40000000000000006e75

    1. Initial program 87.7%

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

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

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*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 \]
      4. 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 a around 0 66.3%

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

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

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

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

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

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

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

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

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

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

    if -1.40000000000000006e75 < z < 2.0499999999999999e-95 or 1.19999999999999996e-55 < z < 3.3e-4

    1. Initial program 96.9%

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

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

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

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

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

    if 2.0499999999999999e-95 < z < 1.19999999999999996e-55 or 3.3e-4 < z

    1. Initial program 89.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. sub-neg89.5%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.4 \cdot 10^{+75}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 2.05 \cdot 10^{-95} \lor \neg \left(z \leq 1.2 \cdot 10^{-55}\right) \land z \leq 0.00033:\\ \;\;\;\;27 \cdot \left(b \cdot a\right) + x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right) - 9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 96.8% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 8.00000000000000058e70

    1. Initial program 94.6%

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

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

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

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

    if 8.00000000000000058e70 < z

    1. Initial program 86.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. sub-neg86.5%

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*85.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. Simplified85.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 x around 0 72.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 simplification90.8%

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

Alternative 6: 97.9% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 3 \cdot 10^{-249}:\\ \;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(y \cdot \left(9 \cdot z\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 3e-249)
   (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b)))
   (+ (- (* x 2.0) (* t (* y (* 9.0 z)))) (* b (* 27.0 a)))))
assert(x < y && y < z && z < t && t < a && 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 <= 3e-249) {
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
	}
	return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= 3d-249) then
        tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
    else
        tmp = ((x * 2.0d0) - (t * (y * (9.0d0 * z)))) + (b * (27.0d0 * a))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= 3e-249) {
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 <= 3e-249:
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b))
	else:
		tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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 <= 3e-249)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b)));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(9.0 * z)))) + Float64(b * Float64(27.0 * a)));
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= 3e-249)
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	else
		tmp = ((x * 2.0) - (t * (y * (9.0 * z)))) + (b * (27.0 * a));
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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, 3e-249], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(9.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3 \cdot 10^{-249}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 3.00000000000000004e-249

    1. Initial program 93.3%

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

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

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

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

    if 3.00000000000000004e-249 < z

    1. Initial program 92.0%

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

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

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

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

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

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

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

Alternative 7: 98.0% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < 4.49999999999999981e-249

    1. Initial program 93.3%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*95.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. Simplified95.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. +-commutative95.8%

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

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

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

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

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

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

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

    if 4.49999999999999981e-249 < z

    1. Initial program 92.0%

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

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

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

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

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

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

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

Alternative 8: 78.5% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -7.5 \cdot 10^{+74}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 5.6 \cdot 10^{-82}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right) + x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 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.
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 -7.5e+74)
   (* y (* -9.0 (* z t)))
   (if (<= z 5.6e-82)
     (+ (* 27.0 (* b a)) (* x 2.0))
     (- (* x 2.0) (* 9.0 (* t (* y z)))))))
assert(x < y && y < z && z < t && t < a && 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 <= -7.5e+74) {
		tmp = y * (-9.0 * (z * t));
	} else if (z <= 5.6e-82) {
		tmp = (27.0 * (b * a)) + (x * 2.0);
	} else {
		tmp = (x * 2.0) - (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.
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 <= (-7.5d+74)) then
        tmp = y * ((-9.0d0) * (z * t))
    else if (z <= 5.6d-82) then
        tmp = (27.0d0 * (b * a)) + (x * 2.0d0)
    else
        tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= -7.5e+74) {
		tmp = y * (-9.0 * (z * t));
	} else if (z <= 5.6e-82) {
		tmp = (27.0 * (b * a)) + (x * 2.0);
	} else {
		tmp = (x * 2.0) - (9.0 * (t * (y * z)));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 <= -7.5e+74:
		tmp = y * (-9.0 * (z * t))
	elif z <= 5.6e-82:
		tmp = (27.0 * (b * a)) + (x * 2.0)
	else:
		tmp = (x * 2.0) - (9.0 * (t * (y * z)))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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 <= -7.5e+74)
		tmp = Float64(y * Float64(-9.0 * Float64(z * t)));
	elseif (z <= 5.6e-82)
		tmp = Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0));
	else
		tmp = Float64(Float64(x * 2.0) - 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])){:}
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 <= -7.5e+74)
		tmp = y * (-9.0 * (z * t));
	elseif (z <= 5.6e-82)
		tmp = (27.0 * (b * a)) + (x * 2.0);
	else
		tmp = (x * 2.0) - (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.
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, -7.5e+74], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.6e-82], N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+74}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\

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

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


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

    1. Initial program 87.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.5e74 < z < 5.60000000000000049e-82

    1. Initial program 96.6%

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

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

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

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

    if 5.60000000000000049e-82 < z

    1. Initial program 90.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. sub-neg90.5%

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*89.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. Simplified89.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 a around 0 72.5%

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

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

Alternative 9: 79.0% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq -1.02 \cdot 10^{+74}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 6.6 \cdot 10^{-81}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right) + x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 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.
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 -1.02e+74)
   (- (* x 2.0) (* 9.0 (* z (* y t))))
   (if (<= z 6.6e-81)
     (+ (* 27.0 (* b a)) (* x 2.0))
     (- (* x 2.0) (* 9.0 (* t (* y z)))))))
assert(x < y && y < z && z < t && t < a && 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 <= -1.02e+74) {
		tmp = (x * 2.0) - (9.0 * (z * (y * t)));
	} else if (z <= 6.6e-81) {
		tmp = (27.0 * (b * a)) + (x * 2.0);
	} else {
		tmp = (x * 2.0) - (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.
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 <= (-1.02d+74)) then
        tmp = (x * 2.0d0) - (9.0d0 * (z * (y * t)))
    else if (z <= 6.6d-81) then
        tmp = (27.0d0 * (b * a)) + (x * 2.0d0)
    else
        tmp = (x * 2.0d0) - (9.0d0 * (t * (y * z)))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= -1.02e+74) {
		tmp = (x * 2.0) - (9.0 * (z * (y * t)));
	} else if (z <= 6.6e-81) {
		tmp = (27.0 * (b * a)) + (x * 2.0);
	} else {
		tmp = (x * 2.0) - (9.0 * (t * (y * z)));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 <= -1.02e+74:
		tmp = (x * 2.0) - (9.0 * (z * (y * t)))
	elif z <= 6.6e-81:
		tmp = (27.0 * (b * a)) + (x * 2.0)
	else:
		tmp = (x * 2.0) - (9.0 * (t * (y * z)))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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 <= -1.02e+74)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(z * Float64(y * t))));
	elseif (z <= 6.6e-81)
		tmp = Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0));
	else
		tmp = Float64(Float64(x * 2.0) - 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])){:}
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 <= -1.02e+74)
		tmp = (x * 2.0) - (9.0 * (z * (y * t)));
	elseif (z <= 6.6e-81)
		tmp = (27.0 * (b * a)) + (x * 2.0);
	else
		tmp = (x * 2.0) - (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.
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, -1.02e+74], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.6e-81], N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - 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])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+74}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\

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

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


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

    1. Initial program 87.7%

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

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

        \[\leadsto \color{blue}{\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right)} + \left(a \cdot 27\right) \cdot b \]
      3. associate-*l*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 \]
      4. 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 a around 0 66.3%

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

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

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

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

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

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

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

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

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

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

    if -1.02000000000000005e74 < z < 6.59999999999999975e-81

    1. Initial program 96.6%

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

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

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

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

    if 6.59999999999999975e-81 < z

    1. Initial program 90.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. sub-neg90.5%

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*89.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. Simplified89.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 a around 0 72.5%

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

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

Alternative 10: 76.8% accurate, 0.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [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}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 4000000000:\\ \;\;\;\;27 \cdot \left(b \cdot a\right) + x \cdot 2\\ \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.
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)
   (* y (* -9.0 (* z t)))
   (if (<= z 4000000000.0)
     (+ (* 27.0 (* b a)) (* x 2.0))
     (* -9.0 (* t (* y z))))))
assert(x < y && y < z && z < t && t < a && 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.8e+75) {
		tmp = y * (-9.0 * (z * t));
	} else if (z <= 4000000000.0) {
		tmp = (27.0 * (b * a)) + (x * 2.0);
	} 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.
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 = y * ((-9.0d0) * (z * t))
    else if (z <= 4000000000.0d0) then
        tmp = (27.0d0 * (b * a)) + (x * 2.0d0)
    else
        tmp = (-9.0d0) * (t * (y * z))
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 = y * (-9.0 * (z * t));
	} else if (z <= 4000000000.0) {
		tmp = (27.0 * (b * a)) + (x * 2.0);
	} else {
		tmp = -9.0 * (t * (y * z));
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 = y * (-9.0 * (z * t))
	elif z <= 4000000000.0:
		tmp = (27.0 * (b * a)) + (x * 2.0)
	else:
		tmp = -9.0 * (t * (y * z))
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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(y * Float64(-9.0 * Float64(z * t)));
	elseif (z <= 4000000000.0)
		tmp = Float64(Float64(27.0 * Float64(b * a)) + Float64(x * 2.0));
	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])){:}
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 = y * (-9.0 * (z * t));
	elseif (z <= 4000000000.0)
		tmp = (27.0 * (b * a)) + (x * 2.0);
	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.
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[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4000000000.0], N[(N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $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])\\\\
[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}:\\
\;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\

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

\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 87.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. sub-neg87.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8000000000000002e75 < z < 4e9

    1. Initial program 97.1%

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

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

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

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

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

    if 4e9 < z

    1. Initial program 87.8%

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

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

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

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

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

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

Alternative 11: 48.3% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq -6.2 \cdot 10^{+18} \lor \neg \left(a \leq 1.4 \cdot 10^{-95}\right):\\ \;\;\;\;27 \cdot \left(b \cdot a\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.
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 -6.2e+18) (not (<= a 1.4e-95))) (* 27.0 (* b a)) (* x 2.0)))
assert(x < y && y < z && z < t && t < a && 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 ((a <= -6.2e+18) || !(a <= 1.4e-95)) {
		tmp = 27.0 * (b * a);
	} 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.
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 <= (-6.2d+18)) .or. (.not. (a <= 1.4d-95))) then
        tmp = 27.0d0 * (b * a)
    else
        tmp = x * 2.0d0
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= -6.2e+18) || !(a <= 1.4e-95)) {
		tmp = 27.0 * (b * a);
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 <= -6.2e+18) or not (a <= 1.4e-95):
		tmp = 27.0 * (b * a)
	else:
		tmp = x * 2.0
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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 <= -6.2e+18) || !(a <= 1.4e-95))
		tmp = Float64(27.0 * Float64(b * a));
	else
		tmp = Float64(x * 2.0);
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= -6.2e+18) || ~((a <= 1.4e-95)))
		tmp = 27.0 * (b * a);
	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.
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, -6.2e+18], N[Not[LessEqual[a, 1.4e-95]], $MachinePrecision]], N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.2 \cdot 10^{+18} \lor \neg \left(a \leq 1.4 \cdot 10^{-95}\right):\\
\;\;\;\;27 \cdot \left(b \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -6.2e18 or 1.4e-95 < a

    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. sub-neg91.8%

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

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

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

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

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

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

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

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

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

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

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

    if -6.2e18 < a < 1.4e-95

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

Alternative 12: 48.2% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+18}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-123}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;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.
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 (<= a -6.8e+18)
   (* 27.0 (* b a))
   (if (<= a 6e-123) (* x 2.0) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && 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 (a <= -6.8e+18) {
		tmp = 27.0 * (b * a);
	} else if (a <= 6e-123) {
		tmp = x * 2.0;
	} else {
		tmp = a * (27.0 * b);
	}
	return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= (-6.8d+18)) then
        tmp = 27.0d0 * (b * a)
    else if (a <= 6d-123) then
        tmp = x * 2.0d0
    else
        tmp = a * (27.0d0 * b)
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= -6.8e+18) {
		tmp = 27.0 * (b * a);
	} else if (a <= 6e-123) {
		tmp = x * 2.0;
	} else {
		tmp = a * (27.0 * b);
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 <= -6.8e+18:
		tmp = 27.0 * (b * a)
	elif a <= 6e-123:
		tmp = x * 2.0
	else:
		tmp = a * (27.0 * b)
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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 <= -6.8e+18)
		tmp = Float64(27.0 * Float64(b * a));
	elseif (a <= 6e-123)
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(a * Float64(27.0 * b));
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= -6.8e+18)
		tmp = 27.0 * (b * a);
	elseif (a <= 6e-123)
		tmp = x * 2.0;
	else
		tmp = 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.
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[a, -6.8e+18], N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6e-123], N[(x * 2.0), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.8 \cdot 10^{+18}:\\
\;\;\;\;27 \cdot \left(b \cdot a\right)\\

\mathbf{elif}\;a \leq 6 \cdot 10^{-123}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -6.8e18

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.8e18 < a < 5.99999999999999968e-123

    1. Initial program 93.6%

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

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

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

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

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

    if 5.99999999999999968e-123 < a

    1. Initial program 91.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. sub-neg91.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -6.8 \cdot 10^{+18}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;a \leq 6 \cdot 10^{-123}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 30.6% accurate, 5.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [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.
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);
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.
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;
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])
[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])
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])){:}
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.
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, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x \cdot 2
\end{array}
Derivation
  1. Initial program 92.7%

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

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

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

      \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
    4. associate-*l*93.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. Simplified93.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 33.1%

    \[\leadsto \color{blue}{2 \cdot x} \]
  6. Final simplification33.1%

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

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

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

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