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

Percentage Accurate: 95.3% → 98.8%
Time: 17.5s
Alternatives: 15
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 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.3% 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.8% accurate, 0.1× speedup?

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

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


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

    1. Initial program 95.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. +-commutative95.3%

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

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

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

        \[\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*93.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-in93.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. *-commutative93.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-inv93.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-93.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*93.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-def94.4%

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

        \[\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*97.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-in97.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. *-commutative97.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*97.0%

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

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

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

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

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

    if 1.4e-71 < z

    1. Initial program 88.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-neg88.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-neg88.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*97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 97.8% accurate, 0.1× speedup?

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

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


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

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, t \cdot -9, \mathsf{fma}\left(27 \cdot a, b, 2 \cdot x\right)\right)} \]
    8. Step-by-step derivation
      1. fma-udef95.7%

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

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

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

    if 1.00000000000000003e257 < (*.f64 (*.f64 y 9) z)

    1. Initial program 66.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-neg66.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-neg66.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*94.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*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. Step-by-step derivation
      1. +-commutative94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 48.3% accurate, 0.6× speedup?

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

\mathbf{elif}\;b \leq 1.66 \cdot 10^{-273}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 1.15 \cdot 10^{-105}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;b \leq 6 \cdot 10^{+18}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 1.9 \cdot 10^{+89}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -2.45000000000000008e-138

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

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

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

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

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

    if -2.45000000000000008e-138 < b < 1.65999999999999995e-273 or 1.15e-105 < b < 6e18

    1. Initial program 90.2%

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

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

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

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

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

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

    if 1.65999999999999995e-273 < b < 1.15e-105 or 6e18 < b < 1.90000000000000012e89

    1. Initial program 99.7%

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

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

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

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

    if 1.90000000000000012e89 < b

    1. Initial program 94.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.45 \cdot 10^{-138}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 1.66 \cdot 10^{-273}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 1.15 \cdot 10^{-105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 6 \cdot 10^{+18}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 1.9 \cdot 10^{+89}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

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

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

\mathbf{elif}\;b \leq 9.5 \cdot 10^{-107}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;b \leq 2.1 \cdot 10^{+89}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if b < -2.45000000000000008e-138

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

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

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

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

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

    if -2.45000000000000008e-138 < b < 1.57999999999999994e-273

    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*97.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*97.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. Simplified97.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 91.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, t \cdot -9, \mathsf{fma}\left(27 \cdot a, b, 2 \cdot x\right)\right)} \]
    8. Taylor expanded in y around inf 52.8%

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

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

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

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

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

    if 1.57999999999999994e-273 < b < 9.4999999999999999e-107 or 9.5e18 < b < 2.09999999999999986e89

    1. Initial program 99.7%

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

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

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

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

    if 9.4999999999999999e-107 < b < 9.5e18

    1. Initial program 87.8%

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

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

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

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

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

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

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

    if 2.09999999999999986e89 < b

    1. Initial program 94.8%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -2.45 \cdot 10^{-138}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 1.58 \cdot 10^{-273}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{-107}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 9.5 \cdot 10^{+18}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 2.1 \cdot 10^{+89}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.5% accurate, 0.6× speedup?

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

