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

Percentage Accurate: 95.6% → 99.1%
Time: 15.6s
Alternatives: 16
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 16 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.6% 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: 99.1% accurate, 0.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -1.8e10

    1. Initial program 88.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. Simplified90.4%

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

    if -1.8e10 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 99.1% accurate, 0.1× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      11. associate-*l*90.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) \]
    5. Applied egg-rr90.4%

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

    if -2e10 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 98.0% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.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. Taylor expanded in y around 0 97.0%

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

    if 1.9999999999999999e305 < (*.f64 (*.f64 y 9) z)

    1. Initial program 57.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-neg57.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-neg57.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(a \cdot 27, b, z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\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^{+305}:\\ \;\;\;\;\left(x \cdot 2 - t \cdot \left(\left(z \cdot y\right) \cdot 9\right)\right) + b \cdot \left(a \cdot 27\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(a \cdot 27, b, z \cdot \left(y \cdot \left(t \cdot -9\right)\right)\right)\\ \end{array} \]

Alternative 4: 98.6% accurate, 0.1× speedup?

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

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


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

    1. Initial program 89.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. +-commutative89.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-89.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. *-commutative89.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-inv89.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*95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    5. Applied egg-rr91.2%

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

    if -2.00000000000000014e-17 < z

    1. Initial program 96.1%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in y around 0 96.2%

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

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

Alternative 5: 73.7% accurate, 0.8× speedup?

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

\mathbf{elif}\;y \leq -390000000000 \lor \neg \left(y \leq -2.05 \cdot 10^{-22}\right) \land y \leq -4.2 \cdot 10^{-208}:\\
\;\;\;\;x \cdot 2 + t_1\\

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


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

    1. Initial program 84.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-neg84.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-neg84.3%

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

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

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right)} \]
      2. expm1-udef46.3%

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \color{blue}{\left(e^{\mathsf{log1p}\left(9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)} - 1\right)} \]
      3. associate-*r*46.3%

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{\left(9 \cdot t\right) \cdot \left(y \cdot z\right)}\right)} - 1\right) \]
      4. *-commutative46.3%

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \left(e^{\mathsf{log1p}\left(\left(9 \cdot t\right) \cdot \color{blue}{\left(z \cdot y\right)}\right)} - 1\right) \]
      5. associate-*r*50.9%

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{\left(\left(9 \cdot t\right) \cdot z\right) \cdot y}\right)} - 1\right) \]
      6. associate-*r*50.9%

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{\left(9 \cdot \left(t \cdot z\right)\right)} \cdot y\right)} - 1\right) \]
      7. *-commutative50.9%

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \left(e^{\mathsf{log1p}\left(\left(9 \cdot \color{blue}{\left(z \cdot t\right)}\right) \cdot y\right)} - 1\right) \]
      8. *-commutative50.9%

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \left(e^{\mathsf{log1p}\left(\color{blue}{y \cdot \left(9 \cdot \left(z \cdot t\right)\right)}\right)} - 1\right) \]
      9. *-commutative50.9%

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

        \[\leadsto 27 \cdot \left(a \cdot b\right) - \left(e^{\mathsf{log1p}\left(y \cdot \color{blue}{\left(z \cdot \left(t \cdot 9\right)\right)}\right)} - 1\right) \]
      11. *-commutative50.9%

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2000000000000004e50 < y < -3.9e11 or -2.05e-22 < y < -4.20000000000000024e-208

    1. Initial program 99.7%

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

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

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

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

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

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

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

    if -3.9e11 < y < -2.05e-22 or -4.20000000000000024e-208 < y

    1. Initial program 96.0%

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \leq -5.2 \cdot 10^{+50}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - \left(z \cdot t\right) \cdot \left(y \cdot 9\right)\\ \mathbf{elif}\;y \leq -390000000000 \lor \neg \left(y \leq -2.05 \cdot 10^{-22}\right) \land y \leq -4.2 \cdot 10^{-208}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \end{array} \]

Alternative 6: 78.2% accurate, 0.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -2.05000000000000007e-41 or 6.1000000000000003e-58 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.05000000000000007e-41 < z < 1.3499999999999999e-202

    1. Initial program 99.7%

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

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

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

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

    if 1.3499999999999999e-202 < z < 6.1000000000000003e-58

    1. Initial program 99.7%

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

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

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

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

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

Alternative 7: 97.3% accurate, 0.9× speedup?

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

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


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

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

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

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

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

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

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

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

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

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

    if 4.3000000000000002e86 < z

    1. Initial program 87.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-neg87.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-neg87.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.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*91.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. Simplified91.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 0 70.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 98.4% accurate, 0.9× speedup?

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

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


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

    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*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*87.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. Simplified87.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 y around 0 88.7%

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

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

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

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

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

    if -1e6 < z

    1. Initial program 96.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. Taylor expanded in y around 0 96.3%

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

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

