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

Percentage Accurate: 95.8% → 98.8%
Time: 17.3s
Alternatives: 18
Speedup: 0.7×

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 18 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.8% 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.8% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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)} \]

    if 1.00000000000000006e136 < (*.f64 (*.f64 y 9) z)

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

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

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

        \[\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*99.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. *-commutative99.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*99.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. Simplified99.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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.2%

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

Alternative 2: 98.6% accurate, 0.1× speedup?

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

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


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

    1. Initial program 96.8%

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

    if 1.00000000000000006e136 < (*.f64 (*.f64 y 9) z)

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

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

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

        \[\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*99.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. *-commutative99.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*99.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. Simplified99.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)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.2%

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

Alternative 3: 48.4% accurate, 0.7× speedup?

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

\mathbf{elif}\;z \leq -6800000000000:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq -6.8 \cdot 10^{-46}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -8.2 \cdot 10^{-75}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;z \leq -9 \cdot 10^{-148}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2.5 \cdot 10^{-266}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

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

\mathbf{elif}\;z \leq 2500000000000:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

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


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

    1. Initial program 90.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 y around inf 48.6%

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

    if -2.7000000000000001e59 < z < -6.8e12 or -2.49999999999999996e-266 < z < 1.4000000000000001e-287

    1. Initial program 99.9%

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

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

    if -6.8e12 < z < -6.79999999999999992e-46 or -8.20000000000000005e-75 < z < -9.00000000000000029e-148 or 2.5e12 < z

    1. Initial program 92.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.79999999999999992e-46 < z < -8.20000000000000005e-75

    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 a around inf 40.6%

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

    if -9.00000000000000029e-148 < z < -2.49999999999999996e-266

    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 x around 0 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.4000000000000001e-287 < z < 2.5e12

    1. Initial program 100.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. Taylor expanded in x around 0 59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+59}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -6800000000000:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-46}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;z \leq -8.2 \cdot 10^{-75}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq -9 \cdot 10^{-148}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;z \leq -2.5 \cdot 10^{-266}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;z \leq 1.4 \cdot 10^{-287}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 2500000000000:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 4: 48.4% accurate, 0.7× speedup?

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

\mathbf{elif}\;z \leq -6800000000000:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq -9.2 \cdot 10^{-49}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -7 \cdot 10^{-75}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;z \leq -2.4 \cdot 10^{-148}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -2.2 \cdot 10^{-266}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

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

\mathbf{elif}\;z \leq 2500000000000:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.7000000000000001e59 or -6.8e12 < z < -9.1999999999999996e-49

    1. Initial program 92.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 inf 44.0%

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

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

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

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

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

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

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

    if -2.7000000000000001e59 < z < -6.8e12 or -2.2e-266 < z < 6.99999999999999977e-286

    1. Initial program 99.9%

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

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

    if -9.1999999999999996e-49 < z < -6.9999999999999997e-75

    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 a around inf 40.6%

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

    if -6.9999999999999997e-75 < z < -2.4000000000000001e-148 or 2.5e12 < z

    1. Initial program 91.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 86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.4000000000000001e-148 < z < -2.2e-266

    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 x around 0 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 6.99999999999999977e-286 < z < 2.5e12

    1. Initial program 100.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. Taylor expanded in x around 0 59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+59}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -6800000000000:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -9.2 \cdot 10^{-49}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -7 \cdot 10^{-75}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq -2.4 \cdot 10^{-148}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;z \leq -2.2 \cdot 10^{-266}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;z \leq 7 \cdot 10^{-286}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 2500000000000:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 5: 48.4% accurate, 0.7× speedup?

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

\mathbf{elif}\;z \leq -230000000000:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;z \leq -1.55 \cdot 10^{-48}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;z \leq -6.6 \cdot 10^{-76}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;z \leq -3.5 \cdot 10^{-149}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;z \leq -4.6 \cdot 10^{-267}:\\
\;\;\;\;b \cdot \left(a \cdot 27\right)\\

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

