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

Percentage Accurate: 95.5% → 98.2%
Time: 16.3s
Alternatives: 13
Speedup: 1.0×

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 13 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.5% 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.2% accurate, 0.1× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := \left(a \cdot 27\right) \cdot b\\ \mathbf{if}\;z \leq -5 \cdot 10^{-36}:\\ \;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(z, y \cdot \left(t \cdot -9\right), t_1\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_1 + \left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\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 (* (* a 27.0) b)))
   (if (<= z -5e-36)
     (fma x 2.0 (fma z (* y (* t -9.0)) t_1))
     (+ t_1 (- (* x 2.0) (* t (* z (* y 9.0))))))))
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;
	double tmp;
	if (z <= -5e-36) {
		tmp = fma(x, 2.0, fma(z, (y * (t * -9.0)), t_1));
	} else {
		tmp = t_1 + ((x * 2.0) - (t * (z * (y * 9.0))));
	}
	return tmp;
}
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(Float64(a * 27.0) * b)
	tmp = 0.0
	if (z <= -5e-36)
		tmp = fma(x, 2.0, fma(z, Float64(y * Float64(t * -9.0)), t_1));
	else
		tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.0)))));
	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[(a * 27.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[z, -5e-36], N[(x * 2.0 + N[(z * N[(y * N[(t * -9.0), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := \left(a \cdot 27\right) \cdot b\\
\mathbf{if}\;z \leq -5 \cdot 10^{-36}:\\
\;\;\;\;\mathsf{fma}\left(x, 2, \mathsf{fma}\left(z, y \cdot \left(t \cdot -9\right), t_1\right)\right)\\

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


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

    1. Initial program 90.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. +-commutative90.5%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.00000000000000004e-36 < z

    1. Initial program 97.2%

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

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

Alternative 2: 98.2% accurate, 0.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;z \leq 2 \cdot 10^{-54}:\\ \;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;\left(a \cdot 27\right) \cdot b + \left(x \cdot 2 - t \cdot \left(z \cdot \left(y \cdot 9\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 (<= z 2e-54)
   (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b)))
   (+ (* (* a 27.0) b) (- (* x 2.0) (* t (* z (* y 9.0)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (z <= 2e-54) {
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	} else {
		tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (z * (y * 9.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 (z <= 2d-54) then
        tmp = ((x * 2.0d0) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
    else
        tmp = ((a * 27.0d0) * b) + ((x * 2.0d0) - (t * (z * (y * 9.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 (z <= 2e-54) {
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	} else {
		tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (z * (y * 9.0))));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if z <= 2e-54:
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b))
	else:
		tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (z * (y * 9.0))))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (z <= 2e-54)
		tmp = Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b)));
	else
		tmp = Float64(Float64(Float64(a * 27.0) * b) + Float64(Float64(x * 2.0) - Float64(t * Float64(z * Float64(y * 9.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 (z <= 2e-54)
		tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
	else
		tmp = ((a * 27.0) * b) + ((x * 2.0) - (t * (z * (y * 9.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[LessEqual[z, 2e-54], N[(N[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * 27.0), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x * 2.0), $MachinePrecision] - N[(t * N[(z * N[(y * 9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{-54}:\\
\;\;\;\;\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\right)\\

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


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

    1. Initial program 94.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-54 < z

    1. Initial program 97.4%

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

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

Alternative 3: 47.5% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ t_2 := 27 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;x \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-158}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{-242}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{-229}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-153}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-36}:\\ \;\;\;\;t_2\\ \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
 (let* ((t_1 (* t (* -9.0 (* z y)))) (t_2 (* 27.0 (* a b))))
   (if (<= x -5.5e+102)
     (* x 2.0)
     (if (<= x -8e-158)
       t_2
       (if (<= x -5.5e-242)
         t_1
         (if (<= x 1.02e-229)
           t_2
           (if (<= x 3.5e-153) t_1 (if (<= x 2.4e-36) t_2 (* x 2.0)))))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double t_1 = t * (-9.0 * (z * y));
	double t_2 = 27.0 * (a * b);
	double tmp;
	if (x <= -5.5e+102) {
		tmp = x * 2.0;
	} else if (x <= -8e-158) {
		tmp = t_2;
	} else if (x <= -5.5e-242) {
		tmp = t_1;
	} else if (x <= 1.02e-229) {
		tmp = t_2;
	} else if (x <= 3.5e-153) {
		tmp = t_1;
	} else if (x <= 2.4e-36) {
		tmp = t_2;
	} 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) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = t * ((-9.0d0) * (z * y))
    t_2 = 27.0d0 * (a * b)
    if (x <= (-5.5d+102)) then
        tmp = x * 2.0d0
    else if (x <= (-8d-158)) then
        tmp = t_2
    else if (x <= (-5.5d-242)) then
        tmp = t_1
    else if (x <= 1.02d-229) then
        tmp = t_2
    else if (x <= 3.5d-153) then
        tmp = t_1
    else if (x <= 2.4d-36) then
        tmp = t_2
    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 t_1 = t * (-9.0 * (z * y));
	double t_2 = 27.0 * (a * b);
	double tmp;
	if (x <= -5.5e+102) {
		tmp = x * 2.0;
	} else if (x <= -8e-158) {
		tmp = t_2;
	} else if (x <= -5.5e-242) {
		tmp = t_1;
	} else if (x <= 1.02e-229) {
		tmp = t_2;
	} else if (x <= 3.5e-153) {
		tmp = t_1;
	} else if (x <= 2.4e-36) {
		tmp = t_2;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = t * (-9.0 * (z * y))
	t_2 = 27.0 * (a * b)
	tmp = 0
	if x <= -5.5e+102:
		tmp = x * 2.0
	elif x <= -8e-158:
		tmp = t_2
	elif x <= -5.5e-242:
		tmp = t_1
	elif x <= 1.02e-229:
		tmp = t_2
	elif x <= 3.5e-153:
		tmp = t_1
	elif x <= 2.4e-36:
		tmp = t_2
	else:
		tmp = x * 2.0
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	t_1 = Float64(t * Float64(-9.0 * Float64(z * y)))
	t_2 = Float64(27.0 * Float64(a * b))
	tmp = 0.0
	if (x <= -5.5e+102)
		tmp = Float64(x * 2.0);
	elseif (x <= -8e-158)
		tmp = t_2;
	elseif (x <= -5.5e-242)
		tmp = t_1;
	elseif (x <= 1.02e-229)
		tmp = t_2;
	elseif (x <= 3.5e-153)
		tmp = t_1;
	elseif (x <= 2.4e-36)
		tmp = t_2;
	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)
	t_1 = t * (-9.0 * (z * y));
	t_2 = 27.0 * (a * b);
	tmp = 0.0;
	if (x <= -5.5e+102)
		tmp = x * 2.0;
	elseif (x <= -8e-158)
		tmp = t_2;
	elseif (x <= -5.5e-242)
		tmp = t_1;
	elseif (x <= 1.02e-229)
		tmp = t_2;
	elseif (x <= 3.5e-153)
		tmp = t_1;
	elseif (x <= 2.4e-36)
		tmp = t_2;
	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_] := Block[{t$95$1 = N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.5e+102], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -8e-158], t$95$2, If[LessEqual[x, -5.5e-242], t$95$1, If[LessEqual[x, 1.02e-229], t$95$2, If[LessEqual[x, 3.5e-153], t$95$1, If[LessEqual[x, 2.4e-36], t$95$2, N[(x * 2.0), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\
t_2 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -8 \cdot 10^{-158}:\\
\;\;\;\;t_2\\

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

\mathbf{elif}\;x \leq 1.02 \cdot 10^{-229}:\\
\;\;\;\;t_2\\

\mathbf{elif}\;x \leq 3.5 \cdot 10^{-153}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;x \leq 2.4 \cdot 10^{-36}:\\
\;\;\;\;t_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.49999999999999981e102 or 2.4e-36 < x

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.49999999999999981e102 < x < -8.00000000000000052e-158 or -5.4999999999999998e-242 < x < 1.02e-229 or 3.49999999999999981e-153 < x < 2.4e-36

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.00000000000000052e-158 < x < -5.4999999999999998e-242 or 1.02e-229 < x < 3.49999999999999981e-153

    1. Initial program 97.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -5.5 \cdot 10^{+102}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -8 \cdot 10^{-158}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq -5.5 \cdot 10^{-242}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 1.02 \cdot 10^{-229}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 3.5 \cdot 10^{-153}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-36}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 4: 47.5% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{+91}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-156}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-242}:\\ \;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-229}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-151}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-36}:\\ \;\;\;\;t_1\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (let* ((t_1 (* 27.0 (* a b))))
   (if (<= x -1.15e+91)
     (* x 2.0)
     (if (<= x -1.2e-156)
       t_1
       (if (<= x -1.45e-242)
         (* t (* y (* z -9.0)))
         (if (<= x 4.6e-229)
           t_1
           (if (<= x 5.8e-151)
             (* t (* -9.0 (* z y)))
             (if (<= x 2.4e-36) t_1 (* x 2.0)))))))))
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 tmp;
	if (x <= -1.15e+91) {
		tmp = x * 2.0;
	} else if (x <= -1.2e-156) {
		tmp = t_1;
	} else if (x <= -1.45e-242) {
		tmp = t * (y * (z * -9.0));
	} else if (x <= 4.6e-229) {
		tmp = t_1;
	} else if (x <= 5.8e-151) {
		tmp = t * (-9.0 * (z * y));
	} else if (x <= 2.4e-36) {
		tmp = t_1;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
NOTE: y, z, and t should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8), intent (in) :: a
    real(8), intent (in) :: b
    real(8) :: t_1
    real(8) :: tmp
    t_1 = 27.0d0 * (a * b)
    if (x <= (-1.15d+91)) then
        tmp = x * 2.0d0
    else if (x <= (-1.2d-156)) then
        tmp = t_1
    else if (x <= (-1.45d-242)) then
        tmp = t * (y * (z * (-9.0d0)))
    else if (x <= 4.6d-229) then
        tmp = t_1
    else if (x <= 5.8d-151) then
        tmp = t * ((-9.0d0) * (z * y))
    else if (x <= 2.4d-36) then
        tmp = t_1
    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 t_1 = 27.0 * (a * b);
	double tmp;
	if (x <= -1.15e+91) {
		tmp = x * 2.0;
	} else if (x <= -1.2e-156) {
		tmp = t_1;
	} else if (x <= -1.45e-242) {
		tmp = t * (y * (z * -9.0));
	} else if (x <= 4.6e-229) {
		tmp = t_1;
	} else if (x <= 5.8e-151) {
		tmp = t * (-9.0 * (z * y));
	} else if (x <= 2.4e-36) {
		tmp = t_1;
	} else {
		tmp = x * 2.0;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = 27.0 * (a * b)
	tmp = 0
	if x <= -1.15e+91:
		tmp = x * 2.0
	elif x <= -1.2e-156:
		tmp = t_1
	elif x <= -1.45e-242:
		tmp = t * (y * (z * -9.0))
	elif x <= 4.6e-229:
		tmp = t_1
	elif x <= 5.8e-151:
		tmp = t * (-9.0 * (z * y))
	elif x <= 2.4e-36:
		tmp = t_1
	else:
		tmp = x * 2.0
	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))
	tmp = 0.0
	if (x <= -1.15e+91)
		tmp = Float64(x * 2.0);
	elseif (x <= -1.2e-156)
		tmp = t_1;
	elseif (x <= -1.45e-242)
		tmp = Float64(t * Float64(y * Float64(z * -9.0)));
	elseif (x <= 4.6e-229)
		tmp = t_1;
	elseif (x <= 5.8e-151)
		tmp = Float64(t * Float64(-9.0 * Float64(z * y)));
	elseif (x <= 2.4e-36)
		tmp = t_1;
	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)
	t_1 = 27.0 * (a * b);
	tmp = 0.0;
	if (x <= -1.15e+91)
		tmp = x * 2.0;
	elseif (x <= -1.2e-156)
		tmp = t_1;
	elseif (x <= -1.45e-242)
		tmp = t * (y * (z * -9.0));
	elseif (x <= 4.6e-229)
		tmp = t_1;
	elseif (x <= 5.8e-151)
		tmp = t * (-9.0 * (z * y));
	elseif (x <= 2.4e-36)
		tmp = t_1;
	else
		tmp = x * 2.0;
	end
	tmp_2 = tmp;
end
NOTE: y, z, and t should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+91], N[(x * 2.0), $MachinePrecision], If[LessEqual[x, -1.2e-156], t$95$1, If[LessEqual[x, -1.45e-242], N[(t * N[(y * N[(z * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.6e-229], t$95$1, If[LessEqual[x, 5.8e-151], N[(t * N[(-9.0 * N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.4e-36], t$95$1, N[(x * 2.0), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+91}:\\
\;\;\;\;x \cdot 2\\

\mathbf{elif}\;x \leq -1.2 \cdot 10^{-156}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 4.6 \cdot 10^{-229}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 2.4 \cdot 10^{-36}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.14999999999999996e91 or 2.4e-36 < x

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.14999999999999996e91 < x < -1.2e-156 or -1.45e-242 < x < 4.59999999999999992e-229 or 5.80000000000000025e-151 < x < 2.4e-36

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.2e-156 < x < -1.45e-242

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.59999999999999992e-229 < x < 5.80000000000000025e-151

    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. Step-by-step derivation
      1. sub-neg94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+91}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -1.2 \cdot 10^{-156}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq -1.45 \cdot 10^{-242}:\\ \;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\ \mathbf{elif}\;x \leq 4.6 \cdot 10^{-229}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 5.8 \cdot 10^{-151}:\\ \;\;\;\;t \cdot \left(-9 \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;x \leq 2.4 \cdot 10^{-36}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 5: 47.5% accurate, 1.0× speedup?

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

\mathbf{elif}\;x \leq -8.5 \cdot 10^{-156}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 7.4 \cdot 10^{-230}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;x \leq 2.2 \cdot 10^{-36}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -7.40000000000000045e102 or 2.1999999999999999e-36 < x

    1. Initial program 95.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.40000000000000045e102 < x < -8.5e-156 or -3.8000000000000002e-242 < x < 7.39999999999999963e-230 or 4.1000000000000001e-151 < x < 2.1999999999999999e-36

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -8.5e-156 < x < -3.8000000000000002e-242

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 7.39999999999999963e-230 < x < 4.1000000000000001e-151

    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. Step-by-step derivation
      1. sub-neg94.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -7.4 \cdot 10^{+102}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;x \leq -8.5 \cdot 10^{-156}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq -3.8 \cdot 10^{-242}:\\ \;\;\;\;t \cdot \left(y \cdot \left(z \cdot -9\right)\right)\\ \mathbf{elif}\;x \leq 7.4 \cdot 10^{-230}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;x \leq 4.1 \cdot 10^{-151}:\\ \;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-36}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 6: 80.1% accurate, 1.0× 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(y \cdot \left(z \cdot t\right)\right)\\ t_3 := x \cdot 2 - t_2\\ \mathbf{if}\;x \leq -5.2 \cdot 10^{+115}:\\ \;\;\;\;t_3\\ \mathbf{elif}\;x \leq 3.8 \cdot 10^{+26}:\\ \;\;\;\;t_1 - t_2\\ \mathbf{elif}\;x \leq 9.5 \cdot 10^{+129}:\\ \;\;\;\;x \cdot 2 + t_1\\ \mathbf{else}:\\ \;\;\;\;t_3\\ \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 (* y (* z t))))
        (t_3 (- (* x 2.0) t_2)))
   (if (<= x -5.2e+115)
     t_3
     (if (<= x 3.8e+26)
       (- t_1 t_2)
       (if (<= x 9.5e+129) (+ (* x 2.0) t_1) t_3)))))
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 * (y * (z * t));
	double t_3 = (x * 2.0) - t_2;
	double tmp;
	if (x <= -5.2e+115) {
		tmp = t_3;
	} else if (x <= 3.8e+26) {
		tmp = t_1 - t_2;
	} else if (x <= 9.5e+129) {
		tmp = (x * 2.0) + t_1;
	} else {
		tmp = t_3;
	}
	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) :: t_3
    real(8) :: tmp
    t_1 = 27.0d0 * (a * b)
    t_2 = 9.0d0 * (y * (z * t))
    t_3 = (x * 2.0d0) - t_2
    if (x <= (-5.2d+115)) then
        tmp = t_3
    else if (x <= 3.8d+26) then
        tmp = t_1 - t_2
    else if (x <= 9.5d+129) then
        tmp = (x * 2.0d0) + t_1
    else
        tmp = t_3
    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 * (y * (z * t));
	double t_3 = (x * 2.0) - t_2;
	double tmp;
	if (x <= -5.2e+115) {
		tmp = t_3;
	} else if (x <= 3.8e+26) {
		tmp = t_1 - t_2;
	} else if (x <= 9.5e+129) {
		tmp = (x * 2.0) + t_1;
	} else {
		tmp = t_3;
	}
	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 * (y * (z * t))
	t_3 = (x * 2.0) - t_2
	tmp = 0
	if x <= -5.2e+115:
		tmp = t_3
	elif x <= 3.8e+26:
		tmp = t_1 - t_2
	elif x <= 9.5e+129:
		tmp = (x * 2.0) + t_1
	else:
		tmp = t_3
	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(y * Float64(z * t)))
	t_3 = Float64(Float64(x * 2.0) - t_2)
	tmp = 0.0
	if (x <= -5.2e+115)
		tmp = t_3;
	elseif (x <= 3.8e+26)
		tmp = Float64(t_1 - t_2);
	elseif (x <= 9.5e+129)
		tmp = Float64(Float64(x * 2.0) + t_1);
	else
		tmp = t_3;
	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 * (y * (z * t));
	t_3 = (x * 2.0) - t_2;
	tmp = 0.0;
	if (x <= -5.2e+115)
		tmp = t_3;
	elseif (x <= 3.8e+26)
		tmp = t_1 - t_2;
	elseif (x <= 9.5e+129)
		tmp = (x * 2.0) + t_1;
	else
		tmp = t_3;
	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[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * 2.0), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[x, -5.2e+115], t$95$3, If[LessEqual[x, 3.8e+26], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[x, 9.5e+129], N[(N[(x * 2.0), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$3]]]]]]
\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(y \cdot \left(z \cdot t\right)\right)\\
t_3 := x \cdot 2 - t_2\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+115}:\\
\;\;\;\;t_3\\

\mathbf{elif}\;x \leq 3.8 \cdot 10^{+26}:\\
\;\;\;\;t_1 - t_2\\

\mathbf{elif}\;x \leq 9.5 \cdot 10^{+129}:\\
\;\;\;\;x \cdot 2 + t_1\\

\mathbf{else}:\\
\;\;\;\;t_3\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -5.2000000000000001e115 or 9.5000000000000004e129 < x

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.2000000000000001e115 < x < 3.8000000000000002e26

    1. Initial program 95.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.8000000000000002e26 < x < 9.5000000000000004e129

    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. sub-neg93.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 77.3% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;b \leq -1.85 \cdot 10^{-85}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;b \leq 2.7 \cdot 10^{+14}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{else}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + y \cdot \left(z \cdot \left(t \cdot -9\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 (<= b -1.85e-85)
   (+ (* x 2.0) (* 27.0 (* a b)))
   (if (<= b 2.7e+14)
     (- (* x 2.0) (* 9.0 (* y (* z t))))
     (+ (* a (* 27.0 b)) (* y (* z (* t -9.0)))))))
assert(y < z && z < t);
double code(double x, double y, double z, double t, double a, double b) {
	double tmp;
	if (b <= -1.85e-85) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else if (b <= 2.7e+14) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else {
		tmp = (a * (27.0 * b)) + (y * (z * (t * -9.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 (b <= (-1.85d-85)) then
        tmp = (x * 2.0d0) + (27.0d0 * (a * b))
    else if (b <= 2.7d+14) then
        tmp = (x * 2.0d0) - (9.0d0 * (y * (z * t)))
    else
        tmp = (a * (27.0d0 * b)) + (y * (z * (t * (-9.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 (b <= -1.85e-85) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else if (b <= 2.7e+14) {
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	} else {
		tmp = (a * (27.0 * b)) + (y * (z * (t * -9.0)));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if b <= -1.85e-85:
		tmp = (x * 2.0) + (27.0 * (a * b))
	elif b <= 2.7e+14:
		tmp = (x * 2.0) - (9.0 * (y * (z * t)))
	else:
		tmp = (a * (27.0 * b)) + (y * (z * (t * -9.0)))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (b <= -1.85e-85)
		tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b)));
	elseif (b <= 2.7e+14)
		tmp = Float64(Float64(x * 2.0) - Float64(9.0 * Float64(y * Float64(z * t))));
	else
		tmp = Float64(Float64(a * Float64(27.0 * b)) + Float64(y * Float64(z * Float64(t * -9.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 (b <= -1.85e-85)
		tmp = (x * 2.0) + (27.0 * (a * b));
	elseif (b <= 2.7e+14)
		tmp = (x * 2.0) - (9.0 * (y * (z * t)));
	else
		tmp = (a * (27.0 * b)) + (y * (z * (t * -9.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[LessEqual[b, -1.85e-85], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.7e+14], N[(N[(x * 2.0), $MachinePrecision] - N[(9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision] + N[(y * N[(z * N[(t * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.85 \cdot 10^{-85}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\

\mathbf{elif}\;b \leq 2.7 \cdot 10^{+14}:\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\

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


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

    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. Step-by-step derivation
      1. sub-neg91.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.84999999999999992e-85 < b < 2.7e14

    1. Initial program 97.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.7e14 < b

    1. Initial program 97.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 95.6% accurate, 1.0× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\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
 (+ (- (* x 2.0) (* (* y 9.0) (* z t))) (* a (* 27.0 b))))
assert(y < z && z < t);
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));
}
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) - ((y * 9.0d0) * (z * t))) + (a * (27.0d0 * b))
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 * 9.0) * (z * t))) + (a * (27.0 * b));
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	return ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b))
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	return Float64(Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))) + Float64(a * Float64(27.0 * b)))
end
y, z, t = num2cell(sort([y, z, t])){:}
function tmp = code(x, y, z, t, a, b)
	tmp = ((x * 2.0) - ((y * 9.0) * (z * t))) + (a * (27.0 * b));
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[(N[(x * 2.0), $MachinePrecision] - N[(N[(y * 9.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(27.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\left(x \cdot 2 - \left(y \cdot 9\right) \cdot \left(z \cdot t\right)\right) + a \cdot \left(27 \cdot b\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. Step-by-step derivation
    1. sub-neg95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 9: 46.0% accurate, 1.3× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} t_1 := 27 \cdot \left(a \cdot b\right)\\ \mathbf{if}\;a \leq -1 \cdot 10^{+27}:\\ \;\;\;\;t_1\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{-170}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-188}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-115}:\\ \;\;\;\;x \cdot 2\\ \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 (* 27.0 (* a b))))
   (if (<= a -1e+27)
     t_1
     (if (<= a -4.8e-170)
       (* x 2.0)
       (if (<= a 1.15e-188)
         (* -9.0 (* y (* z t)))
         (if (<= a 9.5e-115) (* x 2.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 = 27.0 * (a * b);
	double tmp;
	if (a <= -1e+27) {
		tmp = t_1;
	} else if (a <= -4.8e-170) {
		tmp = x * 2.0;
	} else if (a <= 1.15e-188) {
		tmp = -9.0 * (y * (z * t));
	} else if (a <= 9.5e-115) {
		tmp = x * 2.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 = 27.0d0 * (a * b)
    if (a <= (-1d+27)) then
        tmp = t_1
    else if (a <= (-4.8d-170)) then
        tmp = x * 2.0d0
    else if (a <= 1.15d-188) then
        tmp = (-9.0d0) * (y * (z * t))
    else if (a <= 9.5d-115) then
        tmp = x * 2.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 = 27.0 * (a * b);
	double tmp;
	if (a <= -1e+27) {
		tmp = t_1;
	} else if (a <= -4.8e-170) {
		tmp = x * 2.0;
	} else if (a <= 1.15e-188) {
		tmp = -9.0 * (y * (z * t));
	} else if (a <= 9.5e-115) {
		tmp = x * 2.0;
	} else {
		tmp = t_1;
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	t_1 = 27.0 * (a * b)
	tmp = 0
	if a <= -1e+27:
		tmp = t_1
	elif a <= -4.8e-170:
		tmp = x * 2.0
	elif a <= 1.15e-188:
		tmp = -9.0 * (y * (z * t))
	elif a <= 9.5e-115:
		tmp = x * 2.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(27.0 * Float64(a * b))
	tmp = 0.0
	if (a <= -1e+27)
		tmp = t_1;
	elseif (a <= -4.8e-170)
		tmp = Float64(x * 2.0);
	elseif (a <= 1.15e-188)
		tmp = Float64(-9.0 * Float64(y * Float64(z * t)));
	elseif (a <= 9.5e-115)
		tmp = Float64(x * 2.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 = 27.0 * (a * b);
	tmp = 0.0;
	if (a <= -1e+27)
		tmp = t_1;
	elseif (a <= -4.8e-170)
		tmp = x * 2.0;
	elseif (a <= 1.15e-188)
		tmp = -9.0 * (y * (z * t));
	elseif (a <= 9.5e-115)
		tmp = x * 2.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[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1e+27], t$95$1, If[LessEqual[a, -4.8e-170], N[(x * 2.0), $MachinePrecision], If[LessEqual[a, 1.15e-188], N[(-9.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-115], N[(x * 2.0), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(a \cdot b\right)\\
\mathbf{if}\;a \leq -1 \cdot 10^{+27}:\\
\;\;\;\;t_1\\

\mathbf{elif}\;a \leq -4.8 \cdot 10^{-170}:\\
\;\;\;\;x \cdot 2\\

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

\mathbf{elif}\;a \leq 9.5 \cdot 10^{-115}:\\
\;\;\;\;x \cdot 2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -1e27 or 9.4999999999999996e-115 < a

    1. Initial program 94.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e27 < a < -4.7999999999999999e-170 or 1.15e-188 < a < 9.4999999999999996e-115

    1. Initial program 98.1%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.7999999999999999e-170 < a < 1.15e-188

    1. Initial program 95.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+27}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{elif}\;a \leq -4.8 \cdot 10^{-170}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;a \leq 1.15 \cdot 10^{-188}:\\ \;\;\;\;-9 \cdot \left(y \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;a \leq 9.5 \cdot 10^{-115}:\\ \;\;\;\;x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \end{array} \]

Alternative 10: 74.0% accurate, 1.3× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 3.70000000000000023e133

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.70000000000000023e133 < t

    1. Initial program 96.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 70.0% accurate, 1.5× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;t \leq 1.32 \cdot 10^{+166}:\\ \;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;t \cdot \left(z \cdot \left(y \cdot -9\right)\right)\\ \end{array} \end{array} \]
NOTE: y, z, and t should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
 :precision binary64
 (if (<= t 1.32e+166) (+ (* x 2.0) (* 27.0 (* a b))) (* t (* z (* y -9.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.32e+166) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else {
		tmp = t * (z * (y * -9.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.32d+166) then
        tmp = (x * 2.0d0) + (27.0d0 * (a * b))
    else
        tmp = t * (z * (y * (-9.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.32e+166) {
		tmp = (x * 2.0) + (27.0 * (a * b));
	} else {
		tmp = t * (z * (y * -9.0));
	}
	return tmp;
}
[y, z, t] = sort([y, z, t])
def code(x, y, z, t, a, b):
	tmp = 0
	if t <= 1.32e+166:
		tmp = (x * 2.0) + (27.0 * (a * b))
	else:
		tmp = t * (z * (y * -9.0))
	return tmp
y, z, t = sort([y, z, t])
function code(x, y, z, t, a, b)
	tmp = 0.0
	if (t <= 1.32e+166)
		tmp = Float64(Float64(x * 2.0) + Float64(27.0 * Float64(a * b)));
	else
		tmp = Float64(t * Float64(z * Float64(y * -9.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.32e+166)
		tmp = (x * 2.0) + (27.0 * (a * b));
	else
		tmp = t * (z * (y * -9.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[LessEqual[t, 1.32e+166], N[(N[(x * 2.0), $MachinePrecision] + N[(27.0 * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(z * N[(y * -9.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z, t] = \mathsf{sort}([y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.32 \cdot 10^{+166}:\\
\;\;\;\;x \cdot 2 + 27 \cdot \left(a \cdot b\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < 1.3199999999999999e166

    1. Initial program 95.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.3199999999999999e166 < t

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 12: 46.2% accurate, 1.9× speedup?

\[\begin{array}{l} [y, z, t] = \mathsf{sort}([y, z, t])\\ \\ \begin{array}{l} \mathbf{if}\;a \leq -1 \cdot 10^{+27} \lor \neg \left(a \leq 4.6 \cdot 10^{-141}\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 -1e+27) (not (<= a 4.6e-141))) (* 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 <= -1e+27) || !(a <= 4.6e-141)) {
		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 <= (-1d+27)) .or. (.not. (a <= 4.6d-141))) 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 <= -1e+27) || !(a <= 4.6e-141)) {
		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 <= -1e+27) or not (a <= 4.6e-141):
		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 <= -1e+27) || !(a <= 4.6e-141))
		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 <= -1e+27) || ~((a <= 4.6e-141)))
		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, -1e+27], N[Not[LessEqual[a, 4.6e-141]], $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 -1 \cdot 10^{+27} \lor \neg \left(a \leq 4.6 \cdot 10^{-141}\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 < -1e27 or 4.5999999999999999e-141 < a

    1. Initial program 94.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1e27 < a < 4.5999999999999999e-141

    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 \]
    2. Step-by-step derivation
      1. sub-neg97.0%

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

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

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

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

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

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

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

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

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

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

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

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

      \[\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 -1 \cdot 10^{+27} \lor \neg \left(a \leq 4.6 \cdot 10^{-141}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2\\ \end{array} \]

Alternative 13: 31.0% 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. Step-by-step derivation
    1. sub-neg95.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto x \cdot 2 \]

Developer target: 95.1% 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 2023279 
(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)))