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

Percentage Accurate: 95.4% → 98.7%
Time: 15.3s
Alternatives: 15
Speedup: 0.9×

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.7% 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 -1 \cdot 10^{-35}:\\ \;\;\;\;\left(x \cdot 2 + b \cdot \left(a \cdot 27\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a, b \cdot 27, \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 -1e-35)
   (- (+ (* x 2.0) (* b (* a 27.0))) (* y (* (* z 9.0) t)))
   (fma a (* b 27.0) (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 <= -1e-35) {
		tmp = ((x * 2.0) + (b * (a * 27.0))) - (y * ((z * 9.0) * t));
	} else {
		tmp = fma(a, (b * 27.0), 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 <= -1e-35)
		tmp = Float64(Float64(Float64(x * 2.0) + Float64(b * Float64(a * 27.0))) - Float64(y * Float64(Float64(z * 9.0) * t)));
	else
		tmp = fma(a, Float64(b * 27.0), 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, -1e-35], N[(N[(N[(x * 2.0), $MachinePrecision] + N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * N[(N[(z * 9.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(b * 27.0), $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 -1 \cdot 10^{-35}:\\
\;\;\;\;\left(x \cdot 2 + b \cdot \left(a \cdot 27\right)\right) - y \cdot \left(\left(z \cdot 9\right) \cdot t\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, b \cdot 27, \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 < -1.00000000000000001e-35

    1. Initial program 94.7%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.00000000000000001e-35 < z

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

        \[\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.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-def93.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-inv93.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-def93.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. *-commutative93.6%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(y \cdot 9\right)}\right) \cdot z\right)\right) \]
      15. distribute-rgt-neg-in93.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 z\right)\right) \]
      16. distribute-lft-neg-out93.6%

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \color{blue}{t \cdot \left(\left(\left(-y\right) \cdot 9\right) \cdot z\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(\left(-y\right) \cdot \left(9 \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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.6%

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

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

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


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

    1. Initial program 92.2%

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

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

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

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

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

        \[\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*89.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-def91.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-inv91.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-def91.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. *-commutative91.1%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(y \cdot 9\right)}\right) \cdot z\right)\right) \]
      15. distribute-rgt-neg-in91.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 z\right)\right) \]
      16. distribute-lft-neg-out91.1%

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \color{blue}{\left(\left(-y\right) \cdot \left(9 \cdot z\right)\right)}\right)\right) \]
    3. Simplified94.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. Step-by-step derivation
      1. *-commutative94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.0200000000000000004 < (*.f64 y 9)

    1. Initial program 96.7%

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

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

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

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


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

    1. Initial program 96.6%

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

    if 2.0000000000000001e251 < (*.f64 (*.f64 y 9) z)

    1. Initial program 80.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-neg80.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-neg80.1%

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 96.4% accurate, 0.9× speedup?

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

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


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

    1. Initial program 97.4%

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

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

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

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

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

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

    if 1.08e7 < z

    1. Initial program 88.7%

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

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

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

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

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

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

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

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

Alternative 5: 98.4% accurate, 0.9× speedup?

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

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


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

    1. Initial program 94.9%

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

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

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

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

    if -5.00000000000000004e-51 < z

    1. Initial program 95.5%

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

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

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