\mathbf{elif}\;z \leq 25000000:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if z < -2.7000000000000001e59 or -2.3e11 < z < -1.55000000000000008e-48

    1. Initial program 92.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 inf 44.0%

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

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

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

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

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

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

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

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

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

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

    if -2.7000000000000001e59 < z < -2.3e11 or -4.6000000000000001e-267 < z < 9.49999999999999955e-288

    1. Initial program 99.9%

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

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

    if -1.55000000000000008e-48 < z < -6.59999999999999967e-76

    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 a around inf 40.6%

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

    if -6.59999999999999967e-76 < z < -3.5e-149 or 2.5e7 < z

    1. Initial program 91.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 86.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -3.5e-149 < z < -4.6000000000000001e-267

    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 x around 0 73.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 9.49999999999999955e-288 < z < 2.5e7

    1. Initial program 100.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. Taylor expanded in x around 0 59.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.7 \cdot 10^{+59}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\ \mathbf{elif}\;z \leq -230000000000:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq -1.55 \cdot 10^{-48}:\\ \;\;\;\;\left(z \cdot t\right) \cdot \left(y \cdot -9\right)\\ \mathbf{elif}\;z \leq -6.6 \cdot 10^{-76}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;z \leq -3.5 \cdot 10^{-149}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;z \leq -4.6 \cdot 10^{-267}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-288}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 25000000:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 6: 97.4% accurate, 0.7× speedup?

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

\mathbf{else}:\\
\;\;\;\;y \cdot \left(-9 \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) < 5e302

    1. Initial program 97.0%

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

    if 5e302 < (*.f64 (*.f64 y 9) z)

    1. Initial program 65.9%

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

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

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

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

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

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

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

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

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

Alternative 7: 48.3% accurate, 0.8× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(a \cdot b\right)\\ t_2 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{if}\;t \leq -1.35 \cdot 10^{-125}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-182}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-134}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-46}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-18}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{+44}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+92}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \end{array} \]
NOTE: y, z, and t 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 (* t (* y z)))))
   (if (<= t -1.35e-125)
     t_2
     (if (<= t 1.7e-182)
       (* a (* 27.0 b))
       (if (<= t 1.5e-134)
         (* x 2.0)
         (if (<= t 2.5e-46)
           t_1
           (if (<= t 8e-18)
             (* x 2.0)
             (if (<= t 2.25e+44) t_1 (if (<= t 3e+92) (* x 2.0) t_2)))))))))
assert(y < z && z < t);
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 * (t * (y * z));
	double tmp;
	if (t <= -1.35e-125) {
		tmp = t_2;
	} else if (t <= 1.7e-182) {
		tmp = a * (27.0 * b);
	} else if (t <= 1.5e-134) {
		tmp = x * 2.0;
	} else if (t <= 2.5e-46) {
		tmp = t_1;
	} else if (t <= 8e-18) {
		tmp = x * 2.0;
	} else if (t <= 2.25e+44) {
		tmp = t_1;
	} else if (t <= 3e+92) {
		tmp = x * 2.0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
NOTE: y, z, and t 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) * (t * (y * z))
    if (t <= (-1.35d-125)) then
        tmp = t_2
    else if (t <= 1.7d-182) then
        tmp = a * (27.0d0 * b)
    else if (t <= 1.5d-134) then
        tmp = x * 2.0d0
    else if (t <= 2.5d-46) then
        tmp = t_1
    else if (t <= 8d-18) then
        tmp = x * 2.0d0
    else if (t <= 2.25d+44) then
        tmp = t_1
    else if (t <= 3d+92) then
        tmp = x * 2.0d0
    else
        tmp = t_2
    end if
    code = tmp
