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

Percentage Accurate: 95.9% → 98.5%
Time: 16.5s
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.9% accurate, 1.0× speedup?

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

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

Alternative 1: 98.5% accurate, 0.1× speedup?

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

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


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

    1. Initial program 93.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. +-commutative93.1%

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

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

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

        \[\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) \]
      5. *-commutative96.9%

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

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

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

    if 5.5999999999999999e-155 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


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

    1. Initial program 93.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. +-commutative93.1%

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

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

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

        \[\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) \]
      5. *-commutative96.9%

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

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

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

    if 5.5999999999999999e-155 < z

    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 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification93.7%

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

Alternative 3: 82.0% accurate, 0.7× 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(9 \cdot y\right)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{-127}:\\ \;\;\;\;x \cdot 2 - t \cdot t_1\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+44}:\\ \;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \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
 (let* ((t_1 (* z (* 9.0 y))))
   (if (<= t_1 -5e-127)
     (- (* x 2.0) (* t t_1))
     (if (<= t_1 2e+44)
       (- (* x 2.0) (* (* a b) -27.0))
       (- (* x 2.0) (* 9.0 (* y (* z t))))))))
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 * (9.0 * y);
	double tmp;
	if (t_1 <= -5e-127) {
		tmp = (x * 2.0) - (t * t_1);
	} else if (t_1 <= 2e+44) {
		tmp = (x * 2.0) - ((a * b) * -27.0);
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * 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) :: t_1
    real(8) :: tmp
    t_1 = z * (9.0d0 * y)
    if (t_1 <= (-5d-127)) then
        tmp = (x * 2.0d0) - (t * t_1)
    else if (t_1 <= 2d+44) then
        tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
    else
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * 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 t_1 = z * (9.0 * y);
	double tmp;
	if (t_1 <= -5e-127) {
		tmp = (x * 2.0) - (t * t_1);
	} else if (t_1 <= 2e+44) {
		tmp = (x * 2.0) - ((a * b) * -27.0);
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	}
	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 * (9.0 * y)
	tmp = 0
	if t_1 <= -5e-127:
		tmp = (x * 2.0) - (t * t_1)
	elif t_1 <= 2e+44:
		tmp = (x * 2.0) - ((a * b) * -27.0)
	else:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	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(z * Float64(9.0 * y))
	tmp = 0.0
	if (t_1 <= -5e-127)
		tmp = Float64(Float64(x * 2.0) - Float64(t * t_1));
	elseif (t_1 <= 2e+44)
		tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0));
	else
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * 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)
	t_1 = z * (9.0 * y);
	tmp = 0.0;
	if (t_1 <= -5e-127)
		tmp = (x * 2.0) - (t * t_1);
	elseif (t_1 <= 2e+44)
		tmp = (x * 2.0) - ((a * b) * -27.0);
	else
		tmp = (x * 2.0) - (9.0 * (y * (z * 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_] := Block[{t$95$1 = N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-127], N[(N[(x * 2.0), $MachinePrecision] - N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+44], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $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 := z \cdot \left(9 \cdot y\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-127}:\\
\;\;\;\;x \cdot 2 - t \cdot t_1\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 y 9) z) < -4.9999999999999997e-127

    1. Initial program 84.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. Taylor expanded in a around 0 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto x \cdot 2 + \left(-\color{blue}{\left(\sqrt{-y \cdot \left(9 \cdot z\right)} \cdot \sqrt{-y \cdot \left(9 \cdot z\right)}\right)} \cdot t\right) \]
      6. add-sqr-sqrt18.7%

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

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

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

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

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

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

        \[\leadsto x \cdot 2 - t \cdot \color{blue}{\left(\sqrt{y \cdot \left(9 \cdot z\right)} \cdot \sqrt{y \cdot \left(9 \cdot z\right)}\right)} \]
      13. add-sqr-sqrt68.8%

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

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

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

    if -4.9999999999999997e-127 < (*.f64 (*.f64 y 9) z) < 2.0000000000000002e44

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000002e44 < (*.f64 (*.f64 y 9) z)

    1. Initial program 86.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 a around 0 82.2%

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

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

Alternative 4: 82.1% accurate, 0.7× 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(9 \cdot y\right)\\ \mathbf{if}\;t_1 \leq -5 \cdot 10^{-127}:\\ \;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\\ \mathbf{elif}\;t_1 \leq 2 \cdot 10^{+44}:\\ \;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \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
 (let* ((t_1 (* z (* 9.0 y))))
   (if (<= t_1 -5e-127)
     (- (* x 2.0) (* t (* y (* z 9.0))))
     (if (<= t_1 2e+44)
       (- (* x 2.0) (* (* a b) -27.0))
       (- (* x 2.0) (* 9.0 (* y (* z t))))))))
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 * (9.0 * y);
	double tmp;
	if (t_1 <= -5e-127) {
		tmp = (x * 2.0) - (t * (y * (z * 9.0)));
	} else if (t_1 <= 2e+44) {
		tmp = (x * 2.0) - ((a * b) * -27.0);
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * 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) :: t_1
    real(8) :: tmp
    t_1 = z * (9.0d0 * y)
    if (t_1 <= (-5d-127)) then
        tmp = (x * 2.0d0) - (t * (y * (z * 9.0d0)))
    else if (t_1 <= 2d+44) then
        tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
    else
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * 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 t_1 = z * (9.0 * y);
	double tmp;
	if (t_1 <= -5e-127) {
		tmp = (x * 2.0) - (t * (y * (z * 9.0)));
	} else if (t_1 <= 2e+44) {
		tmp = (x * 2.0) - ((a * b) * -27.0);
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	}
	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 * (9.0 * y)
	tmp = 0
	if t_1 <= -5e-127:
		tmp = (x * 2.0) - (t * (y * (z * 9.0)))
	elif t_1 <= 2e+44:
		tmp = (x * 2.0) - ((a * b) * -27.0)
	else:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	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(z * Float64(9.0 * y))
	tmp = 0.0
	if (t_1 <= -5e-127)
		tmp = Float64(Float64(x * 2.0) - Float64(t * Float64(y * Float64(z * 9.0))));
	elseif (t_1 <= 2e+44)
		tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0));
	else
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * 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)
	t_1 = z * (9.0 * y);
	tmp = 0.0;
	if (t_1 <= -5e-127)
		tmp = (x * 2.0) - (t * (y * (z * 9.0)));
	elseif (t_1 <= 2e+44)
		tmp = (x * 2.0) - ((a * b) * -27.0);
	else
		tmp = (x * 2.0) - (9.0 * (y * (z * 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_] := Block[{t$95$1 = N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-127], N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(y * N[(z * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+44], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $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 := z \cdot \left(9 \cdot y\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{-127}:\\
\;\;\;\;x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 (*.f64 y 9) z) < -4.9999999999999997e-127

    1. Initial program 84.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. Taylor expanded in a around 0 72.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.9999999999999997e-127 < (*.f64 (*.f64 y 9) z) < 2.0000000000000002e44

    1. Initial program 98.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000002e44 < (*.f64 (*.f64 y 9) z)

    1. Initial program 86.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 a around 0 82.2%

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

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

Alternative 5: 97.8% accurate, 0.7× 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(9 \cdot y\right) \leq 10^{+308}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \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 (* 9.0 y)) 1e+308)
   (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* 9.0 (* z y)))))
   (- (* x 2.0) (* 9.0 (* y (* z 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 * (9.0 * y)) <= 1e+308) {
		tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * 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 * (9.0d0 * y)) <= 1d+308) then
        tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (9.0d0 * (z * y))))
    else
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * 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 * (9.0 * y)) <= 1e+308) {
		tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
	} else {
		tmp = (x * 2.0) - (9.0 * (y * (z * 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 * (9.0 * y)) <= 1e+308:
		tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))))
	else:
		tmp = (x * 2.0) - (9.0 * (y * (z * 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 (Float64(z * Float64(9.0 * y)) <= 1e+308)
		tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(9.0 * Float64(z * y)))));
	else
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * 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 * (9.0 * y)) <= 1e+308)
		tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (9.0 * (z * y))));
	else
		tmp = (x * 2.0) - (9.0 * (y * (z * 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[N[(z * N[(9.0 * y), $MachinePrecision]), $MachinePrecision], 1e+308], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $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(9 \cdot y\right) \leq 10^{+308}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(9 \cdot \left(z \cdot y\right)\right)\right)\\

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


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

    1. Initial program 93.2%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Taylor expanded in y around 0 93.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 \]

    if 1e308 < (*.f64 (*.f64 y 9) z)

    1. Initial program 61.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 a around 0 100.0%

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

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

Alternative 6: 47.1% 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 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ t_2 := 27 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;x \leq -8.8 \cdot 10^{+105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{+46}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -1.26 \cdot 10^{+29}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{-56}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-287}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+80}:\\ \;\;\;\;t_1\\ \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
 (let* ((t_1 (* -9.0 (* y (* z t)))) (t_2 (* 27.0 (* a b))))
   (if (<= x -8.8e+105)
     (* x 2.0)
     (if (<= x -6.5e+46)
       t_2
       (if (<= x -1.26e+29)
         (* x 2.0)
         (if (<= x -5.5e-56)
           t_1
           (if (<= x 1.15e-287) t_2 (if (<= x 1.4e+80) t_1 (* 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 t_1 = -9.0 * (y * (z * t));
	double t_2 = 27.0 * (a * b);
	double tmp;
	if (x <= -8.8e+105) {
		tmp = x * 2.0;
	} else if (x <= -6.5e+46) {
		tmp = t_2;
	} else if (x <= -1.26e+29) {
		tmp = x * 2.0;
	} else if (x <= -5.5e-56) {
		tmp = t_1;
	} else if (x <= 1.15e-287) {
		tmp = t_2;
	} else if (x <= 1.4e+80) {
		tmp = t_1;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = (-9.0d0) * (y * (z * t))
    t_2 = 27.0d0 * (a * b)
    if (x <= (-8.8d+105)) then
        tmp = x * 2.0d0
    else if (x <= (-6.5d+46)) then
        tmp = t_2
    else if (x <= (-1.26d+29)) then
        tmp = x * 2.0d0
    else if (x <= (-5.5d-56)) then
        tmp = t_1
    else if (x <= 1.15d-287) then
        tmp = t_2
    else if (x <= 1.4d+80) then
        tmp = t_1
    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 t_1 = -9.0 * (y * (z * t));
	double t_2 = 27.0 * (a * b);
	double tmp;
	if (x <= -8.8e+105) {
		tmp = x * 2.0;
	} else if (x <= -6.5e+46) {
		tmp = t_2;
	} else if (x <= -1.26e+29) {
		tmp = x * 2.0;
	} else if (x <= -5.5e-56) {
		tmp = t_1;
	} else if (x <= 1.15e-287) {
		tmp = t_2;
	} else if (x <= 1.4e+80) {
		tmp = t_1;
	} 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):
	t_1 = -9.0 * (y * (z * t))
	t_2 = 27.0 * (a * b)
	tmp = 0
	if x <= -8.8e+105:
		tmp = x * 2.0
	elif x <= -6.5e+46:
		tmp = t_2
	elif x <= -1.26e+29:
		tmp = x * 2.0
	elif x <= -5.5e-56:
		tmp = t_1
	elif x <= 1.15e-287:
		tmp = t_2
	elif x <= 1.4e+80:
		tmp = t_1
	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)
	t_1 = Float64(-9.0 * Float64(y * Float64(z * t)))
	t_2 = Float64(27.0 * Float64(a * b))
	tmp = 0.0
	if (x <= -8.8e+105)
		tmp = Float64(x * 2.0);
	elseif (x <= -6.5e+46)
		tmp = t_2;
	elseif (x <= -1.26e+29)
		tmp = Float64(x * 2.0);
	elseif (x <= -5.5e-56)
		tmp = t_1;
	elseif (x <= 1.15e-287)
		tmp = t_2;
	elseif (x <= 1.4e+80)
		tmp = t_1;
	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)
	t_1 = -9.0 * (y * (z * t));
	t_2 = 27.0 * (a * b);
	tmp = 0.0;
	if (x <= -8.8e+105)
		tmp = x * 2.0;
	elseif (x <= -6.5e+46)
		tmp = t_2;
	elseif (x <= -1.26e+29)
		tmp = x * 2.0;
	elseif (x <= -5.5e-56)
		tmp = t_1;
	elseif (x <= 1.15e-287)
		tmp = t_2;
	elseif (x <= 1.4e+80)
		tmp = t_1;
	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_] := Block[{t$95$1 = N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8.8e+105], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -6.5e+46], t$95$2, If[LessEqual[x, -1.26e+29], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -5.5e-56], t$95$1, If[LessEqual[x, 1.15e-287], t$95$2, If[LessEqual[x, 1.4e+80], t$95$1, 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}
t_1 := -9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -8.8 \cdot 10^{+105}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -6.5 \cdot 10^{+46}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq -1.26 \cdot 10^{+29}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -5.5 \cdot 10^{-56}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 1.15 \cdot 10^{-287}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 1.4 \cdot 10^{+80}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -8.80000000000000027e105 or -6.50000000000000008e46 < x < -1.26e29 or 1.39999999999999992e80 < x

    1. Initial program 88.1%

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

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

    if -8.80000000000000027e105 < x < -6.50000000000000008e46 or -5.4999999999999999e-56 < x < 1.14999999999999993e-287

    1. Initial program 90.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. Taylor expanded in a around inf 54.6%

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

    if -1.26e29 < x < -5.4999999999999999e-56 or 1.14999999999999993e-287 < x < 1.39999999999999992e80

    1. Initial program 95.2%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{+105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -6.5 \cdot 10^{+46}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq -1.26 \cdot 10^{+29}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{-56}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;x \leq 1.15 \cdot 10^{-287}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 1.4 \cdot 10^{+80}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 7: 98.0% 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 -3 \cdot 10^{-257}:\\ \;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(z \cdot t\right) \cdot \left(9 \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right) + \left(x \cdot 2 - t \cdot \left(z \cdot \left(9 \cdot y\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 -3e-257)
   (+ (* x 2.0) (- (* a (* 27.0 b)) (* (* z t) (* 9.0 y))))
   (+ (* b (* a 27.0)) (- (* x 2.0) (* t (* z (* 9.0 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 <= -3e-257) {
		tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
	} else {
		tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * 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 (z <= (-3d-257)) then
        tmp = (x * 2.0d0) + ((a * (27.0d0 * b)) - ((z * t) * (9.0d0 * y)))
    else
        tmp = (b * (a * 27.0d0)) + ((x * 2.0d0) - (t * (z * (9.0d0 * 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 (z <= -3e-257) {
		tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
	} else {
		tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * 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 z <= -3e-257:
		tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)))
	else:
		tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * 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 <= -3e-257)
		tmp = Float64(Float64(x * 2.0) + Float64(Float64(a * Float64(27.0 * b)) - Float64(Float64(z * t) * Float64(9.0 * y))));
	else
		tmp = Float64(Float64(b * Float64(a * 27.0)) + Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(9.0 * 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 (z <= -3e-257)
		tmp = (x * 2.0) + ((a * (27.0 * b)) - ((z * t) * (9.0 * y)));
	else
		tmp = (b * (a * 27.0)) + ((x * 2.0) - (t * (z * (9.0 * 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[LessEqual[z, -3e-257], N[(N[(x * 2.0), $MachinePrecision] + N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] - N[(N[(z * t), $MachinePrecision] * N[(9.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * N[(a * 27.0), $MachinePrecision]), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(9.0 * 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 -3 \cdot 10^{-257}:\\
\;\;\;\;x \cdot 2 + \left(a \cdot \left(27 \cdot b\right) - \left(z \cdot t\right) \cdot \left(9 \cdot y\right)\right)\\

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


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

    1. Initial program 92.6%

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.9999999999999999e-257 < z

    1. Initial program 90.2%

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

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

Alternative 8: 49.4% 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)\\ t_2 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{if}\;z \leq -15.2:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-106}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-226}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-194}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-54}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_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
 (let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* z (* y t)))))
   (if (<= z -15.2)
     t_2
     (if (<= z -2e-106)
       (* x 2.0)
       (if (<= z 1.4e-226)
         t_1
         (if (<= z 5.1e-194)
           (* -9.0 (* y (* z t)))
           (if (<= z 2.15e-54) t_1 t_2)))))))
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 t_2 = -9.0 * (z * (y * t));
	double tmp;
	if (z <= -15.2) {
		tmp = t_2;
	} else if (z <= -2e-106) {
		tmp = x * 2.0;
	} else if (z <= 1.4e-226) {
		tmp = t_1;
	} else if (z <= 5.1e-194) {
		tmp = -9.0 * (y * (z * t));
	} else if (z <= 2.15e-54) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = 27.0d0 * (a * b)
    t_2 = (-9.0d0) * (z * (y * t))
    if (z <= (-15.2d0)) then
        tmp = t_2
    else if (z <= (-2d-106)) then
        tmp = x * 2.0d0
    else if (z <= 1.4d-226) then
        tmp = t_1
    else if (z <= 5.1d-194) then
        tmp = (-9.0d0) * (y * (z * t))
    else if (z <= 2.15d-54) then
        tmp = t_1
    else
        tmp = t_2
    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 t_2 = -9.0 * (z * (y * t));
	double tmp;
	if (z <= -15.2) {
		tmp = t_2;
	} else if (z <= -2e-106) {
		tmp = x * 2.0;
	} else if (z <= 1.4e-226) {
		tmp = t_1;
	} else if (z <= 5.1e-194) {
		tmp = -9.0 * (y * (z * t));
	} else if (z <= 2.15e-54) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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)
	t_2 = -9.0 * (z * (y * t))
	tmp = 0
	if z <= -15.2:
		tmp = t_2
	elif z <= -2e-106:
		tmp = x * 2.0
	elif z <= 1.4e-226:
		tmp = t_1
	elif z <= 5.1e-194:
		tmp = -9.0 * (y * (z * t))
	elif z <= 2.15e-54:
		tmp = t_1
	else:
		tmp = t_2
	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))
	t_2 = Float64(-9.0 * Float64(z * Float64(y * t)))
	tmp = 0.0
	if (z <= -15.2)
		tmp = t_2;
	elseif (z <= -2e-106)
		tmp = Float64(x * 2.0);
	elseif (z <= 1.4e-226)
		tmp = t_1;
	elseif (z <= 5.1e-194)
		tmp = Float64(-9.0 * Float64(y * Float64(z * t)));
	elseif (z <= 2.15e-54)
		tmp = t_1;
	else
		tmp = t_2;
	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);
	t_2 = -9.0 * (z * (y * t));
	tmp = 0.0;
	if (z <= -15.2)
		tmp = t_2;
	elseif (z <= -2e-106)
		tmp = x * 2.0;
	elseif (z <= 1.4e-226)
		tmp = t_1;
	elseif (z <= 5.1e-194)
		tmp = -9.0 * (y * (z * t));
	elseif (z <= 2.15e-54)
		tmp = t_1;
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -15.2], t$95$2, If[LessEqual[z, -2e-106], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.4e-226], t$95$1, If[LessEqual[z, 5.1e-194], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.15e-54], t$95$1, t$95$2]]]]]]]
\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)\\
t_2 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -15.2:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -2 \cdot 10^{-106}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-226}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 2.15 \cdot 10^{-54}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -15.199999999999999 or 2.15e-54 < z

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

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

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

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

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

    if -15.199999999999999 < z < -1.99999999999999988e-106

    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. Taylor expanded in x around inf 38.5%

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

    if -1.99999999999999988e-106 < z < 1.40000000000000004e-226 or 5.0999999999999998e-194 < z < 2.15e-54

    1. Initial program 96.4%

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

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

    if 1.40000000000000004e-226 < z < 5.0999999999999998e-194

    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. Taylor expanded in y around inf 50.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -15.2:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -2 \cdot 10^{-106}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-226}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 5.1 \cdot 10^{-194}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 2.15 \cdot 10^{-54}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \end{array} \]

Alternative 9: 49.3% 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)\\ t_2 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{if}\;z \leq -15.2:\\ \;\;\;\;t_2\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-106}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-226}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-194}:\\ \;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-47}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;t_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
 (let* ((t_1 (* 27.0 (* a b))) (t_2 (* -9.0 (* z (* y t)))))
   (if (<= z -15.2)
     t_2
     (if (<= z -1.85e-106)
       (* x 2.0)
       (if (<= z 1.4e-226)
         t_1
         (if (<= z 5.5e-194)
           (* y (* t (* z -9.0)))
           (if (<= z 4e-47) t_1 t_2)))))))
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 t_2 = -9.0 * (z * (y * t));
	double tmp;
	if (z <= -15.2) {
		tmp = t_2;
	} else if (z <= -1.85e-106) {
		tmp = x * 2.0;
	} else if (z <= 1.4e-226) {
		tmp = t_1;
	} else if (z <= 5.5e-194) {
		tmp = y * (t * (z * -9.0));
	} else if (z <= 4e-47) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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) :: t_2
    real(8) :: tmp
    t_1 = 27.0d0 * (a * b)
    t_2 = (-9.0d0) * (z * (y * t))
    if (z <= (-15.2d0)) then
        tmp = t_2
    else if (z <= (-1.85d-106)) then
        tmp = x * 2.0d0
    else if (z <= 1.4d-226) then
        tmp = t_1
    else if (z <= 5.5d-194) then
        tmp = y * (t * (z * (-9.0d0)))
    else if (z <= 4d-47) then
        tmp = t_1
    else
        tmp = t_2
    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 t_2 = -9.0 * (z * (y * t));
	double tmp;
	if (z <= -15.2) {
		tmp = t_2;
	} else if (z <= -1.85e-106) {
		tmp = x * 2.0;
	} else if (z <= 1.4e-226) {
		tmp = t_1;
	} else if (z <= 5.5e-194) {
		tmp = y * (t * (z * -9.0));
	} else if (z <= 4e-47) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	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)
	t_2 = -9.0 * (z * (y * t))
	tmp = 0
	if z <= -15.2:
		tmp = t_2
	elif z <= -1.85e-106:
		tmp = x * 2.0
	elif z <= 1.4e-226:
		tmp = t_1
	elif z <= 5.5e-194:
		tmp = y * (t * (z * -9.0))
	elif z <= 4e-47:
		tmp = t_1
	else:
		tmp = t_2
	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))
	t_2 = Float64(-9.0 * Float64(z * Float64(y * t)))
	tmp = 0.0
	if (z <= -15.2)
		tmp = t_2;
	elseif (z <= -1.85e-106)
		tmp = Float64(x * 2.0);
	elseif (z <= 1.4e-226)
		tmp = t_1;
	elseif (z <= 5.5e-194)
		tmp = Float64(y * Float64(t * Float64(z * -9.0)));
	elseif (z <= 4e-47)
		tmp = t_1;
	else
		tmp = t_2;
	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);
	t_2 = -9.0 * (z * (y * t));
	tmp = 0.0;
	if (z <= -15.2)
		tmp = t_2;
	elseif (z <= -1.85e-106)
		tmp = x * 2.0;
	elseif (z <= 1.4e-226)
		tmp = t_1;
	elseif (z <= 5.5e-194)
		tmp = y * (t * (z * -9.0));
	elseif (z <= 4e-47)
		tmp = t_1;
	else
		tmp = t_2;
	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]}, Block[{t$95$2 = N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -15.2], t$95$2, If[LessEqual[z, -1.85e-106], N[(x * 2.0), $MachinePrecision], If[LessEqual[z, 1.4e-226], t$95$1, If[LessEqual[z, 5.5e-194], N[(y * N[(t * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e-47], t$95$1, t$95$2]]]]]]]