\mathbf{elif}\;b \leq 2.05 \cdot 10^{-263}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;b \leq 9.2 \cdot 10^{+91}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < -1.08e-57 or 9.19999999999999965e91 < b

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

        \[\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-def96.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-inv96.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-def96.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. *-commutative96.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(y \cdot 9\right)}\right) \cdot z\right)\right) \]
      15. distribute-rgt-neg-in96.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 z\right)\right) \]
      16. distribute-lft-neg-out96.4%

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

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

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

      \[\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. Step-by-step derivation
      1. *-commutative96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.08e-57 < b < 2.0499999999999998e-263 or 6.20000000000000004e-97 < b < 9.19999999999999965e91

    1. Initial program 93.5%

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

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

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

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

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

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

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

    if 2.0499999999999998e-263 < b < 6.20000000000000004e-97

    1. Initial program 97.4%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.08 \cdot 10^{-57}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq 2.05 \cdot 10^{-263}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{-97}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 9.2 \cdot 10^{+91}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 7: 47.5% accurate, 1.1× 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}\;b \leq -5.8 \cdot 10^{-63}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-263}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-97}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 2.55 \cdot 10^{+93}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (* a 27.0))))
   (if (<= b -5.8e-63)
     t_1
     (if (<= b 7e-263)
       (* -9.0 (* t (* z y)))
       (if (<= b 6e-97)
         (* x 2.0)
         (if (<= b 2.55e+93) (* t (* -9.0 (* z y))) t_1))))))
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 (b <= -5.8e-63) {
		tmp = t_1;
	} else if (b <= 7e-263) {
		tmp = -9.0 * (t * (z * y));
	} else if (b <= 6e-97) {
		tmp = x * 2.0;
	} else if (b <= 2.55e+93) {
		tmp = t * (-9.0 * (z * y));
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = b * (a * 27.0d0)
    if (b <= (-5.8d-63)) then
        tmp = t_1
    else if (b <= 7d-263) then
        tmp = (-9.0d0) * (t * (z * y))
    else if (b <= 6d-97) then
        tmp = x * 2.0d0
    else if (b <= 2.55d+93) then
        tmp = t * ((-9.0d0) * (z * y))
    else
        tmp = t_1
    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 t_1 = b * (a * 27.0);
	double tmp;
	if (b <= -5.8e-63) {
		tmp = t_1;
	} else if (b <= 7e-263) {
		tmp = -9.0 * (t * (z * y));
	} else if (b <= 6e-97) {
		tmp = x * 2.0;
	} else if (b <= 2.55e+93) {
		tmp = t * (-9.0 * (z * y));
	} else {
		tmp = t_1;
	}
	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 b <= -5.8e-63:
		tmp = t_1
	elif b <= 7e-263:
		tmp = -9.0 * (t * (z * y))
	elif b <= 6e-97:
		tmp = x * 2.0
	elif b <= 2.55e+93:
		tmp = t * (-9.0 * (z * y))
	else:
		tmp = t_1
	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 (b <= -5.8e-63)
		tmp = t_1;
	elseif (b <= 7e-263)
		tmp = Float64(-9.0 * Float64(t * Float64(z * y)));
	elseif (b <= 6e-97)
		tmp = Float64(x * 2.0);
	elseif (b <= 2.55e+93)
		tmp = Float64(t * Float64(-9.0 * Float64(z * y)));
	else
		tmp = t_1;
	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 (b <= -5.8e-63)
		tmp = t_1;
	elseif (b <= 7e-263)
		tmp = -9.0 * (t * (z * y));
	elseif (b <= 6e-97)
		tmp = x * 2.0;
	elseif (b <= 2.55e+93)
		tmp = t * (-9.0 * (z * y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.8e-63], t$95$1, If[LessEqual[b, 7e-263], N[(-9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e-97], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 2.55e+93], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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}\;b \leq -5.8 \cdot 10^{-63}:\\
\;\;\;\;t_1\\

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -5.7999999999999995e-63 or 2.5499999999999998e93 < b

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

        \[\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-def96.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-inv96.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-def96.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. *-commutative96.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(y \cdot 9\right)}\right) \cdot z\right)\right) \]
      15. distribute-rgt-neg-in96.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 z\right)\right) \]
      16. distribute-lft-neg-out96.4%

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

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

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

      \[\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. Step-by-step derivation
      1. *-commutative96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.7999999999999995e-63 < b < 6.99999999999999938e-263

    1. Initial program 93.8%

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

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

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

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

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

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

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

    if 6.99999999999999938e-263 < b < 6.00000000000000048e-97

    1. Initial program 97.4%

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

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

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

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

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

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

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

    if 6.00000000000000048e-97 < b < 2.5499999999999998e93

    1. Initial program 93.0%

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(y \cdot 9\right)}\right) \cdot z\right)\right) \]
      15. distribute-rgt-neg-in93.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 z\right)\right) \]
      16. distribute-lft-neg-out93.6%

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \color{blue}{\left(\left(-y\right) \cdot \left(9 \cdot z\right)\right)}\right)\right) \]
    3. Simplified93.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. Step-by-step derivation
      1. *-commutative93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -5.8 \cdot 10^{-63}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq 7 \cdot 10^{-263}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;b \leq 6 \cdot 10^{-97}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 2.55 \cdot 10^{+93}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 8: 47.6% accurate, 1.1× 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}\;b \leq -1.02 \cdot 10^{-57}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{-263}:\\ \;\;\;\;\left(z \cdot y\right) \cdot \left(t \cdot -9\right)\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-96}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 5.9 \cdot 10^{+93}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* b (* a 27.0))))
   (if (<= b -1.02e-57)
     t_1
     (if (<= b 6.2e-263)
       (* (* z y) (* t -9.0))
       (if (<= b 2.3e-96)
         (* x 2.0)
         (if (<= b 5.9e+93) (* t (* -9.0 (* z y))) t_1))))))
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 (b <= -1.02e-57) {
		tmp = t_1;
	} else if (b <= 6.2e-263) {
		tmp = (z * y) * (t * -9.0);
	} else if (b <= 2.3e-96) {
		tmp = x * 2.0;
	} else if (b <= 5.9e+93) {
		tmp = t * (-9.0 * (z * y));
	} else {
		tmp = t_1;
	}
	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) :: t_1
    real(8) :: tmp
    t_1 = b * (a * 27.0d0)
    if (b <= (-1.02d-57)) then
        tmp = t_1
    else if (b <= 6.2d-263) then
        tmp = (z * y) * (t * (-9.0d0))
    else if (b <= 2.3d-96) then
        tmp = x * 2.0d0
    else if (b <= 5.9d+93) then
        tmp = t * ((-9.0d0) * (z * y))
    else
        tmp = t_1
    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 t_1 = b * (a * 27.0);
	double tmp;
	if (b <= -1.02e-57) {
		tmp = t_1;
	} else if (b <= 6.2e-263) {
		tmp = (z * y) * (t * -9.0);
	} else if (b <= 2.3e-96) {
		tmp = x * 2.0;
	} else if (b <= 5.9e+93) {
		tmp = t * (-9.0 * (z * y));
	} else {
		tmp = t_1;
	}
	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 b <= -1.02e-57:
		tmp = t_1
	elif b <= 6.2e-263:
		tmp = (z * y) * (t * -9.0)
	elif b <= 2.3e-96:
		tmp = x * 2.0
	elif b <= 5.9e+93:
		tmp = t * (-9.0 * (z * y))
	else:
		tmp = t_1
	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 (b <= -1.02e-57)
		tmp = t_1;
	elseif (b <= 6.2e-263)
		tmp = Float64(Float64(z * y) * Float64(t * -9.0));
	elseif (b <= 2.3e-96)
		tmp = Float64(x * 2.0);
	elseif (b <= 5.9e+93)
		tmp = Float64(t * Float64(-9.0 * Float64(z * y)));
	else
		tmp = t_1;
	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 (b <= -1.02e-57)
		tmp = t_1;
	elseif (b <= 6.2e-263)
		tmp = (z * y) * (t * -9.0);
	elseif (b <= 2.3e-96)
		tmp = x * 2.0;
	elseif (b <= 5.9e+93)
		tmp = t * (-9.0 * (z * y));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.02e-57], t$95$1, If[LessEqual[b, 6.2e-263], N[(N[(z * y), $MachinePrecision] * N[(t * -9.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-96], N[(x * 2.0), $MachinePrecision], If[LessEqual[b, 5.9e+93], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\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}\;b \leq -1.02 \cdot 10^{-57}:\\
\;\;\;\;t_1\\

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

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

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

\mathbf{else}:\\
\;\;\;\;t_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -1.02e-57 or 5.90000000000000008e93 < b

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

        \[\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-def96.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-inv96.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-def96.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. *-commutative96.4%

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(y \cdot 9\right)}\right) \cdot z\right)\right) \]
      15. distribute-rgt-neg-in96.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 z\right)\right) \]
      16. distribute-lft-neg-out96.4%

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

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

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

      \[\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. Step-by-step derivation
      1. *-commutative96.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.02e-57 < b < 6.20000000000000008e-263

    1. Initial program 93.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.20000000000000008e-263 < b < 2.3e-96

    1. Initial program 97.4%

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

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

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

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

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

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

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

    if 2.3e-96 < b < 5.90000000000000008e93

    1. Initial program 93.0%

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, \left(-\color{blue}{t \cdot \left(y \cdot 9\right)}\right) \cdot z\right)\right) \]
      15. distribute-rgt-neg-in93.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 z\right)\right) \]
      16. distribute-lft-neg-out93.6%

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \color{blue}{\left(\left(-y\right) \cdot \left(9 \cdot z\right)\right)}\right)\right) \]
    3. Simplified93.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. Step-by-step derivation
      1. *-commutative93.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.02 \cdot 10^{-57}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq 6.2 \cdot 10^{-263}:\\ \;\;\;\;\left(z \cdot y\right) \cdot \left(t \cdot -9\right)\\ \mathbf{elif}\;b \leq 2.3 \cdot 10^{-96}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;b \leq 5.9 \cdot 10^{+93}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 9: 78.3% 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}\;z \leq -2.9 \cdot 10^{-73} \lor \neg \left(z \leq 3.3 \cdot 10^{-97}\right):\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \cdot 27\right) + x \cdot 2\\ \end{array} \end{array} \]
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (or (<= z -2.9e-73) (not (<= z 3.3e-97)))
   (- (* x 2.0) (* 9.0 (* t (* z y))))
   (+ (* a (* b 27.0)) (* 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 ((z <= -2.9e-73) || !(z <= 3.3e-97)) {
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	} else {
		tmp = (a * (b * 27.0)) + (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 ((z <= (-2.9d-73)) .or. (.not. (z <= 3.3d-97))) then
        tmp = (x * 2.0d0) - (9.0d0 * (t * (z * y)))
    else
        tmp = (a * (b * 27.0d0)) + (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 ((z <= -2.9e-73) || !(z <= 3.3e-97)) {
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	} else {
		tmp = (a * (b * 27.0)) + (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 (z <= -2.9e-73) or not (z <= 3.3e-97):
		tmp = (x * 2.0) - (9.0 * (t * (z * y)))
	else:
		tmp = (a * (b * 27.0)) + (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 ((z <= -2.9e-73) || !(z <= 3.3e-97))
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(t * Float64(z * y))));
	else
		tmp = Float64(Float64(a * Float64(b * 27.0)) + 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 ((z <= -2.9e-73) || ~((z <= 3.3e-97)))
		tmp = (x * 2.0) - (9.0 * (t * (z * y)));
	else
		tmp = (a * (b * 27.0)) + (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[z, -2.9e-73], N[Not[LessEqual[z, 3.3e-97]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(t * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(b * 27.0), $MachinePrecision]), $MachinePrecision] + N[(x * 2.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-73} \lor \neg \left(z \leq 3.3 \cdot 10^{-97}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.9e-73 or 3.3000000000000001e-97 < z

    1. Initial program 93.2%

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

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

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

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

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

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

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

    if -2.9e-73 < z < 3.3000000000000001e-97

    1. Initial program 98.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-neg98.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-neg98.8%

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot b\right) \cdot 27 + \color{blue}{x \cdot 2} \]
      4. fma-def87.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot b, 27, x \cdot 2\right)} \]
    6. Applied egg-rr87.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot b, 27, x \cdot 2\right)} \]
    7. Step-by-step derivation
      1. fma-udef87.0%

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(27 \cdot b\right)} + 2 \cdot x \]
      5. +-commutative87.0%

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

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

        \[\leadsto x \cdot 2 + a \cdot \color{blue}{\left(b \cdot 27\right)} \]
    8. Applied egg-rr87.0%

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.9999999999999998e-75 < z < 1.00000000000000004e-97

    1. Initial program 98.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-neg98.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-neg98.8%

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

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

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

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

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

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

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

        \[\leadsto \left(a \cdot b\right) \cdot 27 + \color{blue}{x \cdot 2} \]
      4. fma-def87.0%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot b, 27, x \cdot 2\right)} \]
    6. Applied egg-rr87.0%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot b, 27, x \cdot 2\right)} \]
    7. Step-by-step derivation
      1. fma-udef87.0%

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

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

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

        \[\leadsto a \cdot \color{blue}{\left(27 \cdot b\right)} + 2 \cdot x \]
      5. +-commutative87.0%

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

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

        \[\leadsto x \cdot 2 + a \cdot \color{blue}{\left(b \cdot 27\right)} \]
    8. Applied egg-rr87.0%

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

    if 1.00000000000000004e-97 < z

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

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

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

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

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

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