end function
assert y < z && z < t;
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 * (t * (y * z));
	double tmp;
	if (t <= -1.35e-125) {
		tmp = t_2;
	} else if (t <= 1.7e-182) {
		tmp = a * (27.0 * b);
	} else if (t <= 1.5e-134) {
		tmp = x * 2.0;
	} else if (t <= 2.5e-46) {
		tmp = t_1;
	} else if (t <= 8e-18) {
		tmp = x * 2.0;
	} else if (t <= 2.25e+44) {
		tmp = t_1;
	} else if (t <= 3e+92) {
		tmp = x * 2.0;
	} else {
		tmp = t_2;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = 27.0 * (a * b)
	t_2 = -9.0 * (t * (y * z))
	tmp = 0
	if t <= -1.35e-125:
		tmp = t_2
	elif t <= 1.7e-182:
		tmp = a * (27.0 * b)
	elif t <= 1.5e-134:
		tmp = x * 2.0
	elif t <= 2.5e-46:
		tmp = t_1
	elif t <= 8e-18:
		tmp = x * 2.0
	elif t <= 2.25e+44:
		tmp = t_1
	elif t <= 3e+92:
		tmp = x * 2.0
	else:
		tmp = t_2
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(27.0 * Float64(a * b))
	t_2 = Float64(-9.0 * Float64(t * Float64(y * z)))
	tmp = 0.0
	if (t <= -1.35e-125)
		tmp = t_2;
	elseif (t <= 1.7e-182)
		tmp = Float64(a * Float64(27.0 * b));
	elseif (t <= 1.5e-134)
		tmp = Float64(x * 2.0);
	elseif (t <= 2.5e-46)
		tmp = t_1;
	elseif (t <= 8e-18)
		tmp = Float64(x * 2.0);
	elseif (t <= 2.25e+44)
		tmp = t_1;
	elseif (t <= 3e+92)
		tmp = Float64(x * 2.0);
	else
		tmp = t_2;
	end
	return tmp
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp_2 = code(x, y, z, t, a, b)
	t_1 = 27.0 * (a * b);
	t_2 = -9.0 * (t * (y * z));
	tmp = 0.0;
	if (t <= -1.35e-125)
		tmp = t_2;
	elseif (t <= 1.7e-182)
		tmp = a * (27.0 * b);
	elseif (t <= 1.5e-134)
		tmp = x * 2.0;
	elseif (t <= 2.5e-46)
		tmp = t_1;
	elseif (t <= 8e-18)
		tmp = x * 2.0;
	elseif (t <= 2.25e+44)
		tmp = t_1;
	elseif (t <= 3e+92)
		tmp = x * 2.0;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t 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[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.35e-125], t$95$2, If[LessEqual[t, 1.7e-182], N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e-134], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 2.5e-46], t$95$1, If[LessEqual[t, 8e-18], N[(x * 2.0), $MachinePrecision], If[LessEqual[t, 2.25e+44], t$95$1, If[LessEqual[t, 3e+92], N[(x * 2.0), $MachinePrecision], t$95$2]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
t_2 := -9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
\mathbf{if}\;t \leq -1.35 \cdot 10^{-125}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;t \leq 1.7 \cdot 10^{-182}:\\
\;\;\;\;a \cdot \left(27 \cdot b\right)\\

\mathbf{elif}\;t \leq 1.5 \cdot 10^{-134}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;t \leq 2.5 \cdot 10^{-46}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 8 \cdot 10^{-18}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;t \leq 2.25 \cdot 10^{+44}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;t \leq 3 \cdot 10^{+92}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if t < -1.3499999999999999e-125 or 3.00000000000000013e92 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.3499999999999999e-125 < t < 1.69999999999999995e-182

    1. Initial program 90.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 x around 0 52.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.69999999999999995e-182 < t < 1.5e-134 or 2.49999999999999996e-46 < t < 8.0000000000000006e-18 or 2.25e44 < t < 3.00000000000000013e92

    1. Initial program 90.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 45.3%

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

    if 1.5e-134 < t < 2.49999999999999996e-46 or 8.0000000000000006e-18 < t < 2.25e44

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.35 \cdot 10^{-125}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \mathbf{elif}\;t \leq 1.7 \cdot 10^{-182}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{elif}\;t \leq 1.5 \cdot 10^{-134}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 2.5 \cdot 10^{-46}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;t \leq 8 \cdot 10^{-18}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;t \leq 2.25 \cdot 10^{+44}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;t \leq 3 \cdot 10^{+92}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\ \end{array} \]

Alternative 8: 79.3% accurate, 0.8× speedup?

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

\mathbf{elif}\;z \leq -2.6 \cdot 10^{-75}:\\
\;\;\;\;t_1\\

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

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

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


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

    1. Initial program 93.5%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-93.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. sub-neg93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 inf 65.2%

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

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

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

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

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

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

    if -4.7999999999999999e-47 < z < -2.6e-75 or 1.2999999999999999e-71 < z

    1. Initial program 93.6%

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

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

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

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

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

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

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

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

    if -2.6e-75 < z < -7.0000000000000001e-148

    1. Initial program 91.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. flip-+62.6%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left({\left(\left(y \cdot t\right) \cdot \left(z \cdot 9\right)\right)}^{2} - {\left(a \cdot \left(b \cdot -27\right)\right)}^{2}\right) \cdot \frac{1}{\left(y \cdot t\right) \cdot \left(z \cdot 9\right) - a \cdot \left(b \cdot -27\right)}} \]
    8. Taylor expanded in y around inf 70.8%

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

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

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

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

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

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

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

    if -7.0000000000000001e-148 < z < 1.2999999999999999e-71

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 79.4% accurate, 0.8× speedup?

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