\mathbf{elif}\;z \leq 1.35 \cdot 10^{-65} \lor \neg \left(z \leq 9.5 \cdot 10^{-56}\right) \land z \leq 2.2:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\

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


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

    1. Initial program 80.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-neg80.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-neg80.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*87.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*87.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. Simplified87.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(y \cdot z, t \cdot -9, \mathsf{fma}\left(27 \cdot a, b, 2 \cdot x\right)\right)} \]
    8. Step-by-step derivation
      1. fma-udef82.7%

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

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

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

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

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

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

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

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

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

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

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

    if -5.8000000000000004e46 < z < 1.3499999999999999e-65 or 9.4999999999999991e-56 < z < 2.2000000000000002

    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*98.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*98.5%

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

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

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

    if 1.3499999999999999e-65 < z < 9.4999999999999991e-56 or 2.2000000000000002 < z

    1. Initial program 85.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-neg85.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-neg85.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.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*96.9%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+46}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 1.35 \cdot 10^{-65} \lor \neg \left(z \leq 9.5 \cdot 10^{-56}\right) \land z \leq 2.2:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 79.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} \mathbf{if}\;x \leq -170000:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 860000000000:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\ \mathbf{elif}\;x \leq 2.5 \cdot 10^{+99}:\\ \;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\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 (<= x -170000.0)
   (- (* x 2.0) (* 9.0 (* t (* z y))))
   (if (<= x 860000000000.0)
     (+ (* a (* 27.0 b)) (* t (* z (* y -9.0))))
     (if (<= x 2.5e+99)
       (+ (* x 2.0) (* -9.0 (* z (* y t))))
       (+ (* 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 (x <= -170000.0) {
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	} else if (x <= 860000000000.0) {
		tmp = (a * (27.0 * b)) + (t * (z * (y * -9.0)));
	} else if (x <= 2.5e+99) {
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	} 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 (x <= (-170000.0d0)) then
        tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
    else if (x <= 860000000000.0d0) then
        tmp = (a * (27.0d0 * b)) + (t * (z * (y * (-9.0d0))))
    else if (x <= 2.5d+99) then
        tmp = (x * 2.0d0) + ((-9.0d0) * (z * (y * t)))
    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 (x <= -170000.0) {
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	} else if (x <= 860000000000.0) {
		tmp = (a * (27.0 * b)) + (t * (z * (y * -9.0)));
	} else if (x <= 2.5e+99) {
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	} 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 x <= -170000.0:
		tmp = (x * 2.0) - (9.0 * (t * (z * y)))
	elif x <= 860000000000.0:
		tmp = (a * (27.0 * b)) + (t * (z * (y * -9.0)))
	elif x <= 2.5e+99:
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)))
	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 (x <= -170000.0)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y))));
	elseif (x <= 860000000000.0)
		tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(t * Float64(z * Float64(y * -9.0))));
	elseif (x <= 2.5e+99)
		tmp = Float64(Float64(x * 2.0) + Float64(-9.0 * Float64(z * Float64(y * t))));
	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 (x <= -170000.0)
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	elseif (x <= 860000000000.0)
		tmp = (a * (27.0 * b)) + (t * (z * (y * -9.0)));
	elseif (x <= 2.5e+99)
		tmp = (x * 2.0) + (-9.0 * (z * (y * t)));
	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[LessEqual[x, -170000.0], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 860000000000.0], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e+99], N[(N[(x * 2.0), $MachinePrecision] + N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $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}\;x \leq -170000:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\

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

\mathbf{elif}\;x \leq 2.5 \cdot 10^{+99}:\\
\;\;\;\;x \cdot 2 + -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.7e5

    1. Initial program 91.7%

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

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

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

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

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

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

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

    if -1.7e5 < x < 8.6e11

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(-9, y \cdot \left(t \cdot z\right), a \cdot \left(27 \cdot b\right)\right)} \]
    11. Step-by-step derivation
      1. fma-udef87.9%

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

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

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

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

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

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

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

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

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

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

    if 8.6e11 < x < 2.50000000000000004e99

    1. Initial program 94.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.50000000000000004e99 < x

    1. Initial program 94.8%

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

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

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

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

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

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


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

    1. Initial program 94.9%

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

    if 1.00000000000000003e257 < (*.f64 (*.f64 y 9) z)

    1. Initial program 66.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-neg66.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-neg66.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*94.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*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. Step-by-step derivation
      1. +-commutative94.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 97.6% accurate, 0.8× speedup?

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

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


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

    1. Initial program 94.9%

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

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

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

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

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

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

    if 2.2000000000000001e100 < z

    1. Initial program 82.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-neg82.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-neg82.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*94.7%

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

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

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

      \[\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. associate-*r*94.8%

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

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

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

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

Alternative 9: 97.9% accurate, 0.8× speedup?

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

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


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

    1. Initial program 95.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-neg95.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-neg95.1%

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

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

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

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

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

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

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

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

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

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

    if 5.99999999999999972e-110 < z

    1. Initial program 89.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-neg89.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-neg89.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*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.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. Simplified97.6%

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

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

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

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

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

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

      \[\leadsto \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    7. Step-by-step derivation
      1. rem-cube-cbrt97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 76.4% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.3e-138 or 8.9999999999999999e70 < b

    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*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.1%

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

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

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

    if -1.3e-138 < b < 8.9999999999999999e70

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.28e-138 or 9.5000000000000003e63 < b

    1. Initial program 92.6%

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

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

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

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

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

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

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

    if -1.28e-138 < b < 9.5000000000000003e63

    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.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*96.6%

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

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

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

Alternative 12: 93.1% 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 - 9 \cdot \left(z \cdot \left(y \cdot t\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) (* 9.0 (* z (* y t))))))
assert(x < y && y < z && z < t && t < a && a < b);
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return (a * (27.0 * b)) + ((x * 2.0) - (9.0 * (z * (y * t))));
}
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) - (9.0d0 * (z * (y * t))))
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) - (9.0 * (z * (y * t))));
}
[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) - (9.0 * (z * (y * t))))
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(9.0 * Float64(z * Float64(y * t)))))
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) - (9.0 * (z * (y * t))));
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[(9.0 * N[(z * N[(y * t), $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 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\right)
\end{array}
Derivation
  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*96.3%

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

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

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

    \[\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. associate-*r*94.6%

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

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

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

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

Alternative 13: 47.9% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.9e6 or 4.7e20 < x

    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*95.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*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 x around inf 57.7%

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

    if -3.9e6 < x < 4.7e20

    1. Initial program 92.8%

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

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

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

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

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

Alternative 14: 48.0% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2e6 or 4.90000000000000029e24 < x

    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*95.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*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 x around inf 57.7%

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

    if -2e6 < x < 4.90000000000000029e24

    1. Initial program 92.8%

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

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

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

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

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

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

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

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

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

Alternative 15: 30.6% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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