\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)\\
t_2 := -9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;z \leq -15.2:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -1.85 \cdot 10^{-106}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq 1.4 \cdot 10^{-226}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 4 \cdot 10^{-47}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -15.199999999999999 or 3.9999999999999999e-47 < z

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

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

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

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

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

    if -15.199999999999999 < z < -1.8499999999999999e-106

    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. Taylor expanded in x around inf 38.5%

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

    if -1.8499999999999999e-106 < z < 1.40000000000000004e-226 or 5.49999999999999941e-194 < z < 3.9999999999999999e-47

    1. Initial program 96.4%

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

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

    if 1.40000000000000004e-226 < z < 5.49999999999999941e-194

    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. Taylor expanded in y around 0 99.7%

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -15.2:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -1.85 \cdot 10^{-106}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-226}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq 5.5 \cdot 10^{-194}:\\ \;\;\;\;y \cdot \left(t \cdot \left(z \cdot -9\right)\right)\\ \mathbf{elif}\;z \leq 4 \cdot 10^{-47}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \end{array} \]

Alternative 10: 77.8% 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}\;y \leq -2.26 \cdot 10^{+80} \lor \neg \left(y \leq 2.9 \cdot 10^{-149}\right):\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\ \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 (<= y -2.26e+80) (not (<= y 2.9e-149)))
   (- (* x 2.0) (* 9.0 (* y (* z t))))
   (- (* x 2.0) (* (* a b) -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 ((y <= -2.26e+80) || !(y <= 2.9e-149)) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else {
		tmp = (x * 2.0) - ((a * b) * -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 ((y <= (-2.26d+80)) .or. (.not. (y <= 2.9d-149))) then
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
    else
        tmp = (x * 2.0d0) - ((a * b) * (-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 ((y <= -2.26e+80) || !(y <= 2.9e-149)) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else {
		tmp = (x * 2.0) - ((a * b) * -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 (y <= -2.26e+80) or not (y <= 2.9e-149):
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	else:
		tmp = (x * 2.0) - ((a * b) * -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 ((y <= -2.26e+80) || !(y <= 2.9e-149))
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	else
		tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -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 ((y <= -2.26e+80) || ~((y <= 2.9e-149)))
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	else
		tmp = (x * 2.0) - ((a * b) * -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[Or[LessEqual[y, -2.26e+80], N[Not[LessEqual[y, 2.9e-149]], $MachinePrecision]], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
[a, b] = \mathsf{sort}([a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.26 \cdot 10^{+80} \lor \neg \left(y \leq 2.9 \cdot 10^{-149}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -2.26e80 or 2.9e-149 < y

    1. Initial program 86.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. Taylor expanded in a around 0 74.6%

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

    if -2.26e80 < y < 2.9e-149

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 77.8% 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}\;y \leq -5.9 \cdot 10^{+78}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{-202}:\\ \;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 - 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 (<= y -5.9e+78)
   (- (* x 2.0) (* 9.0 (* y (* z t))))
   (if (<= y 3.2e-202)
     (- (* x 2.0) (* (* a b) -27.0))
     (- (* x 2.0) (* 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 (y <= -5.9e+78) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else if (y <= 3.2e-202) {
		tmp = (x * 2.0) - ((a * b) * -27.0);
	} else {
		tmp = (x * 2.0) - (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 (y <= (-5.9d+78)) then
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
    else if (y <= 3.2d-202) then
        tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
    else
        tmp = (x * 2.0d0) - (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 (y <= -5.9e+78) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else if (y <= 3.2e-202) {
		tmp = (x * 2.0) - ((a * b) * -27.0);
	} else {
		tmp = (x * 2.0) - (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 y <= -5.9e+78:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	elif y <= 3.2e-202:
		tmp = (x * 2.0) - ((a * b) * -27.0)
	else:
		tmp = (x * 2.0) - (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 (y <= -5.9e+78)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	elseif (y <= 3.2e-202)
		tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0));
	else
		tmp = Float64(Float64(x * 2.0) - 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 (y <= -5.9e+78)
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	elseif (y <= 3.2e-202)
		tmp = (x * 2.0) - ((a * b) * -27.0);
	else
		tmp = (x * 2.0) - (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[y, -5.9e+78], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.2e-202], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(z * N[(y * t), $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}\;y \leq -5.9 \cdot 10^{+78}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

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

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


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

    1. Initial program 79.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. Taylor expanded in a around 0 87.3%

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

    if -5.9e78 < y < 3.2000000000000001e-202

    1. Initial program 97.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.2000000000000001e-202 < y

    1. Initial program 89.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. Taylor expanded in a around 0 67.4%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{x \cdot 2 + \left(-9 \cdot \left(y \cdot z\right)\right) \cdot t} \]
    5. Step-by-step derivation
      1. distribute-lft-neg-out66.2%

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

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

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

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

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

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

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

Alternative 12: 75.8% 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 -420:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{+73}:\\ \;\;\;\;x \cdot 2 - a \cdot \left(b \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\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 -420.0)
   (* -9.0 (* z (* y t)))
   (if (<= z 1.7e+73) (- (* x 2.0) (* a (* b -27.0))) (* z (* t (* y -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 <= -420.0) {
		tmp = -9.0 * (z * (y * t));
	} else if (z <= 1.7e+73) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = z * (t * (y * -9.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 <= (-420.0d0)) then
        tmp = (-9.0d0) * (z * (y * t))
    else if (z <= 1.7d+73) then
        tmp = (x * 2.0d0) - (a * (b * (-27.0d0)))
    else
        tmp = z * (t * (y * (-9.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 <= -420.0) {
		tmp = -9.0 * (z * (y * t));
	} else if (z <= 1.7e+73) {
		tmp = (x * 2.0) - (a * (b * -27.0));
	} else {
		tmp = z * (t * (y * -9.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 <= -420.0:
		tmp = -9.0 * (z * (y * t))
	elif z <= 1.7e+73:
		tmp = (x * 2.0) - (a * (b * -27.0))
	else:
		tmp = z * (t * (y * -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 (z <= -420.0)
		tmp = Float64(-9.0 * Float64(z * Float64(y * t)));
	elseif (z <= 1.7e+73)
		tmp = Float64(Float64(x * 2.0) - Float64(a * Float64(b * -27.0)));
	else
		tmp = Float64(z * Float64(t * Float64(y * -9.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 <= -420.0)
		tmp = -9.0 * (z * (y * t));
	elseif (z <= 1.7e+73)
		tmp = (x * 2.0) - (a * (b * -27.0));
	else
		tmp = z * (t * (y * -9.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, -420.0], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+73], N[(N[(x * 2.0), $MachinePrecision] - N[(a * N[(b * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.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 -420:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\

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

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


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

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

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

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

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

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

    if -420 < z < 1.7000000000000001e73

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.7000000000000001e73 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 75.8% 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 -31:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 1.45 \cdot 10^{+70}:\\ \;\;\;\;x \cdot 2 - b \cdot \left(a \cdot -27\right)\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\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 -31.0)
   (* -9.0 (* z (* y t)))
   (if (<= z 1.45e+70)
     (- (* x 2.0) (* b (* a -27.0)))
     (* z (* t (* y -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 <= -31.0) {
		tmp = -9.0 * (z * (y * t));
	} else if (z <= 1.45e+70) {
		tmp = (x * 2.0) - (b * (a * -27.0));
	} else {
		tmp = z * (t * (y * -9.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 <= (-31.0d0)) then
        tmp = (-9.0d0) * (z * (y * t))
    else if (z <= 1.45d+70) then
        tmp = (x * 2.0d0) - (b * (a * (-27.0d0)))
    else
        tmp = z * (t * (y * (-9.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 <= -31.0) {
		tmp = -9.0 * (z * (y * t));
	} else if (z <= 1.45e+70) {
		tmp = (x * 2.0) - (b * (a * -27.0));
	} else {
		tmp = z * (t * (y * -9.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 <= -31.0:
		tmp = -9.0 * (z * (y * t))
	elif z <= 1.45e+70:
		tmp = (x * 2.0) - (b * (a * -27.0))
	else:
		tmp = z * (t * (y * -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 (z <= -31.0)
		tmp = Float64(-9.0 * Float64(z * Float64(y * t)));
	elseif (z <= 1.45e+70)
		tmp = Float64(Float64(x * 2.0) - Float64(b * Float64(a * -27.0)));
	else
		tmp = Float64(z * Float64(t * Float64(y * -9.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 <= -31.0)
		tmp = -9.0 * (z * (y * t));
	elseif (z <= 1.45e+70)
		tmp = (x * 2.0) - (b * (a * -27.0));
	else
		tmp = z * (t * (y * -9.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, -31.0], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+70], N[(N[(x * 2.0), $MachinePrecision] - N[(b * N[(a * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.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 -31:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\

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

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


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

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

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

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

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

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

    if -31 < z < 1.4499999999999999e70

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4499999999999999e70 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 75.9% 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 -135:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 1.36 \cdot 10^{+73}:\\ \;\;\;\;x \cdot 2 - \left(a \cdot b\right) \cdot -27\\ \mathbf{else}:\\ \;\;\;\;z \cdot \left(t \cdot \left(y \cdot -9\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 -135.0)
   (* -9.0 (* z (* y t)))
   (if (<= z 1.36e+73)
     (- (* x 2.0) (* (* a b) -27.0))
     (* z (* t (* y -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 <= -135.0) {
		tmp = -9.0 * (z * (y * t));
	} else if (z <= 1.36e+73) {
		tmp = (x * 2.0) - ((a * b) * -27.0);
	} else {
		tmp = z * (t * (y * -9.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 <= (-135.0d0)) then
        tmp = (-9.0d0) * (z * (y * t))
    else if (z <= 1.36d+73) then
        tmp = (x * 2.0d0) - ((a * b) * (-27.0d0))
    else
        tmp = z * (t * (y * (-9.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 <= -135.0) {
		tmp = -9.0 * (z * (y * t));
	} else if (z <= 1.36e+73) {
		tmp = (x * 2.0) - ((a * b) * -27.0);
	} else {
		tmp = z * (t * (y * -9.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 <= -135.0:
		tmp = -9.0 * (z * (y * t))
	elif z <= 1.36e+73:
		tmp = (x * 2.0) - ((a * b) * -27.0)
	else:
		tmp = z * (t * (y * -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 (z <= -135.0)
		tmp = Float64(-9.0 * Float64(z * Float64(y * t)));
	elseif (z <= 1.36e+73)
		tmp = Float64(Float64(x * 2.0) - Float64(Float64(a * b) * -27.0));
	else
		tmp = Float64(z * Float64(t * Float64(y * -9.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 <= -135.0)
		tmp = -9.0 * (z * (y * t));
	elseif (z <= 1.36e+73)
		tmp = (x * 2.0) - ((a * b) * -27.0);
	else
		tmp = z * (t * (y * -9.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, -135.0], N[(-9.0 * N[(z * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.36e+73], N[(N[(x * 2.0), $MachinePrecision] - N[(N[(a * b), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision], N[(z * N[(t * N[(y * -9.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 -135:\\
\;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\

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

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


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

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

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

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

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

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

    if -135 < z < 1.3599999999999999e73

    1. Initial program 96.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3599999999999999e73 < z

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 15: 45.7% 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}\;x \leq -8.8 \cdot 10^{+105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-112}:\\ \;\;\;\;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 (<= x -8.8e+105) (* x 2.0) (if (<= x 3e-112) (* 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 (x <= -8.8e+105) {
		tmp = x * 2.0;
	} else if (x <= 3e-112) {
		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 (x <= (-8.8d+105)) then
        tmp = x * 2.0d0
    else if (x <= 3d-112) 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 (x <= -8.8e+105) {
		tmp = x * 2.0;
	} else if (x <= 3e-112) {
		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 x <= -8.8e+105:
		tmp = x * 2.0
	elif x <= 3e-112:
		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 (x <= -8.8e+105)
		tmp = Float64(x * 2.0);
	elseif (x <= 3e-112)
		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 (x <= -8.8e+105)
		tmp = x * 2.0;
	elseif (x <= 3e-112)
		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[LessEqual[x, -8.8e+105], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, 3e-112], 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}\;x \leq -8.8 \cdot 10^{+105}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq 3 \cdot 10^{-112}:\\
\;\;\;\;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 x < -8.80000000000000027e105 or 3.0000000000000001e-112 < x

    1. Initial program 90.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. Taylor expanded in x around inf 52.4%

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

    if -8.80000000000000027e105 < x < 3.0000000000000001e-112

    1. Initial program 92.1%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8.8 \cdot 10^{+105}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-112}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 16: 30.3% 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 91.3%

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

    \[\leadsto \color{blue}{2 \cdot x} \]
  3. Final simplification30.3%

    \[\leadsto x \cdot 2 \]

Developer target: 95.4% 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 2023182 
(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)))