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

Percentage Accurate: 95.2% → 98.3%
Time: 13.8s
Alternatives: 15
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 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.2% 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.3% 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}\;t \leq 3.5 \cdot 10^{+190}:\\ \;\;\;\;\left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \left(y \cdot \left(-9 \cdot z\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 (<= t 3.5e+190)
   (+ (- (* x 2.0) (* (* t z) (* y 9.0))) (* a (* 27.0 b)))
   (fma a (* 27.0 b) (fma x 2.0 (* t (* y (* -9.0 z)))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= 3.5e+190) {
		tmp = ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
	} else {
		tmp = fma(a, (27.0 * b), fma(x, 2.0, (t * (y * (-9.0 * z)))));
	}
	return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b])
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= 3.5e+190)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(t * z) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b)));
	else
		tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(t * Float64(y * Float64(-9.0 * z)))));
	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[t, 3.5e+190], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(t * z), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(t * N[(y * N[(-9.0 * z), $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}\;t \leq 3.5 \cdot 10^{+190}:\\
\;\;\;\;\left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)\\

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


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

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

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

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

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

    if 3.4999999999999999e190 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \color{blue}{\left(t \cdot \left(y \cdot 9\right)\right)} \cdot \left(-z\right)\right)\right) \]
      17. associate-*r*99.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*99.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-199.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*99.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. Simplified99.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 simplification95.9%

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

Alternative 2: 96.1% 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])\\ \\ \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(-9 \cdot \left(t \cdot z\right)\right)\right)\right) \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
 (fma a (* 27.0 b) (fma x 2.0 (* y (* -9.0 (* t z))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return fma(a, (27.0 * b), fma(x, 2.0, (y * (-9.0 * (t * z)))));
}
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 fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(-9.0 * Float64(t * z)))))
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[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(-9.0 * N[(t * z), $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])\\
\\
\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(-9 \cdot \left(t \cdot z\right)\right)\right)\right)
\end{array}
Derivation
  1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 48.3% accurate, 0.5× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\ [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(a \cdot b\right)\\ t_2 := -9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\ \mathbf{if}\;y \leq -1.8 \cdot 10^{+147}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{+62}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{+31}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-111}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-201}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-116}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_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 (* 27.0 (* a b))) (t_2 (* -9.0 (* y (* t z)))))
   (if (<= y -1.8e+147)
     t_2
     (if (<= y -1.3e+62)
       t_1
       (if (<= y -6.5e+31)
         (* x 2.0)
         (if (<= y -1.1e-111)
           (* a (* 27.0 b))
           (if (<= y -1.5e-201) (* x 2.0) (if (<= y 6e-116) t_1 t_2))))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 27.0 * (a * b);
	double t_2 = -9.0 * (y * (t * z));
	double tmp;
	if (y <= -1.8e+147) {
		tmp = t_2;
	} else if (y <= -1.3e+62) {
		tmp = t_1;
	} else if (y <= -6.5e+31) {
		tmp = x * 2.0;
	} else if (y <= -1.1e-111) {
		tmp = a * (27.0 * b);
	} else if (y <= -1.5e-201) {
		tmp = x * 2.0;
	} else if (y <= 6e-116) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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 = 27.0d0 * (a * b)
    t_2 = (-9.0d0) * (y * (t * z))
    if (y <= (-1.8d+147)) then
        tmp = t_2
    else if (y <= (-1.3d+62)) then
        tmp = t_1
    else if (y <= (-6.5d+31)) then
        tmp = x * 2.0d0
    else if (y <= (-1.1d-111)) then
        tmp = a * (27.0d0 * b)
    else if (y <= (-1.5d-201)) then
        tmp = x * 2.0d0
    else if (y <= 6d-116) then
        tmp = t_1
    else
        tmp = t_2
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = 27.0 * (a * b);
	double t_2 = -9.0 * (y * (t * z));
	double tmp;
	if (y <= -1.8e+147) {
		tmp = t_2;
	} else if (y <= -1.3e+62) {
		tmp = t_1;
	} else if (y <= -6.5e+31) {
		tmp = x * 2.0;
	} else if (y <= -1.1e-111) {
		tmp = a * (27.0 * b);
	} else if (y <= -1.5e-201) {
		tmp = x * 2.0;
	} else if (y <= 6e-116) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	t_1 = 27.0 * (a * b)
	t_2 = -9.0 * (y * (t * z))
	tmp = 0
	if y <= -1.8e+147:
		tmp = t_2
	elif y <= -1.3e+62:
		tmp = t_1
	elif y <= -6.5e+31:
		tmp = x * 2.0
	elif y <= -1.1e-111:
		tmp = a * (27.0 * b)
	elif y <= -1.5e-201:
		tmp = x * 2.0
	elif y <= 6e-116:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	t_1 = Float64(27.0 * Float64(a * b))
	t_2 = Float64(-9.0 * Float64(y * Float64(t * z)))
	tmp = 0.0
	if (y <= -1.8e+147)
		tmp = t_2;
	elseif (y <= -1.3e+62)
		tmp = t_1;
	elseif (y <= -6.5e+31)
		tmp = Float64(x * 2.0);
	elseif (y <= -1.1e-111)
		tmp = Float64(a * Float64(27.0 * b));
	elseif (y <= -1.5e-201)
		tmp = Float64(x * 2.0);
	elseif (y <= 6e-116)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = 27.0 * (a * b);
	t_2 = -9.0 * (y * (t * z));
	tmp = 0.0;
	if (y <= -1.8e+147)
		tmp = t_2;
	elseif (y <= -1.3e+62)
		tmp = t_1;
	elseif (y <= -6.5e+31)
		tmp = x * 2.0;
	elseif (y <= -1.1e-111)
		tmp = a * (27.0 * b);
	elseif (y <= -1.5e-201)
		tmp = x * 2.0;
	elseif (y <= 6e-116)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.8e+147], t$95$2, If[LessEqual[y, -1.3e+62], t$95$1, If[LessEqual[y, -6.5e+31], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, -1.1e-111], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.5e-201], N[(x * 2.0), $MachinePrecision], If[LessEqual[y, 6e-116], t$95$1, t$95$2]]]]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\
