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

Percentage Accurate: 95.7% → 98.9%
Time: 12.2s
Alternatives: 12
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 12 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.7% 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.9% 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}\;z \leq 1.5 \cdot 10^{-13}:\\ \;\;\;\;\left(x \cdot 2 + 27 \cdot \left(b \cdot a\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\right)\right)\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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.5e-13)
   (- (+ (* x 2.0) (* 27.0 (* b a))) (* y (* (* z 9.0) t)))
   (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* z -9.0)))))))
assert(x < y && y < z && z < t && t < a && a < b);
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.5e-13) {
		tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t));
	} else {
		tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (z * -9.0)))));
	}
	return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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.5e-13)
		tmp = Float64(Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a))) - Float64(y * Float64(Float64(z * 9.0) * t)));
	else
		tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(z * -9.0)))));
	end
	return tmp
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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.5e-13], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5 \cdot 10^{-13}:\\
\;\;\;\;\left(x \cdot 2 + 27 \cdot \left(b \cdot a\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\

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


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

    1. Initial program 96.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-neg96.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-neg96.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*95.7%

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

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

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

        \[\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*96.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*96.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-rr96.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)} \]

    if 1.49999999999999992e-13 < z

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 46.9% accurate, 0.3× 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 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ t_3 := 27 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;x \leq -1.95 \cdot 10^{+51}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-168}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-199}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-228}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq -1.25 \cdot 10^{-261}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-238}:\\ \;\;\;\;b \cdot \left(27 \cdot a\right)\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-123}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-20}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \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
 (let* ((t_1 (* -9.0 (* y (* z t))))
        (t_2 (* -9.0 (* t (* z y))))
        (t_3 (* 27.0 (* b a))))
   (if (<= x -1.95e+51)
     (* x 2.0)
     (if (<= x -2.5e-168)
       t_3
       (if (<= x -1.5e-199)
         t_2
         (if (<= x -3.5e-228)
           t_3
           (if (<= x -1.25e-261)
             t_1
             (if (<= x 2.1e-238)
               (* b (* 27.0 a))
               (if (<= x 6.2e-123)
                 t_2
                 (if (<= x 7.5e-20)
                   t_3
                   (if (<= x 1.3e+14) t_1 (* 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 t_1 = -9.0 * (y * (z * t));
	double t_2 = -9.0 * (t * (z * y));
	double t_3 = 27.0 * (b * a);
	double tmp;
	if (x <= -1.95e+51) {
		tmp = x * 2.0;
	} else if (x <= -2.5e-168) {
		tmp = t_3;
	} else if (x <= -1.5e-199) {
		tmp = t_2;
	} else if (x <= -3.5e-228) {
		tmp = t_3;
	} else if (x <= -1.25e-261) {
		tmp = t_1;
	} else if (x <= 2.1e-238) {
		tmp = b * (27.0 * a);
	} else if (x <= 6.2e-123) {
		tmp = t_2;
	} else if (x <= 7.5e-20) {
		tmp = t_3;
	} else if (x <= 1.3e+14) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_1 = (-9.0d0) * (y * (z * t))
    t_2 = (-9.0d0) * (t * (z * y))
    t_3 = 27.0d0 * (b * a)
    if (x <= (-1.95d+51)) then
        tmp = x * 2.0d0
    else if (x <= (-2.5d-168)) then
        tmp = t_3
    else if (x <= (-1.5d-199)) then
        tmp = t_2
    else if (x <= (-3.5d-228)) then
        tmp = t_3
    else if (x <= (-1.25d-261)) then
        tmp = t_1
    else if (x <= 2.1d-238) then
        tmp = b * (27.0d0 * a)
    else if (x <= 6.2d-123) then
        tmp = t_2
    else if (x <= 7.5d-20) then
        tmp = t_3
    else if (x <= 1.3d+14) then
        tmp = t_1
    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 t_1 = -9.0 * (y * (z * t));
	double t_2 = -9.0 * (t * (z * y));
	double t_3 = 27.0 * (b * a);
	double tmp;
	if (x <= -1.95e+51) {
		tmp = x * 2.0;
	} else if (x <= -2.5e-168) {
		tmp = t_3;
	} else if (x <= -1.5e-199) {
		tmp = t_2;
	} else if (x <= -3.5e-228) {
		tmp = t_3;
	} else if (x <= -1.25e-261) {
		tmp = t_1;
	} else if (x <= 2.1e-238) {
		tmp = b * (27.0 * a);
	} else if (x <= 6.2e-123) {
		tmp = t_2;
	} else if (x <= 7.5e-20) {
		tmp = t_3;
	} else if (x <= 1.3e+14) {
		tmp = t_1;
	} 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):
	t_1 = -9.0 * (y * (z * t))
	t_2 = -9.0 * (t * (z * y))
	t_3 = 27.0 * (b * a)
	tmp = 0
	if x <= -1.95e+51:
		tmp = x * 2.0
	elif x <= -2.5e-168:
		tmp = t_3
	elif x <= -1.5e-199:
		tmp = t_2
	elif x <= -3.5e-228:
		tmp = t_3
	elif x <= -1.25e-261:
		tmp = t_1
	elif x <= 2.1e-238:
		tmp = b * (27.0 * a)
	elif x <= 6.2e-123:
		tmp = t_2
	elif x <= 7.5e-20:
		tmp = t_3
	elif x <= 1.3e+14:
		tmp = t_1
	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)
	t_1 = Float64(-9.0 * Float64(y * Float64(z * t)))
	t_2 = Float64(-9.0 * Float64(t * Float64(z * y)))
	t_3 = Float64(27.0 * Float64(b * a))
	tmp = 0.0
	if (x <= -1.95e+51)
		tmp = Float64(x * 2.0);
	elseif (x <= -2.5e-168)
		tmp = t_3;
	elseif (x <= -1.5e-199)
		tmp = t_2;
	elseif (x <= -3.5e-228)
		tmp = t_3;
	elseif (x <= -1.25e-261)
		tmp = t_1;
	elseif (x <= 2.1e-238)
		tmp = Float64(b * Float64(27.0 * a));
	elseif (x <= 6.2e-123)
		tmp = t_2;
	elseif (x <= 7.5e-20)
		tmp = t_3;
	elseif (x <= 1.3e+14)
		tmp = t_1;
	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)
	t_1 = -9.0 * (y * (z * t));
	t_2 = -9.0 * (t * (z * y));
	t_3 = 27.0 * (b * a);
	tmp = 0.0;
	if (x <= -1.95e+51)
		tmp = x * 2.0;
	elseif (x <= -2.5e-168)
		tmp = t_3;
	elseif (x <= -1.5e-199)
		tmp = t_2;
	elseif (x <= -3.5e-228)
		tmp = t_3;
	elseif (x <= -1.25e-261)
		tmp = t_1;
	elseif (x <= 2.1e-238)
		tmp = b * (27.0 * a);
	elseif (x <= 6.2e-123)
		tmp = t_2;
	elseif (x <= 7.5e-20)
		tmp = t_3;
	elseif (x <= 1.3e+14)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e+51], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -2.5e-168], t$95$3, If[LessEqual[x, -1.5e-199], t$95$2, If[LessEqual[x, -3.5e-228], t$95$3, If[LessEqual[x, -1.25e-261], t$95$1, If[LessEqual[x, 2.1e-238], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e-123], t$95$2, If[LessEqual[x, 7.5e-20], t$95$3, If[LessEqual[x, 1.3e+14], t$95$1, 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}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_2 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_3 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{+51}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -2.5 \cdot 10^{-168}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq -1.5 \cdot 10^{-199}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -3.5 \cdot 10^{-228}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq -1.25 \cdot 10^{-261}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 6.2 \cdot 10^{-123}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 7.5 \cdot 10^{-20}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;x \leq 1.3 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if x < -1.94999999999999992e51 or 1.3e14 < x

    1. Initial program 96.5%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg96.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-neg96.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*93.7%

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

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

    if -1.94999999999999992e51 < x < -2.50000000000000001e-168 or -1.49999999999999992e-199 < x < -3.49999999999999975e-228 or 6.19999999999999996e-123 < x < 7.49999999999999981e-20

    1. Initial program 98.0%

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

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

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

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

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

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

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

    if -2.50000000000000001e-168 < x < -1.49999999999999992e-199 or 2.1000000000000001e-238 < x < 6.19999999999999996e-123

    1. Initial program 92.4%

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

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

        \[\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*90.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*90.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. Simplified90.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 inf 70.4%

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

    if -3.49999999999999975e-228 < x < -1.24999999999999995e-261 or 7.49999999999999981e-20 < x < 1.3e14

    1. Initial program 91.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-neg91.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-neg91.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*87.7%

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

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

      \[\leadsto \color{blue}{\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. +-commutative87.7%

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

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

        \[\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*87.7%

        \[\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*87.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*87.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-rr87.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 y around inf 61.9%

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

        \[\leadsto \color{blue}{\left(-9\right)} \cdot \left(t \cdot \left(y \cdot z\right)\right) \]
      2. distribute-lft-neg-in61.9%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(y \cdot \left(9 \cdot z\right)\right)} \cdot t \]
      12. distribute-lft-neg-in61.8%

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

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

        \[\leadsto t \cdot \left(-\color{blue}{\left(y \cdot 9\right) \cdot z}\right) \]
      15. distribute-lft-neg-in61.9%

        \[\leadsto t \cdot \color{blue}{\left(\left(-y \cdot 9\right) \cdot z\right)} \]
      16. distribute-rgt-neg-in61.9%

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

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

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

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

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

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

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

    if -1.24999999999999995e-261 < x < 2.1000000000000001e-238

    1. Initial program 94.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-neg94.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-neg94.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*99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.95 \cdot 10^{+51}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -2.5 \cdot 10^{-168}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;x \leq -1.5 \cdot 10^{-199}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-228}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;x \leq -1.25 \cdot 10^{-261}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;x \leq 2.1 \cdot 10^{-238}:\\ \;\;\;\;b \cdot \left(27 \cdot a\right)\\ \mathbf{elif}\;x \leq 6.2 \cdot 10^{-123}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-20}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+14}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 47.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 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ t_2 := 27 \cdot \left(b \cdot a\right)\\ \mathbf{if}\;x \leq -1.25 \cdot 10^{+50}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -1.56 \cdot 10^{-168}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq -1.75 \cdot 10^{-199}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-240}:\\ \;\;\;\;b \cdot \left(27 \cdot a\right)\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-122}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{-27}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+14}:\\ \;\;\;\;t\_1\\ \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
 (let* ((t_1 (* -9.0 (* t (* z y)))) (t_2 (* 27.0 (* b a))))
   (if (<= x -1.25e+50)
     (* x 2.0)
     (if (<= x -1.56e-168)
       t_2
       (if (<= x -1.75e-199)
         t_1
         (if (<= x 7e-240)
           (* b (* 27.0 a))
           (if (<= x 4.8e-122)
             t_1
             (if (<= x 2.75e-27) t_2 (if (<= x 2.2e+14) t_1 (* 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 t_1 = -9.0 * (t * (z * y));
	double t_2 = 27.0 * (b * a);
	double tmp;
	if (x <= -1.25e+50) {
		tmp = x * 2.0;
	} else if (x <= -1.56e-168) {
		tmp = t_2;
	} else if (x <= -1.75e-199) {
		tmp = t_1;
	} else if (x <= 7e-240) {
		tmp = b * (27.0 * a);
	} else if (x <= 4.8e-122) {
		tmp = t_1;
	} else if (x <= 2.75e-27) {
		tmp = t_2;
	} else if (x <= 2.2e+14) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-9.0d0) * (t * (z * y))
    t_2 = 27.0d0 * (b * a)
    if (x <= (-1.25d+50)) then
        tmp = x * 2.0d0
    else if (x <= (-1.56d-168)) then
        tmp = t_2
    else if (x <= (-1.75d-199)) then
        tmp = t_1
    else if (x <= 7d-240) then
        tmp = b * (27.0d0 * a)
    else if (x <= 4.8d-122) then
        tmp = t_1
    else if (x <= 2.75d-27) then
        tmp = t_2
    else if (x <= 2.2d+14) then
        tmp = t_1
    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 t_1 = -9.0 * (t * (z * y));
	double t_2 = 27.0 * (b * a);
	double tmp;
	if (x <= -1.25e+50) {
		tmp = x * 2.0;
	} else if (x <= -1.56e-168) {
		tmp = t_2;
	} else if (x <= -1.75e-199) {
		tmp = t_1;
	} else if (x <= 7e-240) {
		tmp = b * (27.0 * a);
	} else if (x <= 4.8e-122) {
		tmp = t_1;
	} else if (x <= 2.75e-27) {
		tmp = t_2;
	} else if (x <= 2.2e+14) {
		tmp = t_1;
	} 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):
	t_1 = -9.0 * (t * (z * y))
	t_2 = 27.0 * (b * a)
	tmp = 0
	if x <= -1.25e+50:
		tmp = x * 2.0
	elif x <= -1.56e-168:
		tmp = t_2
	elif x <= -1.75e-199:
		tmp = t_1
	elif x <= 7e-240:
		tmp = b * (27.0 * a)
	elif x <= 4.8e-122:
		tmp = t_1
	elif x <= 2.75e-27:
		tmp = t_2
	elif x <= 2.2e+14:
		tmp = t_1
	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)
	t_1 = Float64(-9.0 * Float64(t * Float64(z * y)))
	t_2 = Float64(27.0 * Float64(b * a))
	tmp = 0.0
	if (x <= -1.25e+50)
		tmp = Float64(x * 2.0);
	elseif (x <= -1.56e-168)
		tmp = t_2;
	elseif (x <= -1.75e-199)
		tmp = t_1;
	elseif (x <= 7e-240)
		tmp = Float64(b * Float64(27.0 * a));
	elseif (x <= 4.8e-122)
		tmp = t_1;
	elseif (x <= 2.75e-27)
		tmp = t_2;
	elseif (x <= 2.2e+14)
		tmp = t_1;
	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)
	t_1 = -9.0 * (t * (z * y));
	t_2 = 27.0 * (b * a);
	tmp = 0.0;
	if (x <= -1.25e+50)
		tmp = x * 2.0;
	elseif (x <= -1.56e-168)
		tmp = t_2;
	elseif (x <= -1.75e-199)
		tmp = t_1;
	elseif (x <= 7e-240)
		tmp = b * (27.0 * a);
	elseif (x <= 4.8e-122)
		tmp = t_1;
	elseif (x <= 2.75e-27)
		tmp = t_2;
	elseif (x <= 2.2e+14)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.25e+50], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -1.56e-168], t$95$2, If[LessEqual[x, -1.75e-199], t$95$1, If[LessEqual[x, 7e-240], N[(b * N[(27.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e-122], t$95$1, If[LessEqual[x, 2.75e-27], t$95$2, If[LessEqual[x, 2.2e+14], t$95$1, 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}
t_1 := -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(b \cdot a\right)\\
\mathbf{if}\;x \leq -1.25 \cdot 10^{+50}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -1.56 \cdot 10^{-168}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq -1.75 \cdot 10^{-199}:\\
\;\;\;\;t\_1\\

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

\mathbf{elif}\;x \leq 4.8 \cdot 10^{-122}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 2.75 \cdot 10^{-27}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;x \leq 2.2 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.25e50 or 2.2e14 < x

    1. Initial program 96.5%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. sub-neg96.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-neg96.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*93.7%

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

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

    if -1.25e50 < x < -1.55999999999999991e-168 or 4.79999999999999975e-122 < x < 2.7500000000000001e-27

    1. Initial program 97.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-neg97.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-neg97.8%

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

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

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

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

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

    if -1.55999999999999991e-168 < x < -1.7499999999999999e-199 or 7.00000000000000032e-240 < x < 4.79999999999999975e-122 or 2.7500000000000001e-27 < x < 2.2e14

    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. Step-by-step derivation
      1. sub-neg92.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-neg92.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*90.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*90.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. Simplified90.3%

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

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

    if -1.7499999999999999e-199 < x < 7.00000000000000032e-240

    1. Initial program 94.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-neg94.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-neg94.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*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.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.25 \cdot 10^{+50}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -1.56 \cdot 10^{-168}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;x \leq -1.75 \cdot 10^{-199}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 7 \cdot 10^{-240}:\\ \;\;\;\;b \cdot \left(27 \cdot a\right)\\ \mathbf{elif}\;x \leq 4.8 \cdot 10^{-122}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 2.75 \cdot 10^{-27}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{+14}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 78.8% 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 := x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\ t_2 := t \cdot \left(z \cdot y\right)\\ \mathbf{if}\;x \leq -7 \cdot 10^{+29}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-20}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot t\_2\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+220} \lor \neg \left(x \leq 1.65 \cdot 10^{+279}\right):\\ \;\;\;\;x \cdot 2 - 9 \cdot t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 (+ (* x 2.0) (* 27.0 (* b a)))) (t_2 (* t (* z y))))
   (if (<= x -7e+29)
     t_1
     (if (<= x 1.5e-20)
       (+ (* a (* 27.0 b)) (* -9.0 t_2))
       (if (or (<= x 7.2e+220) (not (<= x 1.65e+279)))
         (- (* x 2.0) (* 9.0 t_2))
         t_1)))))
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 = (x * 2.0) + (27.0 * (b * a));
	double t_2 = t * (z * y);
	double tmp;
	if (x <= -7e+29) {
		tmp = t_1;
	} else if (x <= 1.5e-20) {
		tmp = (a * (27.0 * b)) + (-9.0 * t_2);
	} else if ((x <= 7.2e+220) || !(x <= 1.65e+279)) {
		tmp = (x * 2.0) - (9.0 * t_2);
	} else {
		tmp = t_1;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = (x * 2.0d0) + (27.0d0 * (b * a))
    t_2 = t * (z * y)
    if (x <= (-7d+29)) then
        tmp = t_1
    else if (x <= 1.5d-20) then
        tmp = (a * (27.0d0 * b)) + ((-9.0d0) * t_2)
    else if ((x <= 7.2d+220) .or. (.not. (x <= 1.65d+279))) then
        tmp = (x * 2.0d0) - (9.0d0 * t_2)
    else
        tmp = t_1
    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 = (x * 2.0) + (27.0 * (b * a));
	double t_2 = t * (z * y);
	double tmp;
	if (x <= -7e+29) {
		tmp = t_1;
	} else if (x <= 1.5e-20) {
		tmp = (a * (27.0 * b)) + (-9.0 * t_2);
	} else if ((x <= 7.2e+220) || !(x <= 1.65e+279)) {
		tmp = (x * 2.0) - (9.0 * t_2);
	} else {
		tmp = t_1;
	}
	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 = (x * 2.0) + (27.0 * (b * a))
	t_2 = t * (z * y)
	tmp = 0
	if x <= -7e+29:
		tmp = t_1
	elif x <= 1.5e-20:
		tmp = (a * (27.0 * b)) + (-9.0 * t_2)
	elif (x <= 7.2e+220) or not (x <= 1.65e+279):
		tmp = (x * 2.0) - (9.0 * t_2)
	else:
		tmp = t_1
	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(Float64(x * 2.0) + Float64(27.0 * Float64(b * a)))
	t_2 = Float64(t * Float64(z * y))
	tmp = 0.0
	if (x <= -7e+29)
		tmp = t_1;
	elseif (x <= 1.5e-20)
		tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(-9.0 * t_2));
	elseif ((x <= 7.2e+220) || !(x <= 1.65e+279))
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * t_2));
	else
		tmp = t_1;
	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 = (x * 2.0) + (27.0 * (b * a));
	t_2 = t * (z * y);
	tmp = 0.0;
	if (x <= -7e+29)
		tmp = t_1;
	elseif (x <= 1.5e-20)
		tmp = (a * (27.0 * b)) + (-9.0 * t_2);
	elseif ((x <= 7.2e+220) || ~((x <= 1.65e+279)))
		tmp = (x * 2.0) - (9.0 * t_2);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7e+29], t$95$1, If[LessEqual[x, 1.5e-20], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(-9.0 * t$95$2), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, 7.2e+220], N[Not[LessEqual[x, 1.65e+279]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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 := x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\
t_2 := t \cdot \left(z \cdot y\right)\\
\mathbf{if}\;x \leq -7 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;x \leq 1.5 \cdot 10^{-20}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot t\_2\\

\mathbf{elif}\;x \leq 7.2 \cdot 10^{+220} \lor \neg \left(x \leq 1.65 \cdot 10^{+279}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.99999999999999958e29 or 7.20000000000000038e220 < x < 1.64999999999999996e279

    1. Initial program 95.6%

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

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

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

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

    if -6.99999999999999958e29 < x < 1.50000000000000014e-20

    1. Initial program 96.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-neg96.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-neg96.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*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.8%

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

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

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

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

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

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

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

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

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

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

    if 1.50000000000000014e-20 < x < 7.20000000000000038e220 or 1.64999999999999996e279 < x

    1. Initial program 94.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-neg94.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-neg94.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.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*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. Taylor expanded in a around 0 79.7%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7 \cdot 10^{+29}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\ \mathbf{elif}\;x \leq 1.5 \cdot 10^{-20}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 7.2 \cdot 10^{+220} \lor \neg \left(x \leq 1.65 \cdot 10^{+279}\right):\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 97.1% 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} t_1 := a \cdot \left(27 \cdot b\right)\\ \mathbf{if}\;z \leq 2 \cdot 10^{+74}:\\ \;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_1 + -9 \cdot \left(t \cdot \left(z \cdot y\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 (* a (* 27.0 b))))
   (if (<= z 2e+74)
     (+ (- (* x 2.0) (* (* y 9.0) (* z t))) t_1)
     (+ t_1 (* -9.0 (* t (* z y)))))))
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 = a * (27.0 * b);
	double tmp;
	if (z <= 2e+74) {
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + t_1;
	} else {
		tmp = t_1 + (-9.0 * (t * (z * y)));
	}
	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 = a * (27.0d0 * b)
    if (z <= 2d+74) then
        tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + t_1
    else
        tmp = t_1 + ((-9.0d0) * (t * (z * y)))
    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 = a * (27.0 * b);
	double tmp;
	if (z <= 2e+74) {
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + t_1;
	} else {
		tmp = t_1 + (-9.0 * (t * (z * y)));
	}
	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 = a * (27.0 * b)
	tmp = 0
	if z <= 2e+74:
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + t_1
	else:
		tmp = t_1 + (-9.0 * (t * (z * y)))
	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(a * Float64(27.0 * b))
	tmp = 0.0
	if (z <= 2e+74)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + t_1);
	else
		tmp = Float64(t_1 + Float64(-9.0 * Float64(t * Float64(z * y))));
	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 = a * (27.0 * b);
	tmp = 0.0;
	if (z <= 2e+74)
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + t_1;
	else
		tmp = t_1 + (-9.0 * (t * (z * y)));
	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[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 2e+74], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(-9.0 * N[(t * N[(z * y), $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 := a \cdot \left(27 \cdot b\right)\\
\mathbf{if}\;z \leq 2 \cdot 10^{+74}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + t\_1\\

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


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

    1. Initial program 96.4%

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

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

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

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

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

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

    if 1.9999999999999999e74 < z

    1. Initial program 92.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-neg92.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-neg92.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*81.7%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 2 \cdot 10^{+74}:\\ \;\;\;\;\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}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + -9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 98.2% 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 20000:\\ \;\;\;\;\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(z \cdot \left(y \cdot 9\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 20000.0)
   (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b)))
   (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* 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 <= 20000.0) {
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 20000.0d0) then
        tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
    else
        tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (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 <= 20000.0) {
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 20000.0:
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b))
	else:
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 20000.0)
		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(z * Float64(y * 9.0)))) + 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 <= 20000.0)
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	else
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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, 20000.0], 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[(z * N[(y * 9.0), $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 20000:\\
\;\;\;\;\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(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\


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

    1. Initial program 96.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-neg96.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-neg96.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*95.7%

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

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

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

    if 2e4 < z

    1. Initial program 94.2%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 20000:\\ \;\;\;\;\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(z \cdot \left(y \cdot 9\right)\right)\right) + b \cdot \left(27 \cdot a\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 98.4% 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 5 \cdot 10^{-14}:\\ \;\;\;\;\left(x \cdot 2 + 27 \cdot \left(b \cdot a\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\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 5e-14)
   (- (+ (* x 2.0) (* 27.0 (* b a))) (* y (* (* z 9.0) t)))
   (+ (- (* x 2.0) (* t (* z (* y 9.0)))) (* 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 <= 5e-14) {
		tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t));
	} else {
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 5d-14) then
        tmp = ((x * 2.0d0) + (27.0d0 * (b * a))) - (y * ((z * 9.0d0) * t))
    else
        tmp = ((x * 2.0d0) - (t * (z * (y * 9.0d0)))) + (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 <= 5e-14) {
		tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t));
	} else {
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 5e-14:
		tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t))
	else:
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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 <= 5e-14)
		tmp = Float64(Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a))) - Float64(y * Float64(Float64(z * 9.0) * t)));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))) + 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 <= 5e-14)
		tmp = ((x * 2.0) + (27.0 * (b * a))) - (y * ((z * 9.0) * t));
	else
		tmp = ((x * 2.0) - (t * (z * (y * 9.0)))) + (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, 5e-14], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $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 5 \cdot 10^{-14}:\\