Alternative 11: 76.0% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.5499999999999999e-52 < z < 1.42e26

    1. Initial program 99.0%

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

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

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

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

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

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

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

    if 1.42e26 < z

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1.55 \cdot 10^{-52}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 1.42 \cdot 10^{+26}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(b \cdot a\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \end{array} \]

Alternative 12: 75.9% accurate, 1.3× speedup?

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

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

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


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

    1. Initial program 94.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.00000000000000002e-51 < z < 1.85e15

    1. Initial program 99.0%

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. +-commutative83.2%

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

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

        \[\leadsto \left(a \cdot b\right) \cdot 27 + \color{blue}{x \cdot 2} \]
      4. fma-def83.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot b, 27, x \cdot 2\right)} \]
    6. Applied egg-rr83.1%

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

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

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

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

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

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

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

        \[\leadsto x \cdot 2 + a \cdot \color{blue}{\left(b \cdot 27\right)} \]
    8. Applied egg-rr83.2%

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

    if 1.85e15 < z

    1. Initial program 88.3%

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3 \cdot 10^{-51}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 1.85 \cdot 10^{+15}:\\ \;\;\;\;a \cdot \left(b \cdot 27\right) + x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \end{array} \]

Alternative 13: 47.2% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -2.30000000000000016e118 or 5.80000000000000027e95 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -2.30000000000000016e118 < x < 5.80000000000000027e95

    1. Initial program 93.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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 z\right)\right) \]
      16. distribute-lft-neg-out95.2%

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, \mathsf{fma}\left(x, 2, t \cdot \color{blue}{\left(\left(-y\right) \cdot \left(9 \cdot z\right)\right)}\right)\right) \]
    3. Simplified95.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. Step-by-step derivation
      1. *-commutative95.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.3 \cdot 10^{+118} \lor \neg \left(x \leq 5.8 \cdot 10^{+95}\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(b \cdot a\right)\\ \end{array} \]