\mathbf{if}\;y \leq -1.8 \cdot 10^{+147}:\\
\;\;\;\;t\_2\\

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

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

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

\mathbf{elif}\;y \leq -1.5 \cdot 10^{-201}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;y \leq 6 \cdot 10^{-116}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if y < -1.8000000000000001e147 or 6.00000000000000053e-116 < y

    1. Initial program 91.5%

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

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

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

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

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

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

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

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

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

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

    if -1.8000000000000001e147 < y < -1.29999999999999992e62 or -1.50000000000000001e-201 < y < 6.00000000000000053e-116

    1. Initial program 94.6%

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

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

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

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

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

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

    if -1.29999999999999992e62 < y < -6.5000000000000004e31 or -1.1e-111 < y < -1.50000000000000001e-201

    1. Initial program 99.9%

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

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

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

    if -6.5000000000000004e31 < y < -1.1e-111

    1. Initial program 93.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.8 \cdot 10^{+147}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\ \mathbf{elif}\;y \leq -1.3 \cdot 10^{+62}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;y \leq -6.5 \cdot 10^{+31}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq -1.1 \cdot 10^{-111}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;y \leq -1.5 \cdot 10^{-201}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;y \leq 6 \cdot 10^{-116}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 48.5% accurate, 0.5× speedup?

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