\;\;\;\;\left(x \cdot 2 + 27 \cdot \left(b \cdot a\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\

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


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

    1. Initial program 96.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-neg96.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-neg96.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*95.7%

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

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

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

        \[\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*96.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*96.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-rr96.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)} \]

    if 5.0000000000000002e-14 < z

    1. Initial program 94.4%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification96.1%

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

Alternative 8: 78.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}\;b \leq -4.3 \cdot 10^{-47} \lor \neg \left(b \leq 6.4 \cdot 10^{+31}\right):\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\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 (or (<= b -4.3e-47) (not (<= b 6.4e+31)))
   (+ (* x 2.0) (* 27.0 (* b a)))
   (- (* x 2.0) (* 9.0 (* t (* z y))))))
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 ((b <= -4.3e-47) || !(b <= 6.4e+31)) {
		tmp = (x * 2.0) + (27.0 * (b * a));
	} else {
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	}
	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 ((b <= (-4.3d-47)) .or. (.not. (b <= 6.4d+31))) then
        tmp = (x * 2.0d0) + (27.0d0 * (b * a))
    else
        tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
    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 ((b <= -4.3e-47) || !(b <= 6.4e+31)) {
		tmp = (x * 2.0) + (27.0 * (b * a));
	} else {
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	}
	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 (b <= -4.3e-47) or not (b <= 6.4e+31):
		tmp = (x * 2.0) + (27.0 * (b * a))
	else:
		tmp = (x * 2.0) - (9.0 * (t * (z * y)))
	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 ((b <= -4.3e-47) || !(b <= 6.4e+31))
		tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a)));
	else
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y))));
	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 ((b <= -4.3e-47) || ~((b <= 6.4e+31)))
		tmp = (x * 2.0) + (27.0 * (b * a));
	else
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	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[b, -4.3e-47], N[Not[LessEqual[b, 6.4e+31]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $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}\;b \leq -4.3 \cdot 10^{-47} \lor \neg \left(b \leq 6.4 \cdot 10^{+31}\right):\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.2999999999999998e-47 or 6.4000000000000001e31 < b

    1. Initial program 93.7%

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

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

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

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

    if -4.2999999999999998e-47 < b < 6.4000000000000001e31

    1. Initial program 97.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-neg97.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-neg97.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.7%

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

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

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

Alternative 9: 75.0% 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 -1.65 \cdot 10^{-8}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\ \mathbf{elif}\;z \leq 1.52 \cdot 10^{+100}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\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.65e-8)
   (* (* z t) (* y -9.0))
   (if (<= z 1.52e+100)
     (+ (* x 2.0) (* 27.0 (* b a)))
     (* -9.0 (* t (* z y))))))
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.65e-8) {
		tmp = (z * t) * (y * -9.0);
	} else if (z <= 1.52e+100) {
		tmp = (x * 2.0) + (27.0 * (b * a));
	} else {
		tmp = -9.0 * (t * (z * y));
	}
	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.65d-8)) then
        tmp = (z * t) * (y * (-9.0d0))
    else if (z <= 1.52d+100) then
        tmp = (x * 2.0d0) + (27.0d0 * (b * a))
    else
        tmp = (-9.0d0) * (t * (z * y))
    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.65e-8) {
		tmp = (z * t) * (y * -9.0);
	} else if (z <= 1.52e+100) {
		tmp = (x * 2.0) + (27.0 * (b * a));
	} else {
		tmp = -9.0 * (t * (z * y));
	}
	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.65e-8:
		tmp = (z * t) * (y * -9.0)
	elif z <= 1.52e+100:
		tmp = (x * 2.0) + (27.0 * (b * a))
	else:
		tmp = -9.0 * (t * (z * y))
	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.65e-8)
		tmp = Float64(Float64(z * t) * Float64(y * -9.0));
	elseif (z <= 1.52e+100)
		tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(b * a)));
	else
		tmp = Float64(-9.0 * Float64(t * Float64(z * y)));
	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.65e-8)
		tmp = (z * t) * (y * -9.0);
	elseif (z <= 1.52e+100)
		tmp = (x * 2.0) + (27.0 * (b * a));
	else
		tmp = -9.0 * (t * (z * y));
	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.65e-8], N[(N[(z * t), $MachinePrecision] * N[(y * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.52e+100], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-9.0 * N[(t * N[(z * y), $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.65 \cdot 10^{-8}:\\
\;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.64999999999999989e-8

    1. Initial program 95.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-neg95.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-neg95.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*90.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*90.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. Simplified90.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. Step-by-step derivation
      1. +-commutative90.6%

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

        \[\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. *-commutative90.6%

        \[\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*90.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*90.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*90.4%

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

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

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

        \[\leadsto \color{blue}{\left(-9\right)} \cdot \left(t \cdot \left(y \cdot z\right)\right) \]
      2. distribute-lft-neg-in55.2%

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

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

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

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

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

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

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

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

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

        \[\leadsto -\color{blue}{\left(y \cdot \left(9 \cdot z\right)\right)} \cdot t \]
      12. distribute-lft-neg-in55.2%

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

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

        \[\leadsto t \cdot \left(-\color{blue}{\left(y \cdot 9\right) \cdot z}\right) \]
      15. distribute-lft-neg-in55.1%

        \[\leadsto t \cdot \color{blue}{\left(\left(-y \cdot 9\right) \cdot z\right)} \]
      16. distribute-rgt-neg-in55.1%

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \left(\left(-9 \cdot \color{blue}{\log \left(e^{y}\right)}\right) \cdot z\right) \]
      6. log-pow23.3%

        \[\leadsto t \cdot \left(\color{blue}{\log \left({\left(e^{y}\right)}^{-9}\right)} \cdot z\right) \]
      7. *-commutative23.3%

        \[\leadsto t \cdot \color{blue}{\left(z \cdot \log \left({\left(e^{y}\right)}^{-9}\right)\right)} \]
      8. associate-*r*22.9%

        \[\leadsto \color{blue}{\left(t \cdot z\right) \cdot \log \left({\left(e^{y}\right)}^{-9}\right)} \]
      9. *-commutative22.9%

        \[\leadsto \color{blue}{\log \left({\left(e^{y}\right)}^{-9}\right) \cdot \left(t \cdot z\right)} \]
      10. log-pow22.9%

        \[\leadsto \color{blue}{\left(-9 \cdot \log \left(e^{y}\right)\right)} \cdot \left(t \cdot z\right) \]
      11. rem-log-exp50.7%

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

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

    if -1.64999999999999989e-8 < z < 1.52e100

    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*97.1%

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

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

    if 1.52e100 < z

    1. Initial program 91.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-neg91.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-neg91.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*83.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*83.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. Simplified83.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 54.7%

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

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

Alternative 10: 47.4% 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}\;x \leq -2.9 \cdot 10^{+51} \lor \neg \left(x \leq 2300000000\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(b \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 (or (<= x -2.9e+51) (not (<= x 2300000000.0)))
   (* x 2.0)
   (* 27.0 (* b 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 ((x <= -2.9e+51) || !(x <= 2300000000.0)) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (b * 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 ((x <= (-2.9d+51)) .or. (.not. (x <= 2300000000.0d0))) then
        tmp = x * 2.0d0
    else
        tmp = 27.0d0 * (b * 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 ((x <= -2.9e+51) || !(x <= 2300000000.0)) {
		tmp = x * 2.0;
	} else {
		tmp = 27.0 * (b * 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 (x <= -2.9e+51) or not (x <= 2300000000.0):
		tmp = x * 2.0
	else:
		tmp = 27.0 * (b * 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 ((x <= -2.9e+51) || !(x <= 2300000000.0))
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(27.0 * Float64(b * 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 ((x <= -2.9e+51) || ~((x <= 2300000000.0)))
		tmp = x * 2.0;
	else
		tmp = 27.0 * (b * 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[Or[LessEqual[x, -2.9e+51], N[Not[LessEqual[x, 2300000000.0]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(27.0 * N[(b * a), $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}\;x \leq -2.9 \cdot 10^{+51} \lor \neg \left(x \leq 2300000000\right):\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.8999999999999998e51 or 2.3e9 < x

    1. Initial program 96.6%

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

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

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

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

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

    if -2.8999999999999998e51 < x < 2.3e9

    1. Initial program 94.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-neg94.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-neg94.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*92.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*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.4%

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

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

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

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

Alternative 11: 47.4% 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}\;x \leq -4.4 \cdot 10^{+53} \lor \neg \left(x \leq 8000000000\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;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 (or (<= x -4.4e+53) (not (<= x 8000000000.0)))
   (* x 2.0)
   (* 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 ((x <= -4.4e+53) || !(x <= 8000000000.0)) {
		tmp = x * 2.0;
	} else {
		tmp = 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 ((x <= (-4.4d+53)) .or. (.not. (x <= 8000000000.0d0))) then
        tmp = x * 2.0d0
    else
        tmp = 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 ((x <= -4.4e+53) || !(x <= 8000000000.0)) {
		tmp = x * 2.0;
	} else {
		tmp = 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 (x <= -4.4e+53) or not (x <= 8000000000.0):
		tmp = x * 2.0
	else:
		tmp = 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 ((x <= -4.4e+53) || !(x <= 8000000000.0))
		tmp = Float64(x * 2.0);
	else
		tmp = 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 ((x <= -4.4e+53) || ~((x <= 8000000000.0)))
		tmp = x * 2.0;
	else
		tmp = 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[Or[LessEqual[x, -4.4e+53], N[Not[LessEqual[x, 8000000000.0]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(b * N[(27.0 * a), $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}\;x \leq -4.4 \cdot 10^{+53} \lor \neg \left(x \leq 8000000000\right):\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -4.39999999999999997e53 or 8e9 < x

    1. Initial program 96.6%

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

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

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

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

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

    if -4.39999999999999997e53 < x < 8e9

    1. Initial program 94.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-neg94.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-neg94.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*92.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*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. Taylor expanded in x around 0 89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 31.5% 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 95.6%

    \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
  2. Step-by-step derivation
    1. sub-neg95.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-neg95.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*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.5%

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

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

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

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

Developer target: 95.3% 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 2024027 
(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)))