\mathbf{elif}\;z \leq -1.65 \cdot 10^{-79}:\\
\;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

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

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

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


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

    1. Initial program 93.5%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-93.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. sub-neg93.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 inf 65.2%

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

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

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

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

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

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

    if -3.00000000000000011e-45 < z < -1.6499999999999999e-79

    1. Initial program 99.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 x around 0 82.8%

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

    if -1.6499999999999999e-79 < z < -8.5999999999999997e-148

    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. Step-by-step derivation
      1. associate-+l-91.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. flip-+59.5%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left({\left(\left(y \cdot t\right) \cdot \left(z \cdot 9\right)\right)}^{2} - {\left(a \cdot \left(b \cdot -27\right)\right)}^{2}\right) \cdot \frac{1}{\left(y \cdot t\right) \cdot \left(z \cdot 9\right) - a \cdot \left(b \cdot -27\right)}} \]
    8. Taylor expanded in y around inf 68.3%

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

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

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

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

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

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

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

    if -8.5999999999999997e-148 < z < 1.00000000000000007e-63

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000007e-63 < z

    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. Taylor expanded in x around 0 61.2%

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

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

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

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

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

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

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

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

Alternative 10: 74.4% accurate, 1.0× speedup?

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

\mathbf{elif}\;z \leq -1950:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 700000000000:\\
\;\;\;\;t_1\\

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


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

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

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

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

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

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

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

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

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

    if -4.1000000000000001e114 < z < -1950 or -9.20000000000000033e-39 < z < 7e11

    1. Initial program 99.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-99.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-neg99.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-199.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-eval99.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-eval99.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-inv99.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-eval99.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-identity99.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*98.5%

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

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

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

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

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

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

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

    if -1950 < z < -9.20000000000000033e-39

    1. Initial program 100.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. Taylor expanded in y around inf 60.5%

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

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

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

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

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

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

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

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

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

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

    if 7e11 < z

    1. Initial program 91.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 86.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 93.3% accurate, 1.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 76.5% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -1.05e-148 or 1.30000000000000005e56 < t

    1. Initial program 96.7%

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

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

    if -1.05e-148 < t < 1.30000000000000005e56

    1. Initial program 93.0%

      \[\left(x \cdot 2 - \left(\left(y \cdot 9\right) \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
    2. Step-by-step derivation
      1. associate-+l-93.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-neg93.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-193.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-eval93.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-eval93.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-inv93.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-eval93.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-identity93.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*98.9%

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

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

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

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

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

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

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

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

Alternative 13: 78.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.05e-148

    1. Initial program 95.3%

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

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

    if -1.05e-148 < t < 3.4000000000000002e67

    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. associate-+l-93.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-neg93.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-193.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-eval93.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-eval93.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-inv93.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-eval93.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-identity93.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*98.9%

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

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

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

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

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

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

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

    if 3.4000000000000002e67 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. flip-+30.4%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left({\left(\left(y \cdot t\right) \cdot \left(z \cdot 9\right)\right)}^{2} - {\left(a \cdot \left(b \cdot -27\right)\right)}^{2}\right) \cdot \frac{1}{\left(y \cdot t\right) \cdot \left(z \cdot 9\right) - a \cdot \left(b \cdot -27\right)}} \]
    8. Taylor expanded in y around inf 66.9%

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

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

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

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

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

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

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

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

Alternative 14: 78.0% accurate, 1.1× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if t < -1.05e-148

    1. Initial program 95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 inf 64.0%

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

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

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

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

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

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

    if -1.05e-148 < t < 1.99999999999999989e66

    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. associate-+l-93.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-neg93.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-193.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-eval93.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-eval93.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-inv93.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-eval93.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-identity93.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*98.9%

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

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

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

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

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

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

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

    if 1.99999999999999989e66 < t

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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. Step-by-step derivation
      1. flip-+30.4%

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

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

      \[\leadsto x \cdot 2 - \color{blue}{\left({\left(\left(y \cdot t\right) \cdot \left(z \cdot 9\right)\right)}^{2} - {\left(a \cdot \left(b \cdot -27\right)\right)}^{2}\right) \cdot \frac{1}{\left(y \cdot t\right) \cdot \left(z \cdot 9\right) - a \cdot \left(b \cdot -27\right)}} \]
    8. Taylor expanded in y around inf 66.9%

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

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

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

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

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

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

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

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

Alternative 15: 46.5% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < -7.2e18 or 1.20000000000000003e-79 < a

    1. Initial program 94.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 52.8%

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

    if -7.2e18 < a < 1.20000000000000003e-79

    1. Initial program 96.3%

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

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

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

Alternative 16: 46.5% accurate, 1.9× speedup?

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

\mathbf{elif}\;a \leq 1.9 \cdot 10^{-82}:\\
\;\;\;\;x \cdot 2\\

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


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

    1. Initial program 95.6%

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

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

    if -5.8e19 < a < 1.9000000000000001e-82

    1. Initial program 96.3%

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

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

    if 1.9000000000000001e-82 < a

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.8 \cdot 10^{+19}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq 1.9 \cdot 10^{-82}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]

Alternative 17: 46.5% accurate, 1.9× speedup?

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

\mathbf{elif}\;a \leq 9.8 \cdot 10^{-83}:\\
\;\;\;\;x \cdot 2\\

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


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

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4e20 < a < 9.8e-83

    1. Initial program 96.3%

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

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

    if 9.8e-83 < a

    1. Initial program 93.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -5.4 \cdot 10^{+20}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;a \leq 9.8 \cdot 10^{-83}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \end{array} \]

Alternative 18: 30.2% accurate, 5.7× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ x \cdot 2 \end{array} \]
NOTE: y, z, and t 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);
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.
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;
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])
def code(x, y, z, t, a, b):
	return x * 2.0
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	return Float64(x * 2.0)
end
y, z, t = num2cell(sort([y, z, t])){:}
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.
code[x_, y_, z_, t_, a_, b_] := N[(x * 2.0), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
x \cdot 2
\end{array}
Derivation
  1. Initial program 95.3%

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

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

    \[\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 2023199 
(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)))