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

Percentage Accurate: 95.3% → 98.5%
Time: 12.1s
Alternatives: 14
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 14 alternatives:

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

Initial Program: 95.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.5% accurate, 0.1× speedup?

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


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

    1. Initial program 95.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.9000000000000002e-60 < z

    1. Initial program 93.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.2% accurate, 0.7× speedup?

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

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


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

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

        \[\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-define93.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. cancel-sign-sub-inv93.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \color{blue}{x \cdot 2 + \left(-\left(y \cdot 9\right) \cdot t\right) \cdot z}\right) \]
      13. fma-define93.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) \]
      14. distribute-lft-neg-in93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8000000000000001e-93 < z

    1. Initial program 94.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 78.2% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -4.89999999999999988e-60 or 0.0030000000000000001 < b

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.89999999999999988e-60 < b < 0.0030000000000000001

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 79.5% accurate, 0.7× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -2.35 \cdot 10^{+60}:\\ \;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\\ \mathbf{elif}\;x \leq 2.3 \cdot 10^{+94}:\\ \;\;\;\;y \cdot \left(z \cdot \left(t \cdot -9\right)\right) + a \cdot \left(27 \cdot b\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.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= x -2.35e+60)
   (- (* x 2.0) (* (* y 9.0) (* z t)))
   (if (<= x 2.3e+94)
     (+ (* y (* z (* t -9.0))) (* a (* 27.0 b)))
     (+ (* 27.0 (* a b)) (* x 2.0)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2.35e+60) {
		tmp = (x * 2.0) - ((y * 9.0) * (z * t));
	} else if (x <= 2.3e+94) {
		tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
	} 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.
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (x <= (-2.35d+60)) then
        tmp = (x * 2.0d0) - ((y * 9.0d0) * (z * t))
    else if (x <= 2.3d+94) then
        tmp = (y * (z * (t * (-9.0d0)))) + (a * (27.0d0 * b))
    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;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (x <= -2.35e+60) {
		tmp = (x * 2.0) - ((y * 9.0) * (z * t));
	} else if (x <= 2.3e+94) {
		tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
	} else {
		tmp = (27.0 * (a * b)) + (x * 2.0);
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	tmp = 0
	if x <= -2.35e+60:
		tmp = (x * 2.0) - ((y * 9.0) * (z * t))
	elif x <= 2.3e+94:
		tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b))
	else:
		tmp = (27.0 * (a * b)) + (x * 2.0)
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (x <= -2.35e+60)
		tmp = Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t)));
	elseif (x <= 2.3e+94)
		tmp = Float64(Float64(y * Float64(z * Float64(t * -9.0))) + Float64(a * Float64(27.0 * b)));
	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])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (x <= -2.35e+60)
		tmp = (x * 2.0) - ((y * 9.0) * (z * t));
	elseif (x <= 2.3e+94)
		tmp = (y * (z * (t * -9.0))) + (a * (27.0 * b));
	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.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -2.35e+60], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e+94], N[(N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.35 \cdot 10^{+60}:\\
\;\;\;\;x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -2.3499999999999999e60

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.3499999999999999e60 < x < 2.3e94

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.3e94 < x

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 98.1% accurate, 0.8× speedup?

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

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


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

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-110 < z

    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. Add Preprocessing
  3. Recombined 2 regimes into one program.
  4. Final simplification95.3%

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

Alternative 6: 97.1% accurate, 0.8× speedup?

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

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


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

    1. Initial program 96.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. +-commutative96.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.54999999999999996e83 < z

    1. Initial program 92.2%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 75.2% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.49999999999999996e-108 or 1.5e9 < b

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

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

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

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

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

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

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

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

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

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

    if -1.49999999999999996e-108 < b < 1.5e9

    1. Initial program 95.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 77.0% accurate, 0.8× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-176}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+130}:\\ \;\;\;\;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.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t -1.9e-176)
   (* -9.0 (* z (* y t)))
   (if (<= t 1.3e+130)
     (+ (* 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);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -1.9e-176) {
		tmp = -9.0 * (z * (y * t));
	} else if (t <= 1.3e+130) {
		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.
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (t <= (-1.9d-176)) then
        tmp = (-9.0d0) * (z * (y * t))
    else if (t <= 1.3d+130) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (t <= -1.9e-176) {
		tmp = -9.0 * (z * (y * t));
	} else if (t <= 1.3e+130) {
		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])
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= -1.9e-176:
		tmp = -9.0 * (z * (y * t))
	elif t <= 1.3e+130:
		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])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= -1.9e-176)
		tmp = Float64(-9.0 * Float64(z * Float64(y * t)));
	elseif (t <= 1.3e+130)
		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])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (t <= -1.9e-176)
		tmp = -9.0 * (z * (y * t));
	elseif (t <= 1.3e+130)
		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.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.9e-176], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e+130], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.9 \cdot 10^{-176}:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\