\mathbf{elif}\;b \leq 2.3 \cdot 10^{-200}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;b \leq 1.8 \cdot 10^{+61}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;b \leq 5.2 \cdot 10^{+111}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.29999999999999988e-73 or 5.1999999999999997e111 < b

    1. Initial program 93.5%

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

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

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

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

    if -2.29999999999999988e-73 < b < 2.30000000000000007e-200 or 2.0499999999999999e-10 < b < 1.80000000000000005e61 or 5.39999999999999997e100 < b < 5.1999999999999997e111

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

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

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

    if 2.30000000000000007e-200 < b < 2.0499999999999999e-10

    1. Initial program 97.6%

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

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

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

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

    if 1.80000000000000005e61 < b < 5.39999999999999997e100

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.3 \cdot 10^{-73}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-200}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 2.05 \cdot 10^{-10}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;b \leq 1.8 \cdot 10^{+61}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 5.4 \cdot 10^{+100}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{+111}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 47.6% accurate, 0.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])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -1.16 \cdot 10^{-73} \lor \neg \left(b \leq 1.7 \cdot 10^{+61}\right) \land \left(b \leq 4.6 \cdot 10^{+100} \lor \neg \left(b \leq 1.5 \cdot 10^{+117}\right)\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 -1.16e-73)
         (and (not (<= b 1.7e+61)) (or (<= b 4.6e+100) (not (<= b 1.5e+117)))))
   (* 27.0 (* a b))
   (* x 2.0)))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if ((b <= -1.16e-73) || (!(b <= 1.7e+61) && ((b <= 4.6e+100) || !(b <= 1.5e+117)))) {
		tmp = 27.0 * (a * b);
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= (-1.16d-73)) .or. (.not. (b <= 1.7d+61)) .and. (b <= 4.6d+100) .or. (.not. (b <= 1.5d+117))) then
        tmp = 27.0d0 * (a * b)
    else
        tmp = x * 2.0d0
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
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 <= -1.16e-73) || (!(b <= 1.7e+61) && ((b <= 4.6e+100) || !(b <= 1.5e+117)))) {
		tmp = 27.0 * (a * b);
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
[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 <= -1.16e-73) or (not (b <= 1.7e+61) and ((b <= 4.6e+100) or not (b <= 1.5e+117))):
		tmp = 27.0 * (a * b)
	else:
		tmp = x * 2.0
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
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 <= -1.16e-73) || (!(b <= 1.7e+61) && ((b <= 4.6e+100) || !(b <= 1.5e+117))))
		tmp = Float64(27.0 * Float64(a * b));
	else
		tmp = Float64(x * 2.0);
	end
	return tmp