Alternative 9: 98.4% accurate, 0.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5e9

    1. Initial program 88.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-neg88.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-neg88.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*87.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*87.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. Simplified87.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. Step-by-step derivation
      1. +-commutative87.5%

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

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

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

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

    if -5e9 < z

    1. Initial program 96.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. Taylor expanded in y around 0 96.3%

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

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

Alternative 10: 79.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;z \leq 5 \cdot 10^{-184}:\\
\;\;\;\;x \cdot 2 + t_1\\

\mathbf{else}:\\
\;\;\;\;t_1 - 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.8e-31

    1. Initial program 89.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.8e-31 < z < 5.00000000000000003e-184

    1. Initial program 99.8%

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

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

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

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

    if 5.00000000000000003e-184 < z

    1. Initial program 93.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-neg93.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-neg93.3%

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

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

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

Alternative 11: 77.9% accurate, 1.1× speedup?

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

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

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

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

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

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

    if -8.5999999999999997e147 < a < 3.0000000000000001e-83

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

Alternative 12: 75.7% accurate, 1.3× speedup?

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

\mathbf{elif}\;z \leq 57000000:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\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.32e73

    1. Initial program 85.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. +-commutative85.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\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) \]
    5. Applied egg-rr88.1%

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

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

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

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

        \[\leadsto \left(\color{blue}{\left(-9\right)} \cdot \left(t \cdot y\right)\right) \cdot z \]
      4. distribute-lft-neg-in72.5%

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

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

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

        \[\leadsto z \cdot \left(-\color{blue}{9 \cdot \left(t \cdot y\right)}\right) \]
      8. distribute-lft-neg-in72.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.32e73 < z < 5.7e7

    1. Initial program 99.7%

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

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

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

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

    if 5.7e7 < z

    1. Initial program 89.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-neg89.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-neg89.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 48.8% accurate, 1.5× speedup?

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

\mathbf{elif}\;a \leq 2.9 \cdot 10^{-81}:\\
\;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -8.5999999999999997e147

    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 \]
    2. Step-by-step derivation
      1. +-commutative96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      11. associate-*l*99.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) \]
    5. Applied egg-rr99.8%

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

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

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

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

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

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

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

    if -8.5999999999999997e147 < a < 2.89999999999999989e-81

    1. Initial program 93.6%

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

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

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

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

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

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

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

    if 2.89999999999999989e-81 < a

    1. Initial program 94.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-neg94.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-neg94.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*95.4%

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

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

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

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

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

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

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

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

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

Alternative 14: 47.9% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -5.0000000000000002e-157 or 4.50000000000000013e60 < b

    1. Initial program 93.6%

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

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

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

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

    if -5.0000000000000002e-157 < b < 4.50000000000000013e60

    1. Initial program 95.1%

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

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

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

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

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

Alternative 15: 47.8% accurate, 1.9× speedup?

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

\mathbf{elif}\;b \leq 1.3 \cdot 10^{+63}:\\
\;\;\;\;x \cdot 2\\

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


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

    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 \]
    2. Step-by-step derivation
      1. +-commutative96.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-96.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. *-commutative96.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-inv96.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*96.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-in96.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. *-commutative96.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-inv96.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-96.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*96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{fma}\left(a, 27 \cdot b, x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) \]
      11. associate-*l*95.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) \]
    5. Applied egg-rr95.8%

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

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

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

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

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

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

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

    if -1.54999999999999996e-176 < b < 1.3000000000000001e63

    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*95.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*95.8%

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

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

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

    if 1.3000000000000001e63 < b

    1. Initial program 89.6%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -1.55 \cdot 10^{-176}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;b \leq 1.3 \cdot 10^{+63}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 16: 31.4% accurate, 5.7× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ [a, b] = \mathsf{sort}([a, b])\\ \\ x \cdot 2 \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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(y < z && z < t);
assert(a < b);
double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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 y < z && z < t;
assert a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
	return x * 2.0;
}
[y, z, t] = sort([y, z, t])
[a, b] = sort([a, b])
def code(x, y, z, t, a, b):
	return x * 2.0
y, z, t = sort([y, z, t])
a, b = sort([a, b])
function code(x, y, z, t, a, b)
	return Float64(x * 2.0)
end
y, z, t = num2cell(sort([y, z, t])){:}
a, b = num2cell(sort([a, b])){:}
function tmp = code(x, y, z, t, a, b)
	tmp = x * 2.0;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
NOTE: 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}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
x \cdot 2
\end{array}
Derivation
  1. Initial program 94.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-neg94.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-neg94.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*94.2%

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

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

    \[\leadsto x \cdot 2 \]

Developer target: 95.2% 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 2023309 
(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)))