Alternative 14: 47.1% accurate, 1.9× speedup?

\[\begin{array}{l} [x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\ \\ \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{+118} \lor \neg \left(x \leq 3.7 \cdot 10^{+95}\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \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 (<= x -3.9e+118) (not (<= x 3.7e+95))) (* x 2.0) (* a (* b 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 ((x <= -3.9e+118) || !(x <= 3.7e+95)) {
		tmp = x * 2.0;
	} else {
		tmp = a * (b * 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 ((x <= (-3.9d+118)) .or. (.not. (x <= 3.7d+95))) then
        tmp = x * 2.0d0
    else
        tmp = a * (b * 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 ((x <= -3.9e+118) || !(x <= 3.7e+95)) {
		tmp = x * 2.0;
	} else {
		tmp = a * (b * 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 (x <= -3.9e+118) or not (x <= 3.7e+95):
		tmp = x * 2.0
	else:
		tmp = a * (b * 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 ((x <= -3.9e+118) || !(x <= 3.7e+95))
		tmp = Float64(x * 2.0);
	else
		tmp = Float64(a * Float64(b * 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 ((x <= -3.9e+118) || ~((x <= 3.7e+95)))
		tmp = x * 2.0;
	else
		tmp = a * (b * 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[x, -3.9e+118], N[Not[LessEqual[x, 3.7e+95]], $MachinePrecision]], N[(x * 2.0), $MachinePrecision], N[(a * N[(b * 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}\;x \leq -3.9 \cdot 10^{+118} \lor \neg \left(x \leq 3.7 \cdot 10^{+95}\right):\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -3.9e118 or 3.7000000000000001e95 < x

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -3.9e118 < x < 3.7000000000000001e95

    1. Initial program 93.4%

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

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

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

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

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

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

      \[\leadsto \color{blue}{2 \cdot x + 27 \cdot \left(a \cdot b\right)} \]
    5. Step-by-step derivation
      1. +-commutative58.1%

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

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

        \[\leadsto \left(a \cdot b\right) \cdot 27 + \color{blue}{x \cdot 2} \]
      4. fma-def58.1%

        \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot b, 27, x \cdot 2\right)} \]
    6. Applied egg-rr58.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot b, 27, x \cdot 2\right)} \]
    7. Taylor expanded in a around inf 44.7%

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -3.9 \cdot 10^{+118} \lor \neg \left(x \leq 3.7 \cdot 10^{+95}\right):\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(b \cdot 27\right)\\ \end{array} \]

Alternative 15: 31.5% 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. sub-neg95.3%

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

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

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

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

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

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

    \[\leadsto x \cdot 2 \]

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

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

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