\mathbf{elif}\;t \leq 1.3 \cdot 10^{+130}:\\
\;\;\;\;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 3 regimes
  2. if t < -1.90000000000000006e-176

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.90000000000000006e-176 < t < 1.2999999999999999e130

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.2999999999999999e130 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.9 \cdot 10^{-176}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;t \leq 1.3 \cdot 10^{+130}:\\ \;\;\;\;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 9: 76.0% accurate, 0.9× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.4e13 < z < 2.6999999999999999e23

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.6999999999999999e23 < z

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 10: 48.0% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -5.3 \cdot 10^{-42}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 1800000000:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \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.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -5.3e-42)
   (* 27.0 (* a b))
   (if (<= b 1800000000.0) (* y (* -9.0 (* z t))) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -5.3e-42) {
		tmp = 27.0 * (a * b);
	} else if (b <= 1800000000.0) {
		tmp = y * (-9.0 * (z * t));
	} 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.
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 <= (-5.3d-42)) then
        tmp = 27.0d0 * (a * b)
    else if (b <= 1800000000.0d0) then
        tmp = y * ((-9.0d0) * (z * t))
    else
        tmp = a * (27.0d0 * b)
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -5.3e-42) {
		tmp = 27.0 * (a * b);
	} else if (b <= 1800000000.0) {
		tmp = y * (-9.0 * (z * t));
	} else {
		tmp = a * (27.0 * b);
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -5.3e-42:
		tmp = 27.0 * (a * b)
	elif b <= 1800000000.0:
		tmp = y * (-9.0 * (z * t))
	else:
		tmp = a * (27.0 * b)
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -5.3e-42)
		tmp = Float64(27.0 * Float64(a * b));
	elseif (b <= 1800000000.0)
		tmp = Float64(y * Float64(-9.0 * Float64(z * t)));
	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])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -5.3e-42)
		tmp = 27.0 * (a * b);
	elseif (b <= 1800000000.0)
		tmp = y * (-9.0 * (z * t));
	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.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.3e-42], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1800000000.0], N[(y * N[(-9.0 * N[(z * t), $MachinePrecision]), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.3 \cdot 10^{-42}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -5.3e-42

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.3e-42 < b < 1.8e9

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8e9 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 48.1% accurate, 1.0× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -8.5 \cdot 10^{-42}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 11500000:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \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.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -8.5e-42)
   (* 27.0 (* a b))
   (if (<= b 11500000.0) (* -9.0 (* t (* z y))) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -8.5e-42) {
		tmp = 27.0 * (a * b);
	} else if (b <= 11500000.0) {
		tmp = -9.0 * (t * (z * y));
	} 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.
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 <= (-8.5d-42)) then
        tmp = 27.0d0 * (a * b)
    else if (b <= 11500000.0d0) then
        tmp = (-9.0d0) * (t * (z * y))
    else
        tmp = a * (27.0d0 * b)
    end if
    code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -8.5e-42) {
		tmp = 27.0 * (a * b);
	} else if (b <= 11500000.0) {
		tmp = -9.0 * (t * (z * y));
	} else {
		tmp = a * (27.0 * b);
	}
	return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b])
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -8.5e-42:
		tmp = 27.0 * (a * b)
	elif b <= 11500000.0:
		tmp = -9.0 * (t * (z * y))
	else:
		tmp = a * (27.0 * b)
	return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -8.5e-42)
		tmp = Float64(27.0 * Float64(a * b));
	elseif (b <= 11500000.0)
		tmp = Float64(-9.0 * Float64(t * Float64(z * y)));
	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])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -8.5e-42)
		tmp = 27.0 * (a * b);
	elseif (b <= 11500000.0)
		tmp = -9.0 * (t * (z * y));
	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.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.5e-42], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 11500000.0], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{-42}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -8.4999999999999996e-42

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.4999999999999996e-42 < b < 1.15e7

    1. Initial program 95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.15e7 < b

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 47.1% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -7.0000000000000004e-42 or 2.3000000000000001e-4 < b

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.0000000000000004e-42 < b < 2.3000000000000001e-4

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 47.1% accurate, 1.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -1.2 \cdot 10^{-35}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 2 \cdot 10^{-6}:\\ \;\;\;\;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.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= b -1.2e-35)
   (* 27.0 (* a b))
   (if (<= b 2e-6) (* x 2.0) (* a (* 27.0 b)))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.2e-35) {
		tmp = 27.0 * (a * b);
	} else if (b <= 2e-6) {
		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.
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.2d-35)) then
        tmp = 27.0d0 * (a * b)
    else if (b <= 2d-6) 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;
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.2e-35) {
		tmp = 27.0 * (a * b);
	} else if (b <= 2e-6) {
		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])
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -1.2e-35:
		tmp = 27.0 * (a * b)
	elif b <= 2e-6:
		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])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.2e-35)
		tmp = Float64(27.0 * Float64(a * b));
	elseif (b <= 2e-6)
		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])){:}
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (b <= -1.2e-35)
		tmp = 27.0 * (a * b);
	elseif (b <= 2e-6)
		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.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.2e-35], N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2e-6], 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])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.2 \cdot 10^{-35}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.2000000000000001e-35

    1. Initial program 98.3%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2000000000000001e-35 < b < 1.99999999999999991e-6

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.99999999999999991e-6 < b

    1. Initial program 91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 30.3% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  :alt
  (! :herbie-platform default (if (< y 7590524218811189/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x 2) (* (* (* y 9) z) t)) (* a (* 27 b))) (+ (- (* x 2) (* 9 (* y (* t z)))) (* (* a 27) b))))

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