end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
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 <= -1.16e-73) || (~((b <= 1.7e+61)) && ((b <= 4.6e+100) || ~((b <= 1.5e+117)))))
		tmp = 27.0 * (a * b);
	else
		tmp = x * 2.0;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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, -1.16e-73], And[N[Not[LessEqual[b, 1.7e+61]], $MachinePrecision], Or[LessEqual[b, 4.6e+100], N[Not[LessEqual[b, 1.5e+117]], $MachinePrecision]]]], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x * 2.0), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.16 \cdot 10^{-73} \lor \neg \left(b \leq 1.7 \cdot 10^{+61}\right) \land \left(b \leq 4.6 \cdot 10^{+100} \lor \neg \left(b \leq 1.5 \cdot 10^{+117}\right)\right):\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.16e-73 or 1.70000000000000013e61 < b < 4.5999999999999998e100 or 1.5e117 < b

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

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

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

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

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

    if -1.16e-73 < b < 1.70000000000000013e61 or 4.5999999999999998e100 < b < 1.5e117

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.16 \cdot 10^{-73} \lor \neg \left(b \leq 1.7 \cdot 10^{+61}\right) \land \left(b \leq 4.6 \cdot 10^{+100} \lor \neg \left(b \leq 1.5 \cdot 10^{+117}\right)\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{elif}\;b \leq 2.9 \cdot 10^{+61}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;b \leq 1.95 \cdot 10^{+118}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -3.89999999999999981e-69 or 1.95e118 < b

    1. Initial program 93.4%

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

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

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

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

    if -3.89999999999999981e-69 < b < 2.9000000000000001e61 or 2.69999999999999998e100 < b < 1.95e118

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

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

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

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

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

    if 2.9000000000000001e61 < b < 2.69999999999999998e100

    1. Initial program 84.2%

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.9 \cdot 10^{-69}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 2.9 \cdot 10^{+61}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{+100}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;b \leq 1.95 \cdot 10^{+118}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

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

\mathbf{elif}\;z \leq 6.5 \cdot 10^{-45}:\\
\;\;\;\;t\_1 + x \cdot 2\\

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


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

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.80000000000000014e-148 < z < 6.4999999999999995e-45

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if 6.4999999999999995e-45 < z

    1. Initial program 83.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-neg83.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-neg83.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*91.8%

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

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

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

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

\mathbf{elif}\;z \leq 3.3 \cdot 10^{-45}:\\
\;\;\;\;t\_1 + x \cdot 2\\

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


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

    1. Initial program 93.1%

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

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

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

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

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

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

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

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

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

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

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

    if -3.04999999999999988e-148 < z < 3.3000000000000001e-45

    1. Initial program 99.8%

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

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

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

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

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

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

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

    if 3.3000000000000001e-45 < z

    1. Initial program 83.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-neg83.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-neg83.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*91.8%

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

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

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

Alternative 9: 77.9% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.29999999999999988e-73 or 4.6000000000000001e27 < b

    1. Initial program 93.4%

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

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

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

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

    if -2.29999999999999988e-73 < b < 4.6000000000000001e27

    1. Initial program 93.4%

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.9999999999999999e-69 or 1.95e118 < b

    1. Initial program 93.4%

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

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

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

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

    if -1.9999999999999999e-69 < b < 1.95e118

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 79.5% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 82.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.6e54 < y < 6.20000000000000036e-116

    1. Initial program 97.3%

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

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

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

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

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

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

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

    if 6.20000000000000036e-116 < y

    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*96.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.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. Simplified96.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 a around 0 72.9%

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.9e12 or 3.89999999999999998e-22 < z

    1. Initial program 87.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-neg87.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-neg87.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*89.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*89.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. Simplified89.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 y around inf 45.6%

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

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

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

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

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

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

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

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

    if -1.9e12 < z < 3.89999999999999998e-22

    1. Initial program 99.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-neg99.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-neg99.1%

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

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

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

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

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

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

Alternative 13: 92.8% accurate, 1.0× 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])\\ \\ a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - z \cdot \left(t \cdot \left(y \cdot 9\right)\right)\right) \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
 (+ (* a (* 27.0 b)) (- (* x 2.0) (* z (* t (* y 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) {
	return (a * (27.0 * b)) + ((x * 2.0) - (z * (t * (y * 9.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 = (a * (27.0d0 * b)) + ((x * 2.0d0) - (z * (t * (y * 9.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 (a * (27.0 * b)) + ((x * 2.0) - (z * (t * (y * 9.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 (a * (27.0 * b)) + ((x * 2.0) - (z * (t * (y * 9.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(Float64(a * Float64(27.0 * b)) + Float64(Float64(x * 2.0) - Float64(z * Float64(t * Float64(y * 9.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 = (a * (27.0 * b)) + ((x * 2.0) - (z * (t * (y * 9.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[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(z * N[(t * N[(y * 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])\\
\\
a \cdot \left(27 \cdot b\right) + \left(x \cdot 2 - z \cdot \left(t \cdot \left(y \cdot 9\right)\right)\right)
\end{array}
Derivation
  1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 95.4% accurate, 1.0× 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])\\ \\ \left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right) \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) (* (* t z) (* y 9.0))) (* a (* 27.0 b))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return ((x * 2.0) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
}
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) - ((t * z) * (y * 9.0d0))) + (a * (27.0d0 * b))
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) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
}
[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) - ((t * z) * (y * 9.0))) + (a * (27.0 * b))
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(Float64(Float64(x * 2.0) - Float64(Float64(t * z) * Float64(y * 9.0))) + Float64(a * Float64(27.0 * b)))
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) - ((t * z) * (y * 9.0))) + (a * (27.0 * b));
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[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(t * z), $MachinePrecision] * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\\\
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\left(x \cdot 2 - \left(t \cdot z\right) \cdot \left(y \cdot 9\right)\right) + a \cdot \left(27 \cdot b\right)
\end{array}
Derivation
  1. Initial program 93.4%

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

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

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

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

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

Alternative 15: 30.3% 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 93.4%

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

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

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

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

    \[\leadsto \color{blue}{2 \cdot x} \]
  6. Final simplification31.3%

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

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

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

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