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

Percentage Accurate: 95.4% → 98.9%
Time: 13.1s
Alternatives: 15
Speedup: 0.4×

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.4% accurate, 1.0× speedup?

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

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

Alternative 1: 98.9% accurate, 0.1× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 6 \cdot 10^{-73}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(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.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= z 6e-73)
   (fma a (* 27.0 b) (fma x 2.0 (* y (* z (* t -9.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);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= 6e-73) {
		tmp = fma(a, (27.0 * b), fma(x, 2.0, (y * (z * (t * -9.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])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= 6e-73)
		tmp = fma(a, Float64(27.0 * b), fma(x, 2.0, Float64(y * Float64(z * Float64(t * -9.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.
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 6e-73], N[(a * N[(27.0 * b), $MachinePrecision] + N[(x * 2.0 + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 6 \cdot 10^{-73}:\\
\;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(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 < 6e-73

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

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

    if 6e-73 < 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*93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 6 \cdot 10^{-73}:\\ \;\;\;\;\mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, y \cdot \left(z \cdot \left(t \cdot -9\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(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: 98.2% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (*.f64 y #s(literal 9 binary64)) z) < 4.00000000000000006e263

    1. Initial program 96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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*97.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*97.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-197.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*97.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. Simplified97.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

    if 4.00000000000000006e263 < (*.f64 (*.f64 y #s(literal 9 binary64)) z)

    1. Initial program 82.1%

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

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

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

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

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

      \[\leadsto \color{blue}{z \cdot \left(27 \cdot \frac{a \cdot b}{z} - 9 \cdot \left(t \cdot y\right)\right)} \]
    7. Step-by-step derivation
      1. associate-/l*95.5%

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

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

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

Alternative 3: 95.9% accurate, 0.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b)) < +inf.0

    1. Initial program 97.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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*97.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-197.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*97.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. Simplified97.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-undefine97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if +inf.0 < (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in t around inf 100.0%

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

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

Alternative 4: 95.7% accurate, 0.4× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b)) < +inf.0

    1. Initial program 97.6%

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

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

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

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

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

    if +inf.0 < (+.f64 (-.f64 (*.f64 x #s(literal 2 binary64)) (*.f64 (*.f64 (*.f64 y #s(literal 9 binary64)) z) t)) (*.f64 (*.f64 a #s(literal 27 binary64)) b))

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in t around inf 100.0%

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

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

Alternative 5: 76.1% accurate, 0.8× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -1.22000000000000002e76 or 1.24999999999999999e-160 < y

    1. Initial program 92.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.22000000000000002e76 < y < 1.24999999999999999e-160

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*98.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-in98.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. *-commutative98.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-inv98.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-98.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*98.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-define98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 78.1% accurate, 0.8× speedup?

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

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

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


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

    1. Initial program 88.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. +-commutative88.8%

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*80.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-in80.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. *-commutative80.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-inv80.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-80.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*80.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-define87.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-inv87.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-define87.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-in87.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-in87.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. *-commutative87.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.4%

        \[\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-undefine88.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-undefine88.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+88.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. *-commutative88.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.1999999999999997e75 < y < 2.8000000000000002e-159

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*98.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-in98.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. *-commutative98.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-inv98.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-98.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*98.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-define98.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8000000000000002e-159 < y

    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*93.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*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 a around 0 59.3%

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

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

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

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

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

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

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

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

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

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

Alternative 7: 76.1% accurate, 0.8× speedup?

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

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

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


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

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

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

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

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

    if -4.19999999999999997e75 < y < 2.8000000000000002e-159

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*98.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-in98.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. *-commutative98.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-inv98.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-98.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*98.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-define98.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.8000000000000002e-159 < y

    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*93.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*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 a around 0 59.3%

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.8% accurate, 0.9× speedup?

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

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

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


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

    1. Initial program 88.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. +-commutative88.8%

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*80.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-in80.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. *-commutative80.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-inv80.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-80.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*80.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-define87.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-inv87.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-define87.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-in87.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-in87.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. *-commutative87.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.4%

        \[\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. Taylor expanded in t around inf 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.9000000000000004e75 < y < 1.49999999999999996e-108

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in t around 0 85.8%

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

    if 1.49999999999999996e-108 < y

    1. Initial program 92.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. +-commutative92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 48.5% accurate, 1.0× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.2000000000000005e69 or 2.8000000000000002e-159 < y

    1. Initial program 92.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. +-commutative92.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-92.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. *-commutative92.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-inv92.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*89.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Taylor expanded in t around inf 54.7%

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

    if -7.2000000000000005e69 < y < 2.8000000000000002e-159

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*98.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-in98.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. *-commutative98.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-inv98.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-98.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*98.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-define98.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in b around inf 76.0%

      \[\leadsto \color{blue}{b \cdot \left(2 \cdot \frac{x}{b} + 27 \cdot a\right)} \]
    7. Taylor expanded in x around 0 49.9%

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

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

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

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

Alternative 10: 50.1% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 88.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. +-commutative88.8%

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*80.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-in80.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. *-commutative80.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-inv80.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-80.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*80.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-define87.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-inv87.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-define87.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-in87.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-in87.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. *-commutative87.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.4%

        \[\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. Taylor expanded in t around inf 76.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.60000000000000023e75 < y < 2.8000000000000002e-159

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*98.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-in98.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. *-commutative98.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-inv98.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-98.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*98.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-define98.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in b around inf 76.0%

      \[\leadsto \color{blue}{b \cdot \left(2 \cdot \frac{x}{b} + 27 \cdot a\right)} \]
    7. Taylor expanded in x around 0 49.9%

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

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

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

    if 2.8000000000000002e-159 < y

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right) \]
      11. fma-define95.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-inv95.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-define95.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-in95.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-in95.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. *-commutative95.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*95.9%

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

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

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

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

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

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

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

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

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

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

Alternative 11: 48.5% accurate, 1.0× speedup?

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

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

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


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

    1. Initial program 88.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. +-commutative88.8%

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*80.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-in80.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. *-commutative80.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-inv80.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-80.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*80.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-define87.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-inv87.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-define87.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-in87.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-in87.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. *-commutative87.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.4%

        \[\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. Taylor expanded in t around inf 76.2%

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

    if -5.2000000000000004e69 < y < 2.8000000000000002e-159

    1. Initial program 99.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*98.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-in98.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. *-commutative98.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-inv98.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-98.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*98.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-define98.9%

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in b around inf 76.0%

      \[\leadsto \color{blue}{b \cdot \left(2 \cdot \frac{x}{b} + 27 \cdot a\right)} \]
    7. Taylor expanded in x around 0 49.9%

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

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

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

    if 2.8000000000000002e-159 < y

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{a \cdot \left(27 \cdot b\right)} + \left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot t\right) \cdot z\right) \]
      11. fma-define95.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-inv95.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-define95.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-in95.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-in95.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. *-commutative95.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*95.9%

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 45.8% accurate, 1.1× speedup?

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

    1. Initial program 93.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*90.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-in90.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. *-commutative90.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-inv90.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-90.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*90.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-define94.0%

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000004e-169 < b < 2.20000000000000009e-40

    1. Initial program 97.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*97.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-in97.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. *-commutative97.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-inv97.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-97.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*97.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-define97.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in x around inf 43.1%

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

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

Alternative 13: 45.7% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in a around inf 60.1%

      \[\leadsto \color{blue}{a \cdot \left(2 \cdot \frac{x}{a} + 27 \cdot b\right)} \]
    7. Taylor expanded in x around 0 42.7%

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

    if -1.0999999999999999e-168 < b < 1.25000000000000001e-42

    1. Initial program 97.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*97.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-in97.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. *-commutative97.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-inv97.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-97.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*97.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-define97.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in x around inf 43.1%

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

    if 1.25000000000000001e-42 < b

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*88.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-in88.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. *-commutative88.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-inv88.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-88.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*88.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot \left(-z\right)\right)}\right)\right) \]
      18. associate-*l*98.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-198.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*98.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. Simplified98.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. Taylor expanded in t around 0 70.3%

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in b around inf 70.2%

      \[\leadsto \color{blue}{b \cdot \left(2 \cdot \frac{x}{b} + 27 \cdot a\right)} \]
    7. Taylor expanded in x around 0 64.6%

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

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

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

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

Alternative 14: 45.7% accurate, 1.1× speedup?

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

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

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


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

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in a around inf 60.1%

      \[\leadsto \color{blue}{a \cdot \left(2 \cdot \frac{x}{a} + 27 \cdot b\right)} \]
    7. Taylor expanded in x around 0 42.7%

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

    if -2.34999999999999995e-169 < b < 2.10000000000000006e-42

    1. Initial program 97.8%

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*97.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-in97.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. *-commutative97.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-inv97.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-97.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*97.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-define97.9%

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    6. Taylor expanded in x around inf 43.1%

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

    if 2.10000000000000006e-42 < b

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

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

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

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

        \[\leadsto \color{blue}{\left(\left(a \cdot 27\right) \cdot b + x \cdot 2\right) + \left(-t\right) \cdot \left(\left(y \cdot 9\right) \cdot z\right)} \]
      5. associate-*r*88.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-in88.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. *-commutative88.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-inv88.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-88.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*88.0%

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \color{blue}{t \cdot \left(\left(y \cdot 9\right) \cdot \left(-z\right)\right)}\right)\right) \]
      18. associate-*l*98.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-198.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*98.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. Simplified98.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. Taylor expanded in a around inf 64.6%

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

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

Alternative 15: 29.9% accurate, 5.7× speedup?

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

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

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

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

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

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

      \[\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-define95.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-inv95.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-define95.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-in95.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-in95.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. *-commutative95.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*97.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*97.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-197.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*97.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. Simplified97.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. Taylor expanded in t around 0 62.1%

    \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
  6. Taylor expanded in x around inf 25.2%

    \[\leadsto \color{blue}{2 \cdot x} \]
  7. Final simplification25.2%

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

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

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

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