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

Percentage Accurate: 95.5% → 98.5%
Time: 14.7s
Alternatives: 16
Speedup: 0.9×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 16 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 95.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.5% accurate, 0.1× speedup?

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

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


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

    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. +-commutative97.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.0000000000000001e-218 < z

    1. Initial program 98.2%

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

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

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

        \[\leadsto \left(x \cdot 2 - \left(\color{blue}{\left(y \cdot 9\right)} \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      3. associate-*r*98.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 \]
    4. Simplified98.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 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.9%

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

Alternative 2: 73.8% accurate, 0.8× speedup?

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

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

\mathbf{elif}\;b \leq 5.2 \cdot 10^{+130} \lor \neg \left(b \leq 1.35 \cdot 10^{+160}\right):\\
\;\;\;\;t_1 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if b < -4.19999999999999983e-158

    1. Initial program 95.3%

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

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

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

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

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

    if -4.19999999999999983e-158 < b < 2.5000000000000002e96

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.5000000000000002e96 < b < 5.1999999999999996e130 or 1.35e160 < b

    1. Initial program 99.7%

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

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

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

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

    if 5.1999999999999996e130 < b < 1.35e160

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -4.2 \cdot 10^{-158}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\ \mathbf{elif}\;b \leq 2.5 \cdot 10^{+96}:\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;b \leq 5.2 \cdot 10^{+130} \lor \neg \left(b \leq 1.35 \cdot 10^{+160}\right):\\ \;\;\;\;27 \cdot \left(a \cdot b\right) - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 3: 97.0% accurate, 0.9× speedup?

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

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -5.4999999999999996e83 < z

    1. Initial program 98.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. +-commutative98.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 4: 98.1% accurate, 0.9× speedup?

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


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

    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. sub-neg97.0%

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

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

    if 1.99999999999999989e-201 < z

    1. Initial program 98.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. +-commutative98.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 2 \cdot 10^{-201}:\\ \;\;\;\;\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(\left(t \cdot -9\right) \cdot \left(z \cdot y\right) + 27 \cdot \left(a \cdot b\right)\right) + x \cdot 2\\ \end{array} \]

Alternative 5: 98.1% accurate, 0.9× speedup?

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


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

    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. sub-neg97.0%

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

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

    if 2.0000000000000001e-219 < z

    1. Initial program 98.2%

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

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

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

        \[\leadsto \left(x \cdot 2 - \left(\color{blue}{\left(y \cdot 9\right)} \cdot z\right) \cdot t\right) + \left(a \cdot 27\right) \cdot b \]
      3. associate-*r*98.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 \]
    4. Simplified98.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 \]
  3. Recombined 2 regimes into one program.
  4. Final simplification97.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq 2 \cdot 10^{-219}:\\ \;\;\;\;\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(x \cdot 2 - t \cdot \left(y \cdot \left(z \cdot 9\right)\right)\right) + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 6: 48.8% accurate, 1.0× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -2.02000000000000011e-106 or 1.7000000000000001e-38 < z

    1. Initial program 96.3%

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

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

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

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

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

    if -2.02000000000000011e-106 < z < -6.79999999999999978e-307 or 1.7e-89 < z < 1.8199999999999999e-53

    1. Initial program 99.6%

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

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

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

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

    if -6.79999999999999978e-307 < z < 1.7e-89

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)} \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}\right) \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}} \]
      2. pow345.5%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    8. Applied egg-rr45.5%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt46.1%

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

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
    10. Applied egg-rr46.2%

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

    if 1.8199999999999999e-53 < z < 1.7000000000000001e-38

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*100.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. Simplified100.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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    7. Step-by-step derivation
      1. add-cube-cbrt3.9%

        \[\leadsto \color{blue}{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)} \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}\right) \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}} \]
      2. pow33.9%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    8. Applied egg-rr3.9%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt3.9%

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

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

        \[\leadsto \color{blue}{\left(27 \cdot b\right) \cdot a} \]
    10. Applied egg-rr3.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -2.02 \cdot 10^{-106}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{elif}\;z \leq -6.8 \cdot 10^{-307}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-89}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;z \leq 1.82 \cdot 10^{-53}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 1.7 \cdot 10^{-38}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \end{array} \]

Alternative 7: 49.8% accurate, 1.0× speedup?

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

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -4.50000000000000016e-107 or 9.4999999999999999e-39 < z

    1. Initial program 96.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -4.50000000000000016e-107 < z < -6.1999999999999996e-307 or 6.00000000000000041e-90 < z < 1.8e-55

    1. Initial program 99.6%

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

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

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

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

    if -6.1999999999999996e-307 < z < 6.00000000000000041e-90

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    7. Step-by-step derivation
      1. add-cube-cbrt46.3%

        \[\leadsto \color{blue}{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)} \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}\right) \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}} \]
      2. pow346.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    8. Applied egg-rr46.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt46.9%

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

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
    10. Applied egg-rr47.0%

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

    if 1.8e-55 < z < 9.4999999999999999e-39

    1. Initial program 100.0%

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

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

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

        \[\leadsto \left(x \cdot 2 - \color{blue}{\left(y \cdot 9\right) \cdot \left(z \cdot t\right)}\right) + \left(a \cdot 27\right) \cdot b \]
      4. associate-*l*100.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. Simplified100.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. Step-by-step derivation
      1. +-commutative100.0%

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{27 \cdot \left(a \cdot b\right)} \]
    7. Step-by-step derivation
      1. add-cube-cbrt3.9%

        \[\leadsto \color{blue}{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)} \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}\right) \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}} \]
      2. pow33.9%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    8. Applied egg-rr3.9%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt3.9%

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

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

        \[\leadsto \color{blue}{\left(27 \cdot b\right) \cdot a} \]
    10. Applied egg-rr3.9%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -4.5 \cdot 10^{-107}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -6.2 \cdot 10^{-307}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 6 \cdot 10^{-90}:\\ \;\;\;\;b \cdot \left(a \cdot 27\right)\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-55}:\\ \;\;\;\;x \cdot 2\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{-39}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right)\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \end{array} \]

Alternative 8: 72.2% accurate, 1.0× speedup?

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

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-38}:\\
\;\;\;\;t_1\\

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

\mathbf{elif}\;z \leq 1.9 \cdot 10^{+27}:\\
\;\;\;\;t_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -6.79999999999999953e-100 or 1.90000000000000011e27 < z

    1. Initial program 95.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-neg95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -6.79999999999999953e-100 < z < 2.10000000000000013e-38 or 1.7999999999999999e-22 < z < 1.90000000000000011e27

    1. Initial program 99.8%

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

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

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

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

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

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

    if 2.10000000000000013e-38 < z < 1.7999999999999999e-22

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(-\color{blue}{t \cdot 9}\right) \cdot z\right) \]
      12. distribute-rgt-neg-in11.9%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6.8 \cdot 10^{-100}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-38}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\ \mathbf{elif}\;z \leq 1.8 \cdot 10^{-22}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 1.9 \cdot 10^{+27}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \end{array} \]

Alternative 9: 72.2% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.1999999999999997e-100 or 9.50000000000000054e26 < z

    1. Initial program 95.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-neg95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.1999999999999997e-100 < z < 2.40000000000000022e-38

    1. Initial program 99.8%

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

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

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

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

    if 2.40000000000000022e-38 < z < 1.1e-22

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(-\color{blue}{t \cdot 9}\right) \cdot z\right) \]
      12. distribute-rgt-neg-in11.9%

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

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

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

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

    if 1.1e-22 < z < 9.50000000000000054e26

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.2 \cdot 10^{-100}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 2.4 \cdot 10^{-38}:\\ \;\;\;\;27 \cdot \left(a \cdot b\right) + x \cdot 2\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-22}:\\ \;\;\;\;y \cdot \left(-9 \cdot \left(z \cdot t\right)\right)\\ \mathbf{elif}\;z \leq 9.5 \cdot 10^{+26}:\\ \;\;\;\;a \cdot \left(27 \cdot b\right) + x \cdot 2\\ \mathbf{else}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \end{array} \]

Alternative 10: 72.2% accurate, 1.0× speedup?

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

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -7.1999999999999997e-100 or 8.0000000000000001e27 < z

    1. Initial program 95.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-neg95.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.1999999999999997e-100 < z < 2.50000000000000017e-38

    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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.50000000000000017e-38 < z < 3.80000000000000023e-22

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto y \cdot \left(\left(-\color{blue}{t \cdot 9}\right) \cdot z\right) \]
      12. distribute-rgt-neg-in11.9%

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

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

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

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

    if 3.80000000000000023e-22 < z < 8.0000000000000001e27

    1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 11: 79.0% accurate, 1.0× speedup?

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

\mathbf{elif}\;z \leq -2.15 \cdot 10^{-100} \lor \neg \left(z \leq 5.2 \cdot 10^{-39}\right):\\
\;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\

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


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

    1. Initial program 90.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -7.8000000000000002e81 < z < -2.14999999999999999e-100 or 5.2e-39 < z

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

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

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

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

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

    if -2.14999999999999999e-100 < z < 5.2e-39

    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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -7.8 \cdot 10^{+81}:\\ \;\;\;\;-9 \cdot \left(z \cdot \left(y \cdot t\right)\right)\\ \mathbf{elif}\;z \leq -2.15 \cdot 10^{-100} \lor \neg \left(z \leq 5.2 \cdot 10^{-39}\right):\\ \;\;\;\;x \cdot 2 - 9 \cdot \left(t \cdot \left(z \cdot y\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x \cdot 2 + b \cdot \left(a \cdot 27\right)\\ \end{array} \]

Alternative 12: 79.7% accurate, 1.1× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -2.5e-100 or 1.7500000000000001e-38 < z

    1. Initial program 96.2%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.5e-100 < z < 1.7500000000000001e-38

    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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 13: 80.2% accurate, 1.1× speedup?

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

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

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


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.55000000000000004e-105 < z < 3.3999999999999999e-39

    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. +-commutative99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 3.3999999999999999e-39 < z

    1. Initial program 97.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-neg97.3%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 14: 46.0% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -2.8e-40 or 1.62e90 < b

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.8e-40 < b < 1.62e90

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

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

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

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

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

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

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

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

Alternative 15: 46.0% accurate, 1.9× speedup?

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if b < -1.13999999999999997e-39 or 3.4999999999999998e90 < b

    1. Initial program 96.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)} \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}\right) \cdot \sqrt[3]{27 \cdot \left(a \cdot b\right)}} \]
      2. pow351.3%

        \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    8. Applied egg-rr51.3%

      \[\leadsto \color{blue}{{\left(\sqrt[3]{27 \cdot \left(a \cdot b\right)}\right)}^{3}} \]
    9. Step-by-step derivation
      1. rem-cube-cbrt51.8%

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

        \[\leadsto \color{blue}{\left(27 \cdot a\right) \cdot b} \]
    10. Applied egg-rr51.7%

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

    if -1.13999999999999997e-39 < b < 3.4999999999999998e90

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

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

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

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

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

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

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

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

Alternative 16: 31.9% accurate, 5.7× speedup?

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

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

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

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

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

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

    \[\leadsto x \cdot 2 \]

Developer target: 95.0% 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 2023332 
(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)))