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

Percentage Accurate: 95.5% → 98.4%
Time: 14.3s
Alternatives: 15
Speedup: 0.8×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 15 alternatives:

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

Initial Program: 95.5% accurate, 1.0× speedup?

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

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

Alternative 1: 98.4% accurate, 0.1× speedup?

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


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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right)} \]
      12. cancel-sign-sub-inv94.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-def94.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-in94.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-in94.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. *-commutative94.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*96.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 3.7999999999999997e-58 < z

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 47.8% accurate, 0.6× speedup?

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

\mathbf{elif}\;b \leq 6.3 \cdot 10^{-139}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;b \leq 7200000000:\\
\;\;\;\;t_1\\

\mathbf{elif}\;b \leq 2.55 \cdot 10^{+58}:\\
\;\;\;\;x \cdot 2\\

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

    if -3.1999999999999998e-128 < b < 6.2999999999999999e-139 or 1.85e-44 < b < 7.2e9

    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. sub-neg95.3%

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

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

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

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

    if 6.2999999999999999e-139 < b < 1.85e-44 or 7.2e9 < b < 2.55000000000000004e58

    1. Initial program 94.5%

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

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

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

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

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

    if 2.55000000000000004e58 < b

    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. sub-neg95.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.2 \cdot 10^{-128}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 6.3 \cdot 10^{-139}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 1.85 \cdot 10^{-44}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 7200000000:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 2.55 \cdot 10^{+58}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 47.1% accurate, 0.6× speedup?

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

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

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

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

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

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

    if -2.99999999999999978e-128 < b < 1.02000000000000007e-138

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.02000000000000007e-138 < b < 1.59999999999999997e-44 or 3e10 < b < 7.5e61

    1. Initial program 94.5%

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

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

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

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

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

    if 1.59999999999999997e-44 < b < 3e10

    1. Initial program 92.7%

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

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

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

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

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

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

    if 7.5e61 < b

    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. sub-neg95.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3 \cdot 10^{-128}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 1.02 \cdot 10^{-138}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;b \leq 1.6 \cdot 10^{-44}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 30000000000:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 7.5 \cdot 10^{+61}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 47.1% accurate, 0.6× speedup?

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

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

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

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

\mathbf{elif}\;b \leq 7.2 \cdot 10^{+60}:\\
\;\;\;\;x \cdot 2\\

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


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

    1. Initial program 95.8%

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

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

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

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

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

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

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

    if -3.5e-128 < b < 1.75000000000000001e-139

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.75000000000000001e-139 < b < 1.65000000000000003e-44 or 1.55e10 < b < 7.19999999999999935e60

    1. Initial program 94.5%

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

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

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

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

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

    if 1.65000000000000003e-44 < b < 1.55e10

    1. Initial program 92.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto t \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(-9 \cdot \left(y \cdot z\right)\right)\right)} \]
      2. expm1-udef32.5%

        \[\leadsto t \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(-9 \cdot \left(y \cdot z\right)\right)} - 1\right)} \]
      3. *-commutative32.5%

        \[\leadsto t \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{\left(y \cdot z\right) \cdot -9}\right)} - 1\right) \]
      4. associate-*l*32.5%

        \[\leadsto t \cdot \left(e^{\mathsf{log1p}\left(\color{blue}{y \cdot \left(z \cdot -9\right)}\right)} - 1\right) \]
    12. Applied egg-rr32.5%

      \[\leadsto t \cdot \color{blue}{\left(e^{\mathsf{log1p}\left(y \cdot \left(z \cdot -9\right)\right)} - 1\right)} \]
    13. Step-by-step derivation
      1. expm1-def33.0%

        \[\leadsto t \cdot \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(y \cdot \left(z \cdot -9\right)\right)\right)} \]
      2. expm1-log1p40.7%

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

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

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

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

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

    if 7.19999999999999935e60 < b

    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. sub-neg95.9%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -3.5 \cdot 10^{-128}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 1.75 \cdot 10^{-139}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;b \leq 1.65 \cdot 10^{-44}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 15500000000:\\ \;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\ \mathbf{elif}\;b \leq 7.2 \cdot 10^{+60}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 69.9% accurate, 0.6× speedup?

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

\mathbf{elif}\;y \leq -5.3 \cdot 10^{+218}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;y \leq 1.48 \cdot 10^{-133}:\\
\;\;\;\;t_1\\

\mathbf{else}:\\
\;\;\;\;t_2\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if y < -1.9499999999999999e245 or 1.48e-133 < y

    1. Initial program 94.7%

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

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

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

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

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

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

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

    if -1.9499999999999999e245 < y < -5.3000000000000001e218 or -1.16e175 < y < 1.48e-133

    1. Initial program 97.3%

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

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

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

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

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

    if -5.3000000000000001e218 < y < -1.16e175

    1. Initial program 74.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -1.95 \cdot 10^{+245}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;y \leq -5.3 \cdot 10^{+218}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\ \mathbf{elif}\;y \leq -1.16 \cdot 10^{+175}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;y \leq 1.48 \cdot 10^{-133}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 77.2% accurate, 0.6× speedup?

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

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

\mathbf{elif}\;b \leq 1.25 \cdot 10^{+143}:\\
\;\;\;\;t_1\\

\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 b < -1.52000000000000009e-170 or 3.69999999999999997e59 < b < 1.25000000000000003e143

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot x - \left(e^{\mathsf{log1p}\left(\color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \cdot 9\right)} - 1\right) \]
      5. associate-*l*38.0%

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

      \[\leadsto 27 \cdot \left(a \cdot b\right) - \color{blue}{\left(e^{\mathsf{log1p}\left(\left(y \cdot z\right) \cdot \left(t \cdot 9\right)\right)} - 1\right)} \]
    8. Step-by-step derivation
      1. expm1-def41.7%

        \[\leadsto 2 \cdot x - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(y \cdot z\right) \cdot \left(t \cdot 9\right)\right)\right)} \]
      2. expm1-log1p53.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.52000000000000009e-170 < b < 3.69999999999999997e59

    1. Initial program 94.9%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot x - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right)} \]
      2. expm1-udef58.6%

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

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

        \[\leadsto 2 \cdot x - \left(e^{\mathsf{log1p}\left(\color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \cdot 9\right)} - 1\right) \]
      5. associate-*l*58.6%

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

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

        \[\leadsto 2 \cdot x - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(y \cdot z\right) \cdot \left(t \cdot 9\right)\right)\right)} \]
      2. expm1-log1p82.4%

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

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

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

    if 1.25000000000000003e143 < b

    1. Initial program 94.4%

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

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

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

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

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

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

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

Alternative 7: 78.1% accurate, 0.7× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.52000000000000009e-170 or 2.05e57 < b

    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. sub-neg95.9%

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

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

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

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

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

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

    if -1.52000000000000009e-170 < b < 2.05e57

    1. Initial program 94.9%

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot x - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right)} \]
      2. expm1-udef58.6%

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

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

        \[\leadsto 2 \cdot x - \left(e^{\mathsf{log1p}\left(\color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \cdot 9\right)} - 1\right) \]
      5. associate-*l*58.6%

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

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

        \[\leadsto 2 \cdot x - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(y \cdot z\right) \cdot \left(t \cdot 9\right)\right)\right)} \]
      2. expm1-log1p82.4%

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

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

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

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

Alternative 8: 96.9% accurate, 0.8× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 8.4000000000000004e60 < z

    1. Initial program 92.4%

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

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

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

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

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

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

Alternative 9: 98.1% accurate, 0.8× speedup?

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


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

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right)} \]
      12. cancel-sign-sub-inv94.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-def94.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-in94.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-in94.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. *-commutative94.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*96.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*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-udef95.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-udef95.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. associate-*r*95.6%

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

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

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

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

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

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

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

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

      \[\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.05e8 < 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. sub-neg93.9%

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

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

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

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

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

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

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

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

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

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

Alternative 10: 98.0% accurate, 0.8× speedup?

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


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

    1. Initial program 96.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 5.00000000000000045e24 < z

    1. Initial program 93.5%

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

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

Alternative 11: 77.4% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.5e-128 or 7.0000000000000001e113 < b

    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. sub-neg95.5%

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

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

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

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

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

    if -3.5e-128 < b < 7.0000000000000001e113

    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. sub-neg95.5%

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

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

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

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

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

Alternative 12: 76.9% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -3.5e-128 or 1e114 < b

    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. sub-neg95.5%

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

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

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

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

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

    if -3.5e-128 < b < 1e114

    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. sub-neg95.5%

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

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

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

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

        \[\leadsto 2 \cdot x - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right)} \]
      2. expm1-udef56.6%

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

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

        \[\leadsto 2 \cdot x - \left(e^{\mathsf{log1p}\left(\color{blue}{\left(\left(y \cdot z\right) \cdot t\right)} \cdot 9\right)} - 1\right) \]
      5. associate-*l*56.6%

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

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

        \[\leadsto 2 \cdot x - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\left(y \cdot z\right) \cdot \left(t \cdot 9\right)\right)\right)} \]
      2. expm1-log1p80.1%

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

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

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

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

Alternative 13: 46.8% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.25000000000000003e-170 or 5.2e57 < b

    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. sub-neg95.9%

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

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

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

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

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

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

    if -1.25000000000000003e-170 < b < 5.2e57

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

Alternative 14: 46.7% accurate, 1.1× speedup?

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

\mathbf{elif}\;b \leq 2.5 \cdot 10^{+57}:\\
\;\;\;\;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.4499999999999999e-171

    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. sub-neg96.0%

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

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

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

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

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

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

    if -1.4499999999999999e-171 < b < 2.49999999999999986e57

    1. Initial program 94.9%

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

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

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

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

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

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

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

    if 2.49999999999999986e57 < b

    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. sub-neg95.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 30.3% accurate, 5.7× speedup?

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

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

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

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

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

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

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

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

Developer target: 94.9% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\ \;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(x \cdot 2 - 9 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right) + \left(a \cdot 27\right) \cdot b\\ \end{array} \end{array} \]
(FPCore (x y z t a b)
 :precision binary64
 (if (< y 7.590524218811189e-161)
   (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b)))
   (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b))))
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: tmp
    if (y < 7.590524218811189d-161) then
        tmp = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + (a * (27.0d0 * b))
    else
        tmp = ((x * 2.0d0) - (9.0d0 * (y * (t * z)))) + ((a * 27.0d0) * b)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (y < 7.590524218811189e-161) {
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	} else {
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	}
	return tmp;
}
def code(x, y, z, t, a, b):
	tmp = 0
	if y < 7.590524218811189e-161:
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b))
	else:
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b)
	return tmp
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (y < 7.590524218811189e-161)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(a * Float64(27.0 * b)));
	else
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(t * z)))) + Float64(Float64(a * 27.0) * b));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t, a, b)
	tmp = 0.0;
	if (y < 7.590524218811189e-161)
		tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + (a * (27.0 * b));
	else
		tmp = ((x * 2.0) - (9.0 * (y * (t * z)))) + ((a * 27.0) * b);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_, a_, b_] := If[Less[y, 7.590524218811189e-161], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(N[(y * 9.0), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;y < 7.590524218811189 \cdot 10^{-161}:\\
\;\;\;\;\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + a \cdot \left(27 \cdot b\right)\\

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


\end{array}
\end{array}

Reproduce

?
herbie shell --seed 2024024 
(FPCore (x y z t a b)
  :name "Diagrams.Solve.Polynomial:cubForm  from diagrams-solve-0.1, A"
  :precision binary